/* CSS Variables for consistent theming */
:root {
    --primary-red: #c41e3a;
    --primary-green: #165B33;
    --accent-gold: #d4af37;
    --warm-cream: #fdf8f0;
    --soft-white: #ffffff;
    --text-dark: #2d3436;
    --text-light: #636e72;
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.15);
    --gradient-festive: linear-gradient(135deg, #165B33 0%, #1a7a45 50%, #c41e3a 100%);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Open Sans', sans-serif;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #1a1a2e 100%);
    min-height: 100vh;
    color: var(--text-dark);
    overflow-x: hidden;
}

/* Snowflakes Animation */
.snowflakes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    overflow: hidden;
}

.snowflake {
    position: absolute;
    top: -10%;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.5rem;
    animation: fall linear infinite;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.snowflake:nth-child(1) { left: 5%; animation-duration: 10s; animation-delay: 0s; font-size: 1.2rem; }
.snowflake:nth-child(2) { left: 15%; animation-duration: 12s; animation-delay: 1s; font-size: 1.8rem; }
.snowflake:nth-child(3) { left: 25%; animation-duration: 8s; animation-delay: 2s; font-size: 1rem; }
.snowflake:nth-child(4) { left: 35%; animation-duration: 14s; animation-delay: 0.5s; font-size: 1.5rem; }
.snowflake:nth-child(5) { left: 50%; animation-duration: 11s; animation-delay: 3s; font-size: 2rem; }
.snowflake:nth-child(6) { left: 60%; animation-duration: 9s; animation-delay: 1.5s; font-size: 1.3rem; }
.snowflake:nth-child(7) { left: 70%; animation-duration: 13s; animation-delay: 2.5s; font-size: 1.7rem; }
.snowflake:nth-child(8) { left: 80%; animation-duration: 10s; animation-delay: 4s; font-size: 1.1rem; }
.snowflake:nth-child(9) { left: 88%; animation-duration: 15s; animation-delay: 0s; font-size: 1.4rem; }
.snowflake:nth-child(10) { left: 95%; animation-duration: 11s; animation-delay: 2s; font-size: 1.6rem; }

@keyframes fall {
    0% {
        transform: translateY(-10vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(110vh) rotate(360deg);
        opacity: 0.3;
    }
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

/* Header Styles */
.header {
    text-align: center;
    padding: 2rem 0 3rem;
}

.logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.logo {
    height: 60px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px var(--shadow-light));
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.microsoft-logo {
    height: 50px;
}

.charity-logo {
    height: 70px;
    border-radius: 8px;
    background: white;
    padding: 5px;
}

.logo-divider {
    font-size: 2rem;
    color: var(--accent-gold);
    font-weight: 300;
}

.title {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    font-weight: 700;
    color: var(--soft-white);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
}

.subtitle {
    font-size: 1.3rem;
    color: var(--accent-gold);
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Main Content */
.main-content {
    display: flex;
    justify-content: center;
    margin-bottom: 3rem;
}

.registration-section {
    width: 100%;
    max-width: 900px;
}

/* Event Info Card */
.info-card {
    background: var(--warm-cream);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 20px 60px var(--shadow-medium);
    position: relative;
    overflow: hidden;
}

.info-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--gradient-festive);
}

.info-card h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    color: var(--primary-green);
    margin-bottom: 1.5rem;
}

.info-card p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.event-details {
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(22, 91, 51, 0.1), rgba(196, 30, 58, 0.1));
    border-radius: 12px;
    border-left: 4px solid var(--primary-green);
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 0;
    font-size: 1.05rem;
    color: var(--text-dark);
}

.detail-item:not(:last-child) {
    border-bottom: 1px dashed rgba(0, 0, 0, 0.1);
}

.detail-icon {
    font-size: 1.5rem;
}

/* Registration Card */
.registration-card {
    background: var(--soft-white);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 20px 60px var(--shadow-medium);
    position: relative;
    overflow: hidden;
}

.registration-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--gradient-festive);
}

.registration-card h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    color: var(--primary-red);
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Intro text in merged section */
.intro-text {
    color: var(--text-dark);
    line-height: 1.7;
    margin-bottom: 1rem;
    text-align: center;
}

