/* ============================================================
   XM SNOW RUSH / XMASTERS - Global Styles
   ============================================================ */

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

:root {
    --vh: 1vh;
    
    /* XMasters Primary Colors */
    --xm-blue: #1a4d7c;           /* Deep winter blue */
    --xm-light-blue: #6ba3d4;     /* Sky/snow accent */
    --xm-white: #f0f4f8;          /* Snow white */
    
    /* XMasters Secondary Colors */
    --xm-orange: #e87a2c;         /* XMasters accent orange */
    --xm-gold: #d4a84b;           /* Sand/beach accent */
    
    /* XMasters Neutral */
    --xm-dark: #0d2840;           /* Dark navy */
    --xm-gray: #5a6d7a;           /* Muted gray */
    
    /* Legacy variable mapping for compatibility */
    --nb-red: var(--xm-orange);
    --nb-dark: var(--xm-dark);
    --nb-light: var(--xm-white);
    --nb-gray: var(--xm-gray);
    --nb-accent: var(--xm-gold);
}

body {
    font-family: 'Outfit', 'Roboto', sans-serif;
    line-height: 1.6;
    color: var(--xm-dark);
    background-color: var(--xm-white);
    min-height: 100vh;
    min-height: calc(var(--vh, 1vh) * 100);
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header styles */
header {
    background-color: white;
    color: var(--xm-dark);
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(13, 40, 64, 0.08);
    position: relative;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-container {
    margin: 0;
}

.logo-container img {
    height: 50px;
    width: auto;
}

/* Hero section with winter gradient */
.hero {
    background: linear-gradient(135deg, var(--xm-blue) 0%, var(--xm-dark) 100%);
    color: white;
    padding: 60px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Snow pattern overlay */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXR0ZXJuIGlkPSJwYXR0ZXJuIiB4PSIwIiB5PSIwIiB3aWR0aD0iNjAiIGhlaWdodD0iNjAiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiPjxjaXJjbGUgY3g9IjMwIiBjeT0iMzAiIHI9IjIiIGZpbGw9InJnYmEoMjU1LDI1NSwyNTUsMC4xKSIvPjxjaXJjbGUgY3g9IjEwIiBjeT0iMTAiIHI9IjEuNSIgZmlsbD0icmdiYSgyNTUsMjU1LDI1NSwwLjA4KSIvPjxjaXJjbGUgY3g9IjUwIiBjeT0iNTAiIHI9IjEiIGZpbGw9InJnYmEoMjU1LDI1NSwyNTUsMC4xKSIvPjwvcGF0dGVybj48cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSJ1cmwoI3BhdHRlcm4pIi8+PC9zdmc+');
    opacity: 0.5;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.hero p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 40px;
    position: relative;
    opacity: 0.95;
}

/* Card styles */
.card {
    background-color: white;
    border-radius: 16px;
    padding: 40px;
    margin: -40px auto 40px;
    box-shadow: 0 10px 40px rgba(13, 40, 64, 0.12);
    position: relative;
    z-index: 10;
    max-width: 900px;
    transform: translateY(0);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 50px rgba(13, 40, 64, 0.18);
}

.card-title {
    color: var(--xm-dark);
    margin-top: 0;
    font-weight: 700;
    font-size: 1.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
    text-align: center;
}

.card-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--xm-blue), var(--xm-orange));
    margin: 15px auto 0;
    border-radius: 2px;
}

/* Button styles */
.nb-button,
.xm-button {
    display: inline-block;
    background: linear-gradient(135deg, var(--xm-orange) 0%, #d56820 100%);
    color: white;
    padding: 16px 32px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(232, 122, 44, 0.35);
    position: relative;
    overflow: hidden;
    border: none;
    cursor: pointer;
}

.nb-button::after,
.xm-button::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
    transition: 0.5s;
}

