/* ============= CSS VARIABLES - RED & WHITE THEME ============= */
:root {
    --primary-red: #EC1B24;
    --primary-red-dark: #c4161e;
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #fef2f2;
    --accent-gradient: linear-gradient(135deg, #EC1B24, #c4161e);
    --text-primary: #1a1a1a;
    --text-secondary: #4a4a4a;
    --text-muted: #8a8a8a;
    --border-color: #e5e5e5;
    --success: #16a34a;
    --error: #dc2626;
    --warning: #d97706;
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 24px rgba(236, 27, 36, 0.15);
    --shadow-modal: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 24px;
}

/* ============= HEADER ============= */
.header {
    text-align: center;
    margin-bottom: 48px;
}

.logo {
    max-width: 280px;
    margin: 0 auto 20px;
}

.logo img {
    width: 100%;
    height: auto;
}

.header .subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 8px;
}

/* ============= LOADING ============= */
.loading {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-red);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ============= ERROR STATE ============= */
.error-state {
    text-align: center;
    padding: 60px 20px;
}

.error-icon { font-size: 4rem; margin-bottom: 16px; }

.retry-btn {
    margin-top: 20px;
    padding: 12px 24px;
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.retry-btn:hover { transform: translateY(-2px); }

/* ============= ENROLLMENTS LIST ============= */
.enrollments-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.enrollment-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-card);
}

.enrollment-card:hover {
    border-color: var(--primary-red);
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.enrollment-card.unavailable {
    opacity: 0.6;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 12px;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

.availability-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.availability-badge.available {
    background: #dcfce7;
    color: var(--success);
}

.availability-badge.full {
    background: #fee2e2;
    color: var(--error);
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-description {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
    max-height: 48px;
    overflow: hidden;
}

/* ============= MODAL ============= */
.modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    max-width: 720px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 32px;
    position: relative;
    box-shadow: var(--shadow-modal);
    
    /* Nice scrollbar */
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

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

.modal-content::-webkit-scrollbar-track {
    background: transparent;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.modal-close {
    position: absolute;
    top: 16px; right: 16px;
    background: #f5f5f5;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover { 
    background: #e5e5e5;
    color: var(--text-primary); 
}

/* ============= DETAIL VIEW ============= */
.detail-header {
    margin-bottom: 28px;
    padding-right: 40px;
}

.detail-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    margin-top: 8px;
}

.detail-section {
    margin-bottom: 28px;
}

.detail-section h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--primary-red);
    margin-bottom: 12px;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.detail-item {
    background: var(--bg-primary);
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.detail-item .label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.detail-item .value {
    font-weight: 600;
    color: var(--text-primary);
}

.instructor-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-primary);
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.instructor-avatar {
    width: 48px;
    height: 48px;
    background: var(--accent-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.2rem;
    color: white;
}

.instructor-name {
    font-weight: 600;
    color: var(--text-primary);
}

.instructor-email {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.price-tag {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--success);
    margin-bottom: 20px;
}

.price-loading {
    color: var(--text-muted);
    font-style: italic;
    font-size: 1rem;
}

.book-btn {
    width: 100%;
    padding: 16px 24px;
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.book-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(236, 27, 36, 0.3);
}

.book-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ============= BOOKING FORM ============= */
.booking-modal h2 {
    margin-bottom: 20px;
    color: var(--text-primary);
    font-size: 1.5rem;
}

#bookingSummary {
    background: var(--bg-primary);
    padding: 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.form-note {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: #92400e;
}

.form-note strong { color: var(--warning); }

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-red);
}

.submit-btn {
    width: 100%;
    padding: 16px 24px;
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
}

.submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

#bookingMessage {
    margin-top: 16px;
}

.message {
    padding: 16px;
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.message.success {
    background: #dcfce7;
    border: 1px solid #86efac;
    color: var(--success);
}

.message.error {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: var(--error);
}

/* ============= FOOTER ============= */
.footer {
    text-align: center;
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
}

.footer a {
    color: var(--primary-red);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

.footer .contact-info {
    margin-top: 8px;
}

/* ============= RESPONSIVE ============= */
@media (max-width: 600px) {
    .container { padding: 20px 16px; }
    .logo { max-width: 200px; }
    .detail-grid { grid-template-columns: 1fr; }
    .enrollments-list { grid-template-columns: 1fr; }
    .modal-content { padding: 24px; max-width: 95%; }
}

/* ============= CUSTOM GREETING ============= */
.greeting-container {
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--radius-lg);
    margin-bottom: 32px;
    box-shadow: var(--shadow-card);
    border-left: 4px solid var(--primary-red);
    animation: fadeIn 0.5s ease-out;
}

.greeting-container p {
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.greeting-container p:last-child {
    margin-bottom: 0;
}

.greeting-container strong {
    color: var(--text-primary);
}

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

/* ============= PRICE WARNING ============= */
.price-warning {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-top: 16px;
    font-size: 0.9rem;
    color: #92400e;
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.price-warning::before {
    content: "⚠️";
    font-size: 1.1em;
}

.price-warning strong {
    color: #b45309;
}

/* ============= SIGNATURE ============= */
.signature {
    font-style: italic;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 12px !important;
}

/* ============= PHONE DISPLAY (readonly) ============= */
.phone-display-group {
    margin-bottom: 20px;
}

.phone-display {
    padding: 14px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
}

/* ============= ENROLLING FOR ============= */
.enrolling-for {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

/* ============= FALLBACK CONTAINER ============= */
.fallback-container {
    background: var(--bg-card);
    padding: 32px;
    border-radius: var(--radius-lg);
    margin-bottom: 32px;
    box-shadow: var(--shadow-card);
    text-align: center;
    animation: fadeIn 0.5s ease-out;
}

.fallback-message {
    max-width: 500px;
    margin: 0 auto;
}

.fallback-greeting {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.fallback-error {
    color: var(--text-secondary);
    margin-bottom: 20px;
    padding: 12px 16px;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
}

.fallback-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 16px 32px;
    background: var(--accent-gradient);
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    border-radius: var(--radius-sm);
    margin: 20px 0;
    transition: all 0.2s;
}

.fallback-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(236, 27, 36, 0.3);
}

.fallback-help {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 20px;
}

