:root {
    --brand-green: #186a3b;      /* Dark green */
    --brand-orange: #e67e22;     /* Orange */
    --brand-dark: #1a5276;       /* Dark blue */
    --brand-light: #f8f9fa;      /* Light background */
    --text-dark: #333;           /* Dark text */
    --text-light: #fff;          /* Light text */
}

/* Header space */
.header-space {
    height: 80px; /* Adjust based on your actual header height */
}

/* Main container */
.quran-class-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Hero section */
.hero-section-class {
    background: linear-gradient(135deg, var(--brand-green), var(--brand-dark));
    color: var(--text-light);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    will-change: transform; /* Performance optimization */
}

.hero-section-class h1 {
    font-weight: 700;
    margin-bottom: 0.75rem;
    font-size: 1.5rem;
}

.hero-section-class .lead {
    opacity: 0.9;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

/* Legend */
.legend {
    margin: 1rem 0;
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.available-dot, .booked-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 5px;
}

.available-dot {
    background-color: var(--brand-orange);
}

.booked-dot {
    background-color: #dc3545;
}

/* Form select */
.form-select {
    max-width: 100%;
    margin: 0.75rem auto;
    padding: 0.5rem 1rem;
    border: 2px solid rgba(255,255,255,0.3);
    background-color: rgba(255,255,255,0.1);
    color: var(--text-light);
    border-radius: 4px;
}

.form-select:focus {
    border-color: var(--text-light);
    box-shadow: 0 0 0 0.25rem rgba(255,255,255,0.25);
}

/* Teacher sections */
.teacher-section {
    display: none;
    margin-bottom: 2rem;
    background-color: white;
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    contain: content; /* Performance optimization */
}

.teacher-section.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

.teacher-section h2 {
    color: var(--brand-dark);
    font-size: 1.25rem;
    border-bottom: 2px solid #eee;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    border-radius: 6px;
    border: 1px solid #eee;
}

.schedule-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.schedule-table th {
    background-color: var(--brand-light);
    font-weight: 600;
    padding: 0.75rem;
    text-align: center;
    color: var(--brand-dark);
    border-bottom: 2px solid #ddd;
}

.schedule-table td {
    padding: 0.75rem;
    border: 1px solid #eee;
    vertical-align: middle;
}

/* Time slots */
.time-slot {
    font-weight: 500;
    min-width: 150px;
}

.pkt-time {
    font-weight: 600;
    color: var(--brand-dark);
    font-size: 0.95rem;
}

.time-display {
    display: block;
    font-size: 0.8rem;
    color: #666;
    margin-top: 4px;
    line-height: 1.4;
}

.timezone-info {
    font-size: 0.75rem;
    color: #777;
    background: #f5f5f5;
    padding: 2px 5px;
    border-radius: 3px;
    display: inline-block;
    margin-top: 3px;
}

/* Status cells */
.booked {
    background-color: #fff9f9;
}

.available {
    background-color: #f8fff8;
}

.status {
    margin-bottom: 6px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.status i {
    font-size: 0.95rem;
}

/* Buttons */
.btn {
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-weight: 500;
    font-size: 0.85rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: none;
    transform: translateZ(0); /* Performance optimization */
}

.btn-primary {
    background-color: var(--brand-orange);
    color: white;
}

.btn-primary:hover {
    background-color: #d35400;
    transform: translateY(-2px);
}

.btn-success {
    background-color: var(--brand-green);
    color: white;
}

.btn-success:hover {
    background-color: #145a32;
    transform: translateY(-2px);
}

/* Loading animation for time conversion */
.time-slot:not(.converted) .time-display {
    display: inline-block;
    width: 120px;
    height: 16px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 3px;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .hero-section-class {
        padding: 1.25rem;
    }
    
    .teacher-section {
        padding: 1rem;
    }
    
    .schedule-table th, 
    .schedule-table td {
        padding: 0.6rem;
    }
}

@media (max-width: 768px) {
    .header-space {
        height: 70px;
    }
    
    .hero-section-class h1 {
        font-size: 1.3rem;
    }
    
    .teacher-section h2 {
        font-size: 1.15rem;
    }
    
    .status {
        font-size: 0.85rem;
    }
    
    .btn {
        padding: 0.35rem 0.7rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {
    .header-space {
        height: 60px;
    }
    
    .quran-class-page {
        padding: 0 10px;
    }
    
    .hero-section-class {
        padding: 1rem;
        border-radius: 6px;
    }
    
    .hero-section-class h1 {
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
    }
    
    .legend {
        gap: 0.75rem;
        font-size: 0.9rem;
    }
    
    .teacher-section {
        padding: 0.75rem;
        margin-bottom: 1.5rem;
    }
    
    .teacher-section h2 {
        font-size: 1.1rem;
    }
    
    /* Stacked table layout for small screens */
    .schedule-table {
        display: block;
        min-width: auto;
    }
    
    .schedule-table thead {
        display: none;
    }
    
    .schedule-table tbody,
    .schedule-table tr,
    .schedule-table td {
        display: block;
        width: 100%;
    }
    
    .schedule-table tr {
        margin-bottom: 1rem;
        border: 1px solid #ddd;
        border-radius: 6px;
        overflow: hidden;
    }
    
    .schedule-table td {
        border: none;
        border-bottom: 1px solid #eee;
        padding: 0.75rem;
    }
    
    .schedule-table td:last-child {
        border-bottom: none;
    }
    
    .time-slot {
        background-color: var(--brand-light);
        font-weight: 600;
        border-bottom: 2px solid #ddd !important;
    }
    
    .status {
        justify-content: flex-start;
    }
    
    .btn {
        width: 100%;
        padding: 0.5rem;
    }
    
    /* Enhanced mobile table layout */
    .schedule-table {
        display: block;
        min-width: auto;
    }
    
    .schedule-table thead {
        display: none;
    }
    
    .schedule-table tbody,
    .schedule-table tr {
        display: block;
        width: 100%;
    }
    
    .schedule-table td {
        display: flex;
        flex-direction: column;
        border: none;
        border-bottom: 1px solid #eee;
        padding: 0.75rem;
        position: relative;
    }
    
    /* Add day type label before each time slot */
    .schedule-table td:not(.time-slot)::before {
        content: attr(data-day-type);
        display: block;
        font-weight: 600;
        color: var(--brand-dark);
        margin-bottom: 0.5rem;
        font-size: 0.9rem;
        background-color: #f5f5f5;
        padding: 0.25rem 0.5rem;
        border-radius: 4px;
        width: fit-content;
    }
    
    .schedule-table td.time-slot {
        background-color: var(--brand-light);
        font-weight: 600;
        border-bottom: 2px solid #ddd !important;
        padding-top: 1rem;
    }
    
    .schedule-table td:last-child {
        border-bottom: none;
    }
    
    .status {
        justify-content: flex-start;
        margin-bottom: 0.5rem;
    }
    
    .btn {
        width: 100%;
        padding: 0.5rem;
        margin-top: 0.5rem;
    }
}

/* Print styles */
@media print {
    .hero-section-class, .form-select, .btn {
        display: none;
    }
    
    .teacher-section {
        display: block !important;
        break-inside: avoid;
    }
    
    .schedule-table {
        break-inside: avoid;
    }
}