/* =================================================================
   GLASSMORPHIC MODALS - MODERN DESIGN
   Styles for Create Room, Schedule Session, and other modals
   ================================================================= */

/* Enhanced Modal Overlay */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Glassmorphic Modal Content */
.modal-content {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 
        0 20px 60px rgba(15, 86, 255, 0.15),
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(15, 86, 255, 0.05) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* Modal Header */
.modal-header {
    padding: 24px 30px 20px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.modal-header h2 {
    margin: 0;
    color: #1e293b;
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #1e293b 0%, #0f56ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.close {
    color: #64748b;
    font-size: 32px;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(148, 163, 184, 0.1);
}

.close:hover {
    color: #1e293b;
    background: rgba(148, 163, 184, 0.2);
    transform: rotate(90deg);
}

/* Modal Body - Scrollable */
.modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    position: relative;
    z-index: 1;
}

.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: rgba(148, 163, 184, 0.1);
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: rgba(15, 86, 255, 0.3);
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(15, 86, 255, 0.5);
}

/* Form Groups */
.form-group {
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    color: #1e293b;
    font-weight: 600;
    font-size: 0.95rem;
}

/* Form Inputs - Glassmorphic */
.form-group input[type="text"],
.form-group input[type="datetime-local"],
.form-group input[type="date"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 14px 18px;
    border: 1.5px solid rgba(148, 163, 184, 0.3);
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    color: #1e293b;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #0f56ff;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 
        0 0 0 4px rgba(15, 86, 255, 0.1),
        0 4px 12px rgba(15, 86, 255, 0.15);
    transform: translateY(-1px);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #94a3b8;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
    line-height: 1.5;
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231e293b' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 18px center;
    padding-right: 40px;
}

/* Checkbox Styling */
.form-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #0f56ff;
    border-radius: 6px;
    border: 2px solid rgba(148, 163, 184, 0.4);
    transition: all 0.3s ease;
}

.form-group input[type="checkbox"]:checked {
    background-color: #0f56ff;
    border-color: #0f56ff;
}

/* Recurring Options - Glassmorphic Container */
#recurringOptions {
    background: rgba(15, 86, 255, 0.06);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 20px;
    margin: 20px 0;
    border: 1px solid rgba(15, 86, 255, 0.15);
    position: relative;
    overflow: hidden;
}

#recurringOptions::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #0f56ff, #1f3c88);
    border-radius: 16px 16px 0 0;
}

/* Recurrence Days - Improved Mobile Layout */
#recurrenceDaysSection {
    margin-top: 16px;
}

#recurrenceDaysSection > label {
    margin-bottom: 12px;
    display: block;
    font-weight: 600;
    color: #1e293b;
}

.recurrence-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    margin-top: 12px;
    margin-bottom: 8px;
}

.recurrence-day-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 6px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(5px);
    border: 1.5px solid rgba(148, 163, 184, 0.2);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.recurrence-day-item:hover {
    background: rgba(15, 86, 255, 0.1);
    border-color: rgba(15, 86, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(15, 86, 255, 0.15);
}

.recurrence-day-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin: 0;
    cursor: pointer;
}

.recurrence-day-item input[type="checkbox"]:checked {
    accent-color: #0f56ff;
}

.recurrence-day-item input[type="checkbox"]:checked + .recurrence-day-label,
.recurrence-day-item.checked .recurrence-day-label {
    color: #0f56ff;
    font-weight: 700;
}

.recurrence-day-item input[type="checkbox"]:checked ~ .recurrence-day-label {
    color: #0f56ff;
    font-weight: 700;
}

.recurrence-day-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #1e293b;
    text-align: center;
    white-space: nowrap;
    min-width: 28px;
    pointer-events: none;
    user-select: none;
}

/* Checked state styling - using class instead of :has() for better browser support */
.recurrence-day-item.checked,
.recurrence-day-item:has(input:checked) {
    background: rgba(15, 86, 255, 0.15);
    border-color: #0f56ff;
    box-shadow: 0 0 0 3px rgba(15, 86, 255, 0.1);
}

.recurrence-day-item.checked .recurrence-day-label,
.recurrence-day-item:has(input:checked) .recurrence-day-label {
    color: #0f56ff;
    font-weight: 700;
}

/* Help Text */
.form-group small {
    display: block;
    margin-top: 8px;
    color: #64748b;
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Buttons */
.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    font-family: inherit;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

.btn.primary {
    background: linear-gradient(135deg, #0f56ff 0%, #1f3c88 100%);
    color: white;
    box-shadow: 
        0 4px 16px rgba(15, 86, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 6px 24px rgba(15, 86, 255, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn.primary:active {
    transform: translateY(0);
}

/* Button Container at Bottom */
.modal-body form > div:last-of-type {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    flex-shrink: 0;
}

.modal-body form > div:last-of-type .btn {
    width: 100%;
}

/* Checkbox Label Styling */
.form-group label[style*="display: flex"] {
    padding: 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(148, 163, 184, 0.2);
    transition: all 0.3s ease;
    margin-bottom: 0;
}

.form-group label[style*="display: flex"]:hover {
    background: rgba(15, 86, 255, 0.05);
    border-color: rgba(15, 86, 255, 0.2);
}

.form-group label[style*="display: flex"] span {
    color: #1e293b;
    font-weight: 500;
    user-select: none;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .modal {
        padding: 10px;
    }
    
    .modal-content {
        max-width: 100%;
        border-radius: 20px 20px 0 0;
        max-height: 95vh;
        margin-top: auto;
    }
    
    .modal-header {
        padding: 20px 20px 16px;
    }
    
    .modal-header h2 {
        font-size: 1.3rem;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 12px 16px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    /* Mobile: Stack days vertically or use 2 columns */
    .recurrence-days-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .recurrence-day-item {
        padding: 12px 8px;
    }
    
    .recurrence-day-label {
        font-size: 0.7rem;
    }
    
    #recurringOptions {
        margin-left: 0;
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .recurrence-days-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
}

/* Desktop: 7 columns for days */
@media (min-width: 769px) {
    .recurrence-days-grid {
        grid-template-columns: repeat(7, 1fr);
    }
}