.intro-text:last-of-type {
    margin-bottom: 1.5rem;
}

/* Form Styles */
.registration-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1rem;
}

.form-group input[type="email"] {
    padding: 1rem 1.2rem;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1rem;
    font-family: 'Open Sans', sans-serif;
    transition: all 0.3s ease;
    background: #fafafa;
}

.form-group input[type="email"]:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 4px rgba(22, 91, 51, 0.1);
    background: var(--soft-white);
}

.form-group input[type="email"]:invalid:not(:placeholder-shown) {
    border-color: var(--primary-red);
}

.input-hint {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Date Selection */
.date-options {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.date-option {
    flex: 1;
    cursor: pointer;
}

.date-option input[type="radio"] {
    display: none;
}

.date-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.2rem 0.8rem;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: #fafafa;
    transition: all 0.3s ease;
}

.date-card-expanded {
    padding: 1.2rem 1rem;
    min-width: 160px;
}

.date-option input[type="radio"]:checked + .date-card {
    border-color: var(--primary-green);
    background: linear-gradient(135deg, rgba(22, 91, 51, 0.1), rgba(22, 91, 51, 0.05));
    box-shadow: 0 4px 15px rgba(22, 91, 51, 0.2);
    transform: translateY(-2px);
}

/* Date card info section */
.date-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px dashed rgba(212, 175, 55, 0.4);
    width: 100%;
}

.date-activity,
.date-time,
.date-location {
    font-size: 0.7rem;
    color: var(--text-dark);
    text-align: center;
}

.date-activity {
    font-weight: 600;
    color: var(--primary-green);
}

.date-location a {
    color: var(--text-dark);
    text-decoration: none;
    transition: color 0.2s ease;
}

.date-location a:hover {
    color: var(--primary-green);
    text-decoration: underline;
}

/* Per-day stats on date cards */
.date-stats-top,
.date-stats-bottom {
    font-size: 0.75rem;
    text-align: center;
    min-height: 1.2em;
    width: 100%;
}

.date-stats-top {
    margin-bottom: 0.3rem;
    color: var(--primary-green);
    font-weight: 600;
}

.date-stats-bottom {
    margin-top: 0.5rem;
    color: var(--primary-red);
    font-weight: 600;
}

.day-full {
    color: #999;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
}

/* Disabled date option */
.date-option.date-full {
    cursor: not-allowed;
}

.date-option.date-full .date-card {
    opacity: 0.5;
    background: #f0f0f0;
    border-color: #ccc;
}

.date-option.date-full:hover .date-card {
    transform: none;
    box-shadow: none;
}

.date-card:hover {
    border-color: var(--primary-green);
    transform: translateY(-2px);
}

.date-day {
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.date-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-red);
    line-height: 1.2;
}

.date-month {
    font-size: 0.85rem;
    color: var(--text-dark);
    font-weight: 500;
}

