/**
 * Custom Hebrew Calendar Styles
 * Matches the design from the reference image
 */

.custom-calendar-wrapper {
    width: 100%;
    max-width: 100%;
    background: #E8E8E8;
    border-radius: 20px;
    padding: 20px;
    margin: 0 auto;
    font-family: var(--font-main, 'Heebo', sans-serif);
    font-size: 20px;
    font-weight: bold;
    direction: rtl;
    text-align: center;
    box-sizing: border-box;
}

/* Title with icon */
.custom-calendar-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 20px;
    font-weight: bold;
    color: var(--black-color, #333);
    margin-bottom: 15px;
}

.custom-calendar-icon {
    width: 24px;
    height: 24px;
    color: var(--black-color, #333);
}

/* Navigation header */
.custom-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 auto 20px auto;
    padding: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.custom-calendar-month {
    font-size: 20px;
    font-weight: bold;
    color: var(--black-color, #333);
    flex: 1;
    text-align: center;
}

.custom-calendar-nav {
    background: none;
    border: none;
    font-size: 24px;
    font-weight: bold;
    color: var(--black-color, #333);
    cursor: pointer;
    padding: 5px 15px;
    transition: opacity 0.2s;
}

.custom-calendar-nav:hover {
    opacity: 0.6;
}

.custom-calendar-nav:active {
    opacity: 0.3;
}

/* Weekday headers */
.custom-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin: 0 auto 10px auto;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.custom-calendar-weekday {
    font-size: 20px;
    font-weight: bold;
    color: var(--black-color, #333);
    padding: 10px 0;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Days grid */
.custom-calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin: 0 auto 15px auto;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.custom-calendar-day {
    aspect-ratio: 1;
    border: none;
    background: transparent;
    font-size: 20px;
    font-weight: bold;
    color: var(--black-color, #333);
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-main, 'Heebo', sans-serif);
}

.custom-calendar-day-empty {
    cursor: default;
    pointer-events: none;
}

/* Today - Red/Orange filled circle */
.custom-calendar-day-today {
    background: #E85D75;
    color: white;
}

.custom-calendar-day-today:hover {
    background: #d54d65;
}

/* Selected date - Black outline circle */
.custom-calendar-day-selected {
    border: 3px solid var(--black-color, #333);
    color: var(--black-color, #333);
    background: transparent;
}

.custom-calendar-day-selected.custom-calendar-day-today {
    background: #E85D75;
    color: white;
    border-color: var(--black-color, #333);
}

/* Disabled dates - Light gray */
.custom-calendar-day-disabled {
    color: #BDBDBD;
    cursor: not-allowed;
    opacity: 0.5;
}

/* Available dates (hover effect) */
.custom-calendar-day:not(.custom-calendar-day-disabled):not(.custom-calendar-day-empty):hover {
    background: rgba(0, 0, 0, 0.1);
}

.custom-calendar-day-today:hover {
    background: #d54d65;
}

.custom-calendar-day-selected:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* Availability info section */
.custom-calendar-info {
    display: none;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.availability-text {
    font-size: 20px;
    font-weight: bold;
    color: var(--black-color, #333);
    text-align: center;
    line-height: 1.5;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .custom-calendar-wrapper {
        padding: 15px;
        font-size: 18px;
    }

    .custom-calendar-month {
        font-size: 18px;
    }

    .custom-calendar-weekday {
        font-size: 18px;
        padding: 8px 0;
    }

    .custom-calendar-day {
        font-size: 18px;
    }

    .custom-calendar-title {
        font-size: 18px;
    }
    
    .availability-text {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .custom-calendar-wrapper {
        padding: 12px;
        font-size: 16px;
    }

    .custom-calendar-month {
        font-size: 16px;
    }

    .custom-calendar-weekday {
        font-size: 16px;
        padding: 6px 0;
    }

    .custom-calendar-day {
        font-size: 16px;
    }

    .custom-calendar-nav {
        font-size: 20px;
        padding: 5px 10px;
    }
    
    .custom-calendar-title {
        font-size: 16px;
    }
    
    .availability-text {
        font-size: 16px;
    }
}

/* Animation for month change */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.custom-calendar-days {
    animation: fadeIn 0.2s ease-in-out;
}

/* Ensure calendar is centered within form containers */
#calendar-private,
#calendar-public {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

#calendar-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#calendar-wrapper > div {
    width: 100%;
    max-width: 100%;
}

/* Stock availability indicator - red circle */
.custom-calendar-day.has-stock::after {
    content: '';
    position: absolute;
    top: 2px;
    right: 2px;
    width: 8px;
    height: 8px;
    background-color: #E85D75;
    border-radius: 50%;
    z-index: 1;
}

/* Today indicator with stock - keep red circle */
.custom-calendar-day-today.has-stock::after {
    top: 4px;
    right: 4px;
}

/* Tooltip on hover */
.custom-calendar-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: normal;
    white-space: nowrap;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.custom-calendar-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
}

.custom-calendar-tooltip.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(-12px);
}

/* Day button needs relative positioning for tooltip */
.custom-calendar-day {
    position: relative;
}


