
.calendar-row {
    display:grid;
    grid-template-columns: 1fr 1.4fr;
    gap:40px;
    margin-top:20px;
}

.section-header {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

#memberSelect {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

/* Constrain expert dropdown to calendar column width */
.expert-section {
    width: calc((100% - 40px) / 2.4); /* Match the calendar column width in the grid */
}

@media (min-width: 769px) {
    #memberSelect {
        width: calc((100% - 40px) / 2.4); /* Match the calendar column width */
    }
}

.month-header {
    display: grid;
    grid-template-columns: 32px 1fr 32px;
    align-items: center;
    font-weight: 600;
    margin-bottom: 12px;
}

.month-header #monthLabel {
    text-align: center;
    justify-self: center;
}

.month-header button {
    background: none;
    border: none;
    font-size: 16px;
    color: #333;
    cursor: pointer;
    padding: 4px 8px;
    min-height: 32px;
    min-width: 32px;
}

.month-header button:hover:not(:disabled) {
    color: #000;
}

.month-header button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}


.weekday-row {
    display:grid;
    grid-template-columns:repeat(7,1fr);
    font-size:13px;
    color:#777;
    margin-bottom:8px;
}

.weekday-row span {
    align-items: center;
    justify-self: center;
}

.calendar-grid {
    display:grid;
    grid-template-columns:repeat(7,1fr);
    gap:8px;
}

.day {
    height:36px;
    border-radius:50%;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:14px;
    cursor:pointer;
}

.day.other-month {
    color: #ccc;
    cursor: default;
}

.day.has-slots {
    background: #daf6da;
}
.day.has-slots::after {
    content:"";
    width:4px;
    height:4px;
    background:#2e7d32;
    border-radius:50%;
    position:absolute;
    margin-top:20px;
}

.day.selected {
    background:#333;
    color:#fff;
}

.day.selected::after {
    display: none;
}

.time-grid {
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:12px;
    margin-top:12px;
}

.time-btn {
    padding:10px;
    border:1px solid #ccc;
    background:#fff;
}

.time-btn.selected {
    background:#333;
    color:#fff;
}

.time-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    text-align: center;
    grid-column: 1 / -1; /* Span all columns in the grid */
}

.clock-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.placeholder-text {
    color: #666;
    font-size: 14px;
    margin: 0;
    max-width: 200px;
    line-height: 1.4;
}

/* Loading indicators */
.field-label.loading .loading-text,
.time-header.loading .loading-text,
.loading-text {
    color: #999;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.4;
    }
}

.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    /*border-radius: 4px;*/
    position: relative;
}

.day.loading-skeleton {
    height: 36px;
    border-radius: 50%;
    cursor: default;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.day.loading-skeleton.other-month {
    color: #ccc;
}

.day.loading-skeleton.empty {
    color: transparent;
}

.time-btn.loading-skeleton {
    padding: 10px;
    border: 1px solid #eee;
    cursor: default;
    min-height: 20px;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    /* Fix mobile select dropdown styling */
    #memberSelect {
        font-size: 16px;
        line-height: 1.2;
        background-color: #fff;
        color: #333;
        min-height: 44px;
        box-sizing: border-box;
        /* iOS/Safari specific fixes */
        -webkit-appearance: menulist;
        -moz-appearance: menulist;
        appearance: menulist;
        border-radius: 0;
    }

    /* Ensure dropdown options are properly styled */
    #memberSelect option {
        font-size: 16px;
        line-height: 1.4;
        padding: 8px 12px;
        color: #333;
        background-color: #fff;
        min-height: 44px;
    }

    /* Prevent positioning issues on mobile */
    #memberSelect:focus {
        -webkit-user-select: auto;
        user-select: auto;
        position: relative;
        z-index: 1;
    }

    .calendar-row {
        display: block; /* Stack vertically on tablet */
        gap: 0;
        margin-top: 16px;
    }

    .calendar {
        margin-bottom: 20px;
    }

    .month-header {
        margin-bottom: 10px;
        font-size: 16px;
    }

    .month-header button {
        background: none;
        border: none;
        font-size: 14px;
        color: #333;
        cursor: pointer;
        padding: 4px 8px;
        min-height: 44px; /* Touch-friendly */
        min-width: 44px;
    }

    .month-header button:hover:not(:disabled) {
        color: #000;
    }

    .month-header button:disabled {
        opacity: 0.3;
        cursor: not-allowed;
    }

    .weekday-row {
        font-size: 12px;
        margin-bottom: 6px;
        text-align: center;
        color: #777;
    }

    .calendar-grid {
        gap: 4px;
    }

    .day {
        height: 36px;
        font-size: 14px;
        transition: all 0.2s ease;
    }

    .day.has-slots {
        background: #daf6da;
        color: #2e7d32;
        font-weight: 500;
    }

    .day.has-slots:active {
        transform: scale(0.95);
    }

    .day.selected {
        background: #333;
        color: #fff;
        font-weight: 600;
    }

    .day.selected::after {
        display: none;
    }

    .time-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on tablet */
        gap: 8px;
        margin-top: 10px;
    }

    .time-btn {
        padding: 12px 8px;
        font-size: 14px;
        border-radius: 4px;
        cursor: pointer;
        transition: all 0.2s ease;
        min-height: 44px; /* Touch-friendly */
        border: 1px solid #ddd;
        background: #fff;
        text-align: center;
    }

    .time-btn:hover:not(.selected) {
        border-color: #999;
        background: #f9f9f9;
    }

    .time-btn.selected {
        background: #333;
        color: #fff;
        border-color: #333;
        font-weight: 600;
    }

    .time-btn:active {
        transform: scale(0.98);
    }

    .time-placeholder {
        height: 140px;
        grid-column: 1 / -1; /* Span all columns */
    }

    .clock-icon {
        width: 48px;
        height: 48px;
        margin-bottom: 12px;
        opacity: 0.5;
    }

    .placeholder-text {
        font-size: 13px;
        max-width: 180px;
        color: #666;
    }

    /* Form elements responsive */
    #memberSelect {
        padding: 12px;
        font-size: 16px; /* Prevents zoom on iOS */
        border-radius: 6px;
        border: 1px solid #ccc;
        width: 100%;
        min-height: 44px;
        box-sizing: border-box;
        background: #fff;
    }

    .field-label {
        font-size: 14px;
        margin-bottom: 6px;
        display: block;
        font-weight: 600;
        color: #333;
    }

    .time-header {
        font-size: 15px;
        margin-bottom: 10px;
        color: #333;
        font-weight: 600;
    }
}