/* Submit Button */
.submit-btn {
    margin-top: 1rem;
    padding: 1.2rem 2rem;
    background: var(--gradient-festive);
    border: none;
    border-radius: 12px;
    color: var(--soft-white);
    font-size: 1.1rem;
    font-weight: 600;
    font-family: 'Open Sans', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(196, 30, 58, 0.3);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(196, 30, 58, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Success and Error Messages */
.success-message,
.error-message {
    text-align: center;
    padding: 2rem;
}

.success-message {
    color: var(--primary-green);
}

.error-message {
    color: var(--primary-red);
}

.success-icon,
.error-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.success-message h3,
.error-message h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.success-message p,
.error-message p {
    font-size: 1rem;
    color: var(--text-dark);
}

.success-details {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(22, 91, 51, 0.1);
    border-radius: 8px;
    font-weight: 500;
}

.retry-btn {
    margin-top: 1rem;
    padding: 0.8rem 1.5rem;
    background: var(--primary-red);
    border: none;
    border-radius: 8px;
    color: var(--soft-white);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.retry-btn:hover {
    background: #a01830;
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    color: var(--soft-white);
}

.footer p {
    margin-bottom: 0.5rem;
}

.charity-info a {
    color: var(--accent-gold);
    text-decoration: none;
    transition: color 0.3s ease;
}

.charity-info a:hover {
    color: var(--soft-white);
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 900px) {
    .registration-section {
        max-width: 100%;
    }

    .title {
        font-size: 2.2rem;
    }

    .subtitle {
        font-size: 1rem;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 1rem;
    }

    .title {
        font-size: 1.8rem;
    }

    .logos {
        gap: 1rem;
    }

    .logo {
        height: 40px;
    }

    .charity-logo {
        height: 50px;
    }

    .date-options {
        flex-direction: column;
    }

    .date-card {
        flex-direction: row;
        justify-content: center;
        gap: 1rem;
        padding: 1rem;
        flex-wrap: wrap;
    }

    .date-card-expanded {
        flex-direction: column;
        padding: 1rem;
    }

    .date-card-expanded .date-info {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }

    .date-number {
        font-size: 1.5rem;
    }

    .info-card,
    .registration-card {
        padding: 1.5rem;
    }

    .info-card h2,
    .registration-card h2 {
        font-size: 1.4rem;
    }
}

/* Charity Fact Section - "Did You Know?" */
.charity-fact-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(22, 91, 51, 0.1) 0%, rgba(196, 30, 58, 0.1) 100%);
    border-radius: 15px;
    border: 2px solid rgba(212, 175, 55, 0.3);
    text-align: left;
}

.fact-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.fact-icon {
    font-size: 1.5rem;
}

.fact-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-green);
}

.ai-badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    background: linear-gradient(135deg, var(--primary-green), var(--primary-red));
    color: white;
    border-radius: 20px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.fact-content {
    min-height: 60px;
    display: flex;
    align-items: center;
}

.fact-loading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-light);
    font-style: italic;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(22, 91, 51, 0.2);
    border-top: 2px solid var(--primary-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.fact-text {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-dark);
    font-style: italic;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    border-left: 4px solid var(--accent-gold);
}

@media (max-width: 600px) {
    .charity-fact-section {
        padding: 1rem;
    }

    .fact-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .ai-badge {
        margin-top: 0.5rem;
    }

    .fact-text {
        font-size: 0.9rem;
    }
}

/* Registration Stats Section */
.registration-stats {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(22, 91, 51, 0.15) 0%, rgba(212, 175, 55, 0.15) 100%);
    border-radius: 12px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    text-align: center;
}

.stats-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.stats-icon {
    font-size: 1.5rem;
}

.stats-text {
    font-size: 1rem;
    color: var(--text-dark);
    font-weight: 500;
}

.stats-count {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-green);
    background: linear-gradient(135deg, var(--primary-green), var(--accent-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stats-loaded .stats-count {
    animation: countPop 0.5s ease-out;
}

@keyframes countPop {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

/* Capacity Full State */
.registration-stats.capacity-full {
    background: linear-gradient(135deg, rgba(196, 30, 58, 0.15) 0%, rgba(212, 175, 55, 0.2) 100%);
    border-color: rgba(196, 30, 58, 0.4);
}

.stats-full {
    margin-bottom: 0.75rem;
}

.stats-full-message {
    font-size: 0.95rem;
    color: var(--text-dark);
    line-height: 1.5;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(212, 175, 55, 0.3);
    font-style: italic;
}

.spots-remaining {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed rgba(212, 175, 55, 0.3);
}

.spots-warning {
    color: var(--primary-red);
    font-weight: 600;
    font-size: 0.9rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Disabled Form State */
.form-disabled {
    opacity: 0.6;
    pointer-events: none;
}

.form-disabled .submit-btn {
    background: linear-gradient(135deg, #888 0%, #666 100%);
    cursor: not-allowed;
}

@media (max-width: 600px) {
    .registration-stats {
        padding: 0.75rem 1rem;
    }

    .stats-text {
        font-size: 0.9rem;
    }

    .stats-count {
        font-size: 1.1rem;
    }

    .stats-full-message {
        font-size: 0.85rem;
    }
}
