/* Filter container styles */
.classes-filter-container {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.classes-filter-container select {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.4;
    min-width: 150px;
}

/* Default styles for the card layout */
.classes-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.class-card {
    border: 1px solid #ccc;
    padding: 17px;
    flex: 1 1 calc(33.333% - 20px);
    box-sizing: border-box;
    border-radius: 8px;
    background: #fafafa;
    transition: box-shadow 0.3s ease;
}

.class-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.class-card h3 {
    margin-top: 0;
    color: #1e293b;
    font-size: 18px;
}

.class-card p {
    margin: 8px 0;
    line-height: 1.5;
}

.class-card strong {
    color: #333;
}

.classes-table {
    display: none;
    width: 100%;
    border-collapse: collapse;
}

/* Table styles for desktop */
@media (min-width: 1024px) {
    .classes-container {
        display: none;
    }

    .classes-table {
        display: table !important;
    }

    .classes-table th, .classes-table td {
        border: 1px solid #ccc;
        padding: 10px;
        text-align: left;
    }

    .class-card {
        display: none;
    }
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    .classes-filter-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .classes-filter-container select {
        margin-bottom: 10px;
        min-width: auto;
    }
    
    .class-card {
        flex: 1 1 100%;
        margin-bottom: 15px;
        display: flex;
        flex-direction: column;
        min-height: 240px;
    }
    
    .class-card .class-content {
        flex: 1;
        display: flex;
        flex-direction: column;
    }
    
    .class-card .class-excerpt {
        flex: 1;
    }
    
    .class-card .class-buttons {
        margin-top: auto;
    }
}

@media (max-width: 600px) {
    .class-card {
        padding: 13px;
        min-height: 220px;
    }
    
    .class-card h3 {
        font-size: 16px;
        margin-bottom: 7px;
    }
    
    .class-card p {
        margin: 5px 0;
        font-size: 14px;
    }
}

/* Classes by Program Age Shortcode Styles */
.classes-by-program-age-container {
    font-family: 'Inter', sans-serif;
}

/* Age Group Buttons (Level 1) */
.age-group-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    padding: 20px 0;
    border-bottom: 2px solid #f0f0f0;
    /* background-color: #fff; */
    transition: all 0.3s ease;
    z-index: 1000;
}

.age-group-buttons.sticky {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 15px 20px;
    margin-bottom: 0;
    width: auto;
    max-width: 90%;
}

.age-group-button {
    padding: 12px 24px;
    background-color: #f8f9fa;
    border: 2px solid #e5e5e5;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    color: #333;
    transition: all 0.3s ease;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.age-group-button:hover {
    background-color: #ff8800;
    border-color: #ffd1a680;
    color: white;
    transform: translateY(-2px);
}

.age-group-button.active {
    background-color: #ff8800;
    border-color: #ff8800;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 136, 0, 0.3);
}

/* Age Group Content */
.age-group-content {
    display: none;
}

.age-group-content.active {
    display: block;
    animation: fadeInUp 0.5s ease;
}

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

/* Program Tabs Wrapper (Level 2) */
.program-tabs-wrapper {
    margin-bottom: 40px;
}

/* Program Tabs (Level 2) */
.program-tabs {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 25px;
    border-bottom: 2px solid #e5e5e5;
    gap: 6px;
}

.program-tab {
    padding: 10px 20px;
    cursor: pointer;
    background-color: transparent;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    transition: all 0.3s ease;
    font-weight: 600;
    color: #666;
    position: relative;
}

.program-tab:hover {
    background-color: #ffd1a680;
    color: #ff8800;
}

.program-tab.active {
    background-color: #ffffff;
    border: 1px solid #e5e5e5;
    border-bottom: 3px solid #ff8800;
    color: #ff8800;
    font-weight: 600;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
}

/* Program Content */
.program-content {
    display: none;
}

.program-content.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

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

/* Classes Grid */
.classes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 400px));
    gap: 25px;
    margin-bottom: 30px;
    justify-content: start;
    /* min-height: 600px; Prevent jumping by maintaining minimum height */
}