@media (max-width: 480px) {
    /* Fix mobile select dropdown styling */
    #memberSelect {
        font-size: 16px !important;
        line-height: 1.2;
        background-color: #fff;
        color: #333;
        /* iOS/Safari specific fixes */
        -webkit-appearance: menulist;
        -moz-appearance: menulist;
        appearance: menulist;
        border-radius: 0;
    }

    /* Ensure dropdown options are properly styled */
    #memberSelect option {
        font-size: 16px !important;
        line-height: 1.4;
        padding: 8px 12px;
        color: #333;
        background-color: #fff;
        min-height: 44px;
    }

    /* Prevent positioning issues on mobile */
    #memberSelect:focus {
        -webkit-user-select: auto;
        user-select: auto;
        position: relative;
        z-index: 1;
    }

    .calendar-row {
        margin-top: 12px;
    }

    .calendar {
        margin-bottom: 16px;
    }

    .month-header {
        margin-bottom: 6px;
        font-size: 15px;
    }

    .month-header button {
        background: none;
        border: none;
        font-size: 13px;
        color: #333;
        cursor: pointer;
        padding: 4px 6px;
        min-height: 40px;
        min-width: 40px;
    }

    .month-header button:hover:not(:disabled) {
        color: #000;
    }

    .weekday-row {
        font-size: 10px;
        margin-bottom: 3px;
        color: #888;
    }

    .calendar-grid {
        gap: 2px;
    }

    .day {
        height: 32px;
        font-size: 12px;
        border-radius: 50%;
    }

    .day.has-slots {
        background: #daf6da;
        color: #2e7d32;
        font-weight: 600;
    }

    .day.has-slots::after {
        width: 3px;
        height: 3px;
        margin-top: 16px;
        background: #2e7d32;
    }

    .day.selected {
        background: #333;
        color: #fff;
        font-weight: 600;
    }

    .day.selected::after {
        display: none;
    }

    .day.other-month {
        color: #ccc;
    }

    .time-grid {
        grid-template-columns: 1fr; /* Single column on mobile */
        gap: 6px;
        margin-top: 8px;
    }

    .time-btn {
        padding: 12px 16px;
        font-size: 14px;
        min-height: 44px;
        border: 1px solid #ddd;
        background: #fff;
        border-radius: 4px;
        text-align: center;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .time-btn:hover:not(.selected) {
        border-color: #999;
        background: #f9f9f9;
    }

    .time-btn.selected {
        background: #333;
        color: #fff;
        border-color: #333;
        font-weight: 600;
    }

    .time-btn:active {
        transform: scale(0.98);
    }

    .time-placeholder {
        height: 100px;
        grid-column: 1;
    }

    .clock-icon {
        width: 32px;
        height: 32px;
        margin-bottom: 8px;
        opacity: 0.4;
    }

    .placeholder-text {
        font-size: 11px;
        max-width: 140px;
        color: #999;
        line-height: 1.3;
    }

    /* Form elements for mobile */
    #memberSelect {
        padding: 10px 12px;
        font-size: 16px;
        border-radius: 6px;
        min-height: 44px;
        border: 1px solid #ddd;
        background: #fff;
        width: 100%;
        box-sizing: border-box;
    }

    .field-label {
        font-size: 13px;
        margin-bottom: 5px;
        color: #333;
        font-weight: 600;
    }

    /* Time header for mobile */
    .time-header {
        font-size: 14px;
        margin-bottom: 8px;
        color: #333;
        font-weight: 600;
    }

    /* Loading skeletons for mobile */
    .day.loading-skeleton {
        height: 32px;
        font-size: 12px;
    }

    .time-btn.loading-skeleton {
        padding: 12px 16px;
        min-height: 44px;
    }
}