.nb-button:hover,
.xm-button:hover {
    background: linear-gradient(135deg, #d56820 0%, #c05a18 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(232, 122, 44, 0.45);
}

.nb-button:hover::after,
.xm-button:hover::after {
    left: 100%;
}

.nb-button--dark,
.xm-button--dark {
    background: linear-gradient(135deg, var(--xm-dark) 0%, #0a1f30 100%);
    box-shadow: 0 4px 15px rgba(13, 40, 64, 0.3);
}

.nb-button--dark:hover,
.xm-button--dark:hover {
    background: linear-gradient(135deg, #0a1f30 0%, #050f18 100%);
    box-shadow: 0 8px 25px rgba(13, 40, 64, 0.4);
}

.nb-button--blue,
.xm-button--blue {
    background: linear-gradient(135deg, var(--xm-blue) 0%, #144063 100%);
    box-shadow: 0 4px 15px rgba(26, 77, 124, 0.35);
}

.nb-button--blue:hover,
.xm-button--blue:hover {
    background: linear-gradient(135deg, #144063 0%, #0f3050 100%);
    box-shadow: 0 8px 25px rgba(26, 77, 124, 0.45);
}

.buttons-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
}

/* Section title */
.section-title {
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 50px;
    position: relative;
    font-size: 2rem;
    font-weight: 700;
    color: var(--xm-dark);
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--xm-blue), var(--xm-orange));
    margin: 15px auto 0;
    border-radius: 2px;
}

/* Footer styles */
footer {
    background: linear-gradient(135deg, var(--xm-dark) 0%, #0a1f30 100%);
    color: white;
    text-align: center;
    padding: 40px 0 20px;
    font-size: 0.9rem;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-logo {
    filter: brightness(0) invert(1);
    height: 40px;
    margin-bottom: 20px;
}

.footer-links {
    display: flex;
    gap: 20px;
    margin: 20px 0;
}

.footer-links a {
    color: white;
    text-decoration: none;
    transition: color 0.3s;
    opacity: 0.85;
}

.footer-links a:hover {
    color: var(--xm-orange);
    opacity: 1;
}

.copyright {
    margin-top: 20px;
    color: rgba(255,255,255,0.6);
}

/* Animation classes */
.fade-in {
    animation: fadeIn 1s ease-in-out;
}

.slide-up {
    animation: slideUp 0.8s ease-in-out;
}

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

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

/* Feature icon styles */
.feature-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, rgba(26, 77, 124, 0.15) 0%, rgba(232, 122, 44, 0.1) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--xm-blue);
    border: 2px solid rgba(26, 77, 124, 0.2);
}

/* Brand section */
.brand-section {
    background: linear-gradient(135deg, var(--xm-dark) 0%, var(--xm-blue) 100%);
    color: white;
    padding: 80px 0;
    text-align: center;
}

.brand-section .section-title {
    color: white;
}

.brand-section .section-title::after {
    background: linear-gradient(90deg, var(--xm-orange), var(--xm-gold));
}

.brand-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 800px;
    margin: 0 auto;
}

.brand-image {
    margin-bottom: 30px;
}

.brand-logo {
    width: 180px;
    height: auto;
    filter: brightness(0) invert(1);
}

.brand-text {
    text-align: center;
}

.brand-text p {
    margin-bottom: 20px;
    font-size: 1.1rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.9);
}

/* Responsive styles */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .card {
        padding: 30px 20px;
    }
    
    .nb-button,
    .xm-button {
        width: 100%;
        margin: 10px 0;
    }
    
    .buttons-container {
        flex-direction: column;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
}

/* Mobile portrait specific styles */
@media (max-width: 480px) {
    .score-display {
        font-size: 1.5rem;
    }
    
    h1 {
        font-size: 1.4rem;
    }
    
    h2 {
        font-size: 1.2rem;
    }
    
    th, td {
        padding: 8px;
        font-size: 0.9rem;
    }
    
    input, .btn {
        padding: 10px;
    }
    
    section {
        padding: 12px;
    }
    
    .container {
        padding: 8px;
    }
    
    table {
        font-size: 0.9rem;
    }
    
    .btn {
        min-height: 44px;
    }
    
    input {
        min-height: 44px;
    }
}

/* ============================================================
   FORM STYLES
   ============================================================ */

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"] {
    width: 100%;
    padding: 14px 18px;
    margin-bottom: 15px;
    border: 2px solid rgba(13, 40, 64, 0.15);
    border-radius: 10px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.3s, box-shadow 0.3s;
    background-color: white;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: var(--xm-blue);
    box-shadow: 0 0 0 3px rgba(26, 77, 124, 0.15);
}

input::placeholder {
    color: var(--xm-gray);
    opacity: 0.7;
}

/* ============================================================
   TABLE STYLES (Leaderboard, Admin)
   ============================================================ */

.leaderboard-table,
.scores-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(13, 40, 64, 0.08);
}

.leaderboard-table th,
.scores-table th {
    background: linear-gradient(135deg, var(--xm-blue) 0%, var(--xm-dark) 100%);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 16px;
    text-align: left;
}

.leaderboard-table td,
.scores-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(13, 40, 64, 0.08);
}

.leaderboard-table tr:hover,
.scores-table tr:hover {
    background-color: rgba(26, 77, 124, 0.04);
}

.leaderboard-table tr:last-child td,
.scores-table tr:last-child td {
    border-bottom: none;
}

/* Top 3 highlight */
.leaderboard-table tbody tr:nth-child(1) .rank,
.leaderboard-table tbody tr:nth-child(2) .rank,
.leaderboard-table tbody tr:nth-child(3) .rank {
    color: var(--xm-orange);
    font-weight: 700;
}

.leaderboard-table tbody tr:nth-child(1) {
    background: linear-gradient(90deg, rgba(232, 122, 44, 0.1) 0%, transparent 100%);
}