/* Enhanced Class Cards for new structure */
.classes-by-program-age-container .class-card {
    border: none;
    border-radius: 12px;
    padding: 0;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 400px; /* Fixed height for consistency */
}

.classes-by-program-age-container .class-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.class-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.class-icon img {
    width: 24px;
    aspect-ratio: 1 / 1;
}

.class-content {
    padding: 21px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.class-title {
    margin: 0 0 13px 0;
    font-size: 20px;
    font-weight: 700;
    color: #003366;
    line-height: 1.3;
    /* padding-right: 50px; Space for icon */
}

.class-programs,
.class-age-groups,
.class-days,
.class-locations {
    margin: 7px 0;
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

.class-programs strong,
.class-age-groups strong,
.class-days strong,
.class-locations strong {
    color: #ff8800;
    font-weight: 600;
}

.class-excerpt {
    margin: 15px 0;
    font-size: 15px;
    color: #444;
    line-height: 1.6;
    flex: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Limit to 3 lines */
    -webkit-box-orient: vertical;
}

.class-read-more {
    background: linear-gradient(135deg, #ff8800 0%, #e67600 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 15px;
}

.class-read-more:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 136, 0, 0.3);
    background: #4a7ba7;
}

/* Register Button */
.class-register-btn {
    background: linear-gradient(135deg, #ff8800 0%, #e67600 100%);
    color: white;
    border: 2px solid transparent;
}

.class-register-btn:hover {
    background: #4a7ba7;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 136, 0, 0.3);
}

/* Disabled register button */
.class-register-btn.disabled {
    background: #6c757d;
    color: white;
    cursor: not-allowed;
    opacity: 0.6;
    pointer-events: none;          /* prevent mouse interaction */
}

.class-register-btn.disabled:hover {
    background: #6c757d;
    transform: none;
    box-shadow: none;
}

/* make the native attribute work too */
.class-register-btn[disabled] {
    background: #6c757d;
    color: white;
    cursor: not-allowed;
    opacity: 0.6;
    pointer-events: none;
}
/* Class Modal Styles */
.class-modal {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0 !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    background-color: rgba(0, 0, 0, 0.6);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
    overflow: hidden;
}

.class-modal-content {
    background: white;
    padding: 0;
    border-radius: 15px;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    margin: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideInModal 0.3s ease;
}

.class-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    z-index: 10001;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
}

.class-modal-close:hover {
    background-color: #ffd1a680;
    color: #333;
}

.modal-class-title {
    font-size: 24px;
    font-weight: 700;
    color: #003366;
    margin: 0 0 20px 0;
    padding: 30px 30px 0 30px;
    padding-right: 60px; /* Space for close button */
}

.modal-class-icon {
    text-align: center;
    margin-bottom: 20px;
    padding: 0 30px;
}

.modal-class-icon img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.modal-class-meta {
    padding: 0 30px 20px 30px;
    border-bottom: 1px solid #eee;
}

.modal-class-meta p {
    margin: 8px 0;
    font-size: 15px;
    color: #666;
}

.modal-class-meta strong {
    color: #ff8800;
    font-weight: 600;
}

.modal-class-content {
    padding: 20px 30px 30px 30px;
    font-size: 16px;
    line-height: 1.7;
    color: #333;
}

.modal-class-content h1,
.modal-class-content h2,
.modal-class-content h3,
.modal-class-content h4,
.modal-class-content h5,
.modal-class-content h6 {
    color: #003366;
    margin-top: 25px;
    margin-bottom: 15px;
}

.modal-class-content p {
    margin-bottom: 15px;
}

.modal-class-content ul,
.modal-class-content ol {
    margin-bottom: 15px;
    padding-left: 25px;
}

.class-modal-error {
    text-align: center;
    padding: 40px;
    font-size: 16px;
    color: #dc3545;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    margin: 20px;
}

@keyframes slideInModal {
    from { 
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .age-group-buttons {
        justify-content: center;
        text-align: center;
    }
    
    .age-group-button {
        font-size: 12px;
        padding: 10px 18px;
    }
    
    .program-tabs {
        justify-content: center;
    }
    
    .program-tab {
        font-size: 14px;
        padding: 8px 16px;
    }
    
    .classes-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        min-height: 500px; /* Reduced minimum height for tablets */
    }
    
    /* Mobile-optimized class cards */
    .classes-by-program-age-container .class-card {
        height: 350px; /* Fixed height for consistency on tablets */
        margin-bottom: 20px;
    }
    
    .class-content {
        padding: 17px;
    }
    
    .class-title {
        font-size: 18px;
        margin-bottom: 10px;
        line-height: 1.3;
    }
    
    .class-programs,
    .class-age-groups,
    .class-days,
    .class-locations {
        margin: 5px 0;
        font-size: 13px;
    }
    
    .class-excerpt {
        font-size: 14px;
        margin: 12px 0;
        line-height: 1.5;
    }
    
    .class-buttons {
        gap: 8px;
        padding-top: 12px;
    }
    
    .class-btn {
        padding: 14px 12px;
        font-size: 13px;
        min-width: 100px;
        min-height: 44px; /* Better touch target */
    }
    
    .class-read-more {
        padding: 12px 16px;
        font-size: 13px;
        margin-top: 12px;
    }
    
    .class-icon {
        top: 12px;
        right: 12px;
        width: 35px;
        height: 35px;
    }
    
    .class-icon img {
        width: 24px;
        aspect-ratio: 1 / 1;
    }
    
    .class-modal-content {
        margin: 10px;
        max-height: 95vh;
    }
    
    .modal-class-title {
        font-size: 20px;
        padding: 20px 20px 0 20px;
        padding-right: 50px;
    }
    
    .modal-class-icon,
    .modal-class-meta,
    .modal-class-content {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .class-modal-close {
        top: 10px;
        right: 15px;
        font-size: 24px;
        width: 32px;
        height: 32px;
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .classes-grid {
        gap: 15px;
        min-height: 400px; /* Reduced minimum height for mobile */
    }
    
    .classes-by-program-age-container .class-card {
        height: 320px; /* Fixed height for consistency on mobile */
        border-radius: 8px;
    }
    
    .class-content {
        padding: 14px;
    }
    
    .class-title {
        font-size: 16px;
        margin-bottom: 9px;
    }
    
    .class-programs,
    .class-age-groups,
    .class-days,
    .class-locations {
        font-size: 12px;
        margin: 3px 0;
    }
    
    .class-excerpt {
        font-size: 13px;
        margin: 10px 0;
    }
    
    .class-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .class-btn {
        width: 100%;
        min-width: auto;
        padding: 16px 12px;
        font-size: 14px;
    }
    
    .class-read-more {
        padding: 14px 16px;
        margin-top: 10px;
    }
    
    .class-icon {
        display: none; /* Hide icon on very small screens to save space */
    }
}

/* Pagination Styles */
.classes-pagination {
    margin-top: 30px;
    text-align: center;
}

.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.pagination-btn {
    padding: 8px 16px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    transition: all 0.3s ease;
    min-width: 40px;
    text-align: center;
}

.pagination-btn:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
    color: #212529;
}

.pagination-btn.pagination-active {
    background-color: #ff8800;
    border-color: #ff8800;
    color: white;
    font-weight: 600;
}

.pagination-btn.pagination-active:hover {
    background-color: #e67600;
    border-color: #e67600;
}

.pagination-btn:disabled {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    color: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.pagination-pages {
    display: flex;
    gap: 4px;
    align-items: center;
}

.pagination-info {
    font-size: 14px;
    color: #6c757d;
    margin-top: 10px;
}

/* Mobile pagination adjustments */
@media (max-width: 768px) {
    .pagination-controls {
        gap: 6px;
    }
    
    .pagination-btn {
        padding: 6px 12px;
        font-size: 13px;
        min-width: 35px;
    }
    
    .pagination-pages {
        gap: 3px;
    }
    
    .pagination-info {
        font-size: 13px;
    }
}

/* Pagination hidden state */
.pagination-hidden {
    display: none !important;
}


