/* Class Feed Styling */
.classes-feed-container {
    margin: 20px 0;
}

/* Filter Interface Styling */
.class-filters-container {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
}

/* Override theme line-height conflicts */
.class-filters-container * {
    line-height: inherit;
}

.class-filters-container select,
.class-filters-container option {
    line-height: 1.5 !important;
}

.filter-row {
    display: flex;
    gap: 20px;
    align-items: end;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 200px;
    flex: 1;
}

.filter-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #495057;
    font-size: 14px;
    line-height: 1.3;
}

.class-filter {
    padding: 10px 15px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 16px;
    line-height: 1.5;
    height: auto;
    min-height: 44px;
    background: white;
    transition: all 0.3s ease;
    outline: none;
    box-sizing: border-box;
}

.class-filter:focus {
    border-color: var(--primary-color, #B8860B);
    box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.1);
}

.class-filter:hover {
    border-color: #adb5bd;
}

.no-classes-message {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-size: 18px;
    font-style: italic;
}

/* Loading State Styling */
.loading-state {
    text-align: center;
    padding: 60px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e9ecef;
    border-top: 4px solid var(--primary-color, #B8860B);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    color: #6c757d;
    font-size: 16px;
    margin: 0;
    font-weight: 600;
}

/* Error State Styling */
.error-state {
    text-align: center;
    padding: 40px 20px;
}

.error-message {
    color: #dc3545;
    font-size: 16px;
    margin: 0;
    padding: 15px 20px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    display: inline-block;
}

/* Disabled Filter Styling */
.class-filter:disabled {
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
    opacity: 0.7;
}

.class-filter option {
    padding: 8px 12px;
    line-height: 1.5;
    font-size: 16px;
}

.classes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin: 0;
    padding: 0;
    /* min-height: 600px; Prevent jumping by maintaining minimum height */
}

.class-feed-item {
    display: flex;
    flex-direction: column;
}

.class-card {
    background: #fafafa;
    border-radius: 15px;
    padding: 21px;
    border: 1px solid #e8e8e8;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 400px; /* Fixed height for consistency */
    position: relative;
}

.class-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    flex-grow: 1;
}

.class-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.class-title {
    margin: 0 0 15px 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.3;
    text-align: center;
}

.class-program-icon {
    text-align: center;
    margin: 15px 0 20px 0;
}

.program-icon {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.program-icon:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

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

.class-excerpt {
    flex-grow: 1;
    margin-top: 15px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Limit to 3 lines */
    -webkit-box-orient: vertical;
}

.class-excerpt p {
    margin: 0 0 15px 0;
    font-size: 16px;
    line-height: 1.5;
    color: #555;
}

/* Shared button styles */
.class-btn {
    flex: 1;
    box-sizing: border-box;
    margin: 0;
    text-align: center;
}

/* Updated .class-read-more styles */
.class-read-more {
    background: #ffffff;
    color: #ff8800;
    border: 1px solid #ff8800;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    display: inline-block;
}

/* Updated .class-register-btn styles */
.class-register-btn {
    background: #ff8800;
    color: white;
    border: 1px solid #ff8800;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

.class-read-more:hover {
    background: #ffffff;
    color: #4a7ba7;
    border-color: #4a7ba7;
    transform: translateY(-1px);
}

/* Button Container - Sticks to bottom */
.class-buttons {
    margin-top: auto;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: stretch; /* Ensures buttons have same height */
    padding-top: 15px;
}

/* When only one button is present, don't let it stretch too wide */
.class-buttons:has(> :only-child) {
    justify-content: center;
}

.class-buttons > :only-child {
    max-width: 200px;
    flex: 0 1 auto;
}

/* Register Here Button */
.class-register-btn {
    background: #ff8800;
    color: white;
    border: 1px solid #ff8800;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex: 1;
    display: inline-block;
    box-sizing: border-box;
    margin: 0;
    text-align: center;
}

.class-register-btn:hover {
    background: #4a7ba7;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(74, 123, 167, 0.3);
}

.class-register-btn.disabled,
.class-register-btn:disabled {
    background: #e9ecef;
    color: #6c757d;
    border-color: #dee2e6;
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
    box-shadow: none;
}

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

/* Registration Modal */
.registration-modal {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.registration-modal-content {
    background: white;
    border-radius: 10px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideInModal 0.3s ease;
}

.registration-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;
}

.registration-modal-close:hover {
    background-color: #ff4444;
    color: white;
}

.registration-modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid #eee;
    background-color: #f8f9fa;
}

.registration-modal-header h2 {
    margin: 0;
    color: #333;
    font-size: 24px;
    font-weight: 600;
}

.registration-iframe-container {
    width: 100%;
    height: 70vh;
    min-height: 500px;
}

#registration-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .registration-modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .registration-modal-header {
        padding: 15px 20px;
    }
    
    .registration-modal-header h2 {
        font-size: 20px;
    }
    
    .registration-iframe-container {
        height: 60vh;
        min-height: 400px;
    }
    
    .registration-modal-close {
        top: 10px;
        right: 15px;
        font-size: 24px;
        width: 32px;
        height: 32px;
    }
}

/* Pinned Class Styling */
.class-card.class-pinned {
    position: relative;
}

.class-card.class-pinned::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-left: 25px solid transparent;
    border-top: 25px solid #dc3545;
    z-index: 10;
}

.class-card.class-pinned::after {
    content: '📌';
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 12px;
    color: white;
    z-index: 11;
    transform: rotate(-45deg);
}

.pin-indicator {
    color: #dc3545;
    font-size: 14px;
    margin-left: 5px;
    font-weight: bold;
}

/* Modal Program Icon Styling */
.modal-program-icon {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: block;
    margin: 0 auto 20px auto;
}

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

/* Class Modal Styling */
.class-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.class-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.class-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 30px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
}

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

.modal-class-title h3 {
    margin: 0 0 20px 0;
    font-size: 28px;
    font-weight: 600;
    color: #333;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.3;
}

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

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

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

.modal-class-content {
    font-size: 18px;
    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: #333;
    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: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .filter-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .filter-group {
        min-width: auto;
        width: 100%;
    }
    
    .class-filters-container {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .classes-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        min-height: 500px; /* Reduced minimum height for tablets */
    }
    
    .class-card {
        padding: 17px;
    }
    
    .class-title {
        font-size: 18px;
    }
    
    .class-modal-content {
        padding: 25px 20px;
        margin: 10px;
        border-radius: 15px;
        max-height: 90vh;
    }
    
    .class-modal-close {
        top: 10px;
        right: 15px;
        font-size: 28px;
    }
    
    .modal-class-title h3 {
        font-size: 24px;
    }
    
    .modal-class-content {
        font-size: 16px;
        line-height: 1.6;
    }
}

@media (max-width: 576px) {
    .classes-grid {
        min-height: 400px; /* Reduced minimum height for mobile */
    }
    
    .class-card {
        padding: 13px;
    }
    
    .class-title {
        font-size: 16px;
    }
    
    .class-programs,
    .class-age-groups,
    .class-days,
    .class-locations {
        font-size: 13px;
    }
    
    .class-excerpt p {
        font-size: 15px;
    }
    
    .class-read-more {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .loading-state {
        padding: 40px 20px;
    }
    
    .loading-spinner {
        width: 35px;
        height: 35px;
    }
    
    .error-state {
        padding: 30px 15px;
    }
    
    .error-message {
        padding: 12px 15px;
        font-size: 15px;
    }
}


/* Animation Keyframes */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}