/* =========================================
   1. GLOBAL VARIABLES & RESET
   ========================================= */
:root {
    --primary-blue: #0e1d3e;
    --accent-red: #a3001e;
    --accent-gold: #c5a059;
    --bg-outer: #e0e0e0;
    --unified-beige: #faf8f5;
    --site-width: 1100px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 40px 0;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: var(--bg-outer);
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

/* RESPONSIVE FIX: Changed width to max-width */
.main-wrapper {
    width: 100%;
    max-width: var(--site-width);
    background-color: var(--unified-beige);
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* =========================================
   2. HEADER & NAVIGATION
   ========================================= */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 50px;
    background-color: transparent;
}

.logo-img {
    height: 130px;
    width: auto;
    display: block;
}

nav {
    display: flex;
    align-items: center;
}

nav a.nav-link {
    text-decoration: none;
    color: var(--primary-blue);
    font-weight: bold;
    font-size: 14px;
    margin-left: 30px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Call to Action Group (Button + Flags) */
.cta-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-left: 30px;
    gap: 10px;
}

.btn-nav {
    background-color: var(--accent-red);
    color: white !important;
    padding: 14px 28px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-block;
}

/* Header Emoji Flags */
.flags-container {
    display: flex;
    gap: 15px;
}

.flag-link {
    text-decoration: none !important;
    border: none !important;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: inline-block;
}

.flag-link:visited,
.flag-link:hover,
.flag-link:active {
    text-decoration: none !important;
    border: none !important;
    opacity: 1;
}

/* =========================================
   3. COMMON PAGE ELEMENTS
   ========================================= */
.page-container { padding: 50px; }

.page-header {
    margin-bottom: 40px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 40px 50px; 
}
.page-container .page-header { padding: 0 0 20px 0; margin-bottom: 50px; }

.page-label {
    font-size: 11px;
    font-weight: 900;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 2px;
    display: block;
    margin-bottom: 10px;
}

h1 {
    font-size: 48px;
    color: var(--primary-blue);
    text-transform: uppercase;
    margin: 0;
    line-height: 1;
}

h2 {
    font-size: 42px;
    color: var(--primary-blue);
    text-transform: uppercase;
    margin: 0 0 20px 0;
    line-height: 1;
}

.btn {
    padding: 14px 30px;
    font-weight: bold;
    text-transform: uppercase;
    text-decoration: none;
    font-size: 14px;
    border-radius: 4px;
    display: inline-block;
}

.btn-gold { background-color: var(--accent-gold); color: var(--primary-blue); }
.btn-red { background-color: var(--accent-red); color: white; }

/* =========================================
   4. HOME PAGE SPECIFIC
   ========================================= */
.hero {
    position: relative;
    height: 550px;
    display: flex;
    align-items: center;
    padding-left: 50px;
    color: white;
    background-image: linear-gradient(90deg, rgba(14, 29, 62, 0.9) 0%, rgba(14, 29, 62, 0.4) 60%, rgba(14, 29, 62, 0) 100%), url('../images/hero.jpg');
    background-size: cover;
    background-position: center top;
    margin: 0;
    border-radius: 0;
    width: 100%;
}

.hero-content { max-width: 500px; z-index: 2; }

.hero h1 {
    font-size: 68px;
    line-height: 0.95;
    margin-bottom: 25px;
    color: #ffffff;
}
.hero-slogan {
    font-size: 20px;
    font-weight: bold;
    color: var(--accent-gold);
    margin-bottom: 20px;
    display: block;
    line-height: 1.4;
}

.hero-desc {
    font-size: 16px;
    margin-bottom: 35px;
    opacity: 0.9;
    line-height: 1.5;
    color: #f0f0f0;
}

/* Next Battle Section */
.next-battle {
    padding: 60px 50px;
    background-color: transparent;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.battle-info {
    width: 45%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.section-label {
    font-size: 11px;
    font-weight: 900;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
    display: block;
}

/* =========================================
   TIMER STYLES
   ========================================= */
.timer-container {
    margin-top: 15px;
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: baseline;
}

.timer-block {
    text-align: center;
    min-width: 60px;
}

.timer-number {
    font-family: 'Courier New', monospace;
    font-size: 44px;
    font-weight: bold;
    color: var(--primary-blue);
    line-height: 1;
    display: block;
}

.timer-label {
    font-size: 9px;
    color: #666;
    font-weight: bold;
    text-transform: uppercase;
    margin-top: 5px;
    display: block;
}

.timer-separator {
    font-family: 'Courier New', monospace;
    font-size: 44px;
    font-weight: bold;
    color: var(--primary-blue);
    line-height: 1;
}

/* --- OVERRIDES FOR "NEXT TRIP" PAGE --- */
.countdown-section .timer-number { color: #000000; font-size: 64px; }
.countdown-section .timer-block { min-width: 110px; }
.countdown-section .timer-separator { color: #000000; font-size: 60px; position: relative; top: -5px; }

.battle-btn-spacer { margin-top: 30px; }

/* Map */
.battle-map {
    width: 50%;
    height: 350px;
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    border: 1px solid #ccc;
}

.map-img-home {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
}

.map-pin {
    position: absolute;
    top: 45%;
    left: 55%;
    font-size: 30px;
    color: var(--accent-red);
    transform: translate(-50%, -100%);
    z-index: 2;
}

/* Team Section (Home) */
.team { padding: 60px 50px; background-color: transparent; }

.team-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 40px;
}

.player-card {
    height: 280px;
    background-color: #eee;
    position: relative;
    background-size: cover;
    background-position: center;
}

.player-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.player-details {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: rgba(163, 0, 30, 0.9);
    color: white;
    padding: 15px;
}

.p-name { margin: 0; font-weight: bold; font-size: 18px; }
.p-nick { margin: 5px 0 0 0; font-size: 12px; color: var(--accent-gold); }

.footer-link { text-align: center; margin-top: 50px; }

/* =========================================
   5. NEXT TRIP PAGE SPECIFIC
   ========================================= */
.destination-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    margin-bottom: 60px;
    align-items: start;
}

.large-map-box {
    background-color: white;
    padding: 10px;
    border: 1px solid #ddd;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    border-radius: 4px;
}

.large-map-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 2px;
}

.country-info-box { display: flex; flex-direction: column; }

.country-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    border-bottom: 2px solid #eee;
    padding-bottom: 20px;
}

.country-title {
    font-size: 42px;
    color: var(--primary-blue);
    text-transform: uppercase;
    margin: 0;
    line-height: 1;
}

.country-flag-large {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-box {
    background-color: white;
    padding: 15px;
    border-left: 3px solid var(--accent-gold);
}

.stat-label {
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    color: #999;
    display: block;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 16px;
    font-weight: bold;
    color: var(--primary-blue);
}

.history-text { font-size: 15px; line-height: 1.6; color: #444; }

.countdown-section {
    background-color: transparent;
    padding: 40px 40px 0 40px;
    text-align: center;
    margin-bottom: 60px;
    border-top: 1px solid #eee;
}

.cd-title {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 900;
    color: var(--accent-red);
    margin-bottom: 20px;
    display: block;
}

.competition-section {
    background-color: white;
    border-radius: 4px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    overflow: hidden;
    display: flex;
}

.comp-image-col { width: 50%; background-color: #ddd; position: relative; }
.comp-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    min-height: 400px;
}

.comp-text-col {
    width: 50%;
    padding: 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.comp-label {
    font-size: 11px;
    font-weight: 900;
    color: var(--accent-red);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 15px;
    display: block;
}

.comp-title {
    font-size: 36px;
    color: var(--primary-blue);
    text-transform: uppercase;
    margin: 0 0 20px 0;
    line-height: 1.1;
}

.comp-desc { font-size: 16px; line-height: 1.6; color: #555; margin-bottom: 30px; }

.comp-details-list { list-style: none; padding: 0; margin: 0; }
.comp-details-list li {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    color: #444;
    font-size: 14px;
}
.comp-details-list li strong { color: var(--primary-blue); margin-right: 10px; }

/* =========================================
   6. COUNTRIES PAGE SPECIFIC
   ========================================= */
.countries-section { padding: 50px; }

.countries-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.country-card {
    background-color: white;
    border: 1px solid #eee;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: transform 0.2s ease;
    display: flex;
    flex-direction: column;
}

.country-card:hover { transform: translateY(-5px); }

.map-area {
    width: 100%;
    height: 250px;
    background-color: #ddd;
    position: relative;
    overflow: hidden;
}

.map-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.9;
}

.country-content {
    padding: 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.country-info h2 {
    font-size: 28px;
    color: var(--primary-blue);
    margin: 0 0 5px 0;
    text-transform: uppercase;
}

.trip-year {
    font-size: 14px;
    color: var(--accent-gold);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.flag-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #f0f0f0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.trip-details {
    padding: 0 25px 25px 25px;
    border-top: 1px solid #f9f9f9;
    padding-top: 20px;
    display: flex;
    gap: 20px;
    align-items: center;
}

.detail-item { font-size: 12px; color: #666; }
.detail-item strong { color: var(--primary-blue); display: block; margin-bottom: 2px; }

.btn-country {
    display: inline-block;
    margin-left: auto;
    background-color: rgba(163, 0, 30, 0.9);
    color: white;
    text-decoration: none;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 10px;
    border-radius: 4px;
    padding: 8px 15px;
    transition: 0.2s;
    white-space: nowrap;
}

.btn-country:hover { background-color: rgb(163, 0, 30); color: white; }

/* =========================================
   7. CHALLENGE PAGE SPECIFIC
   ========================================= */
.challenge-grid {
    display: flex;
    gap: 60px;
    align-items: flex-start;
}

.info-col { flex: 1; padding-right: 20px; }

.info-title {
    font-size: 24px;
    color: var(--primary-blue);
    text-transform: uppercase;
    margin-top: 0;
    margin-bottom: 20px;
    border-left: 4px solid var(--accent-gold);
    padding-left: 15px;
}

.info-desc {
    font-size: 16px;
    line-height: 1.6;
    color: #444;
    margin-bottom: 40px;
}

.contact-details { list-style: none; padding: 0; margin: 0; }
.contact-details li {
    margin-bottom: 20px;
    font-size: 15px;
    color: #333;
    display: flex;
    flex-direction: column;
}

.contact-label {
    font-size: 11px;
    font-weight: 900;
    color: var(--accent-red);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.form-col {
    flex: 1;
    background-color: white;
    padding: 40px;
    border-radius: 4px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

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

label {
    display: block;
    font-size: 12px;
    font-weight: bold;
    color: var(--primary-blue);
    text-transform: uppercase;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

input[type="text"], input[type="number"], input[type="email"], textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    background-color: #f9f9f9;
    transition: border-color 0.3s;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-red);
    background-color: white;
}

textarea { resize: vertical; min-height: 120px; }

.btn-submit {
    background-color: var(--accent-red);
    color: white;
    border: none;
    padding: 16px 30px;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.3s;
}

.btn-submit:hover { background-color: #8a0019; }

/* =========================================
   8. PLAYERS PAGE SPECIFIC
   ========================================= */
.roster-section { padding: 50px; }

.roster-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.player-card-large {
    background-color: white;
    border: 1px solid #eee;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.player-photo-area {
    width: 100%;
    height: 320px;
    background-color: #ddd;
    position: relative;
}

.player-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.card-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background-color: var(--accent-gold);
    color: var(--primary-blue);
    padding: 4px 10px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    z-index: 2;
}

.player-content { padding: 25px; }

.player-name-large {
    font-size: 26px;
    color: var(--primary-blue);
    margin: 0 0 5px 0;
    font-weight: 800;
    text-transform: uppercase;
}

.player-nickname {
    color: var(--accent-red);
    font-family: serif;
    font-style: italic;
    font-size: 16px;
    margin-bottom: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}

.stat-item { font-size: 12px; }
.stat-label { color: #999; text-transform: uppercase; font-weight: 700; display: block; margin-bottom: 3px; }
.stat-value { color: var(--primary-blue); font-weight: bold; font-size: 13px; }

.btn-profile {
    display: block;
    text-align: center;
    margin-top: 20px;
    padding: 12px 0;
    background-color: rgba(163, 0, 30, 0.9);
    color: white;
    text-decoration: none;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 11px;
    border-radius: 4px;
    transition: 0.2s;
}

.btn-profile:hover {
    background-color: rgb(163, 0, 30);
    color: white;
}

/* =========================================
   9. COUNTRY DETAILS (GALLERY & EVENTS)
   ========================================= */
.country-detail-container { padding: 50px; }

.back-link {
    display: inline-block;
    margin-bottom: 30px;
    text-decoration: none;
    color: #666;
    font-weight: bold;
    font-size: 12px;
    text-transform: uppercase;
}
.back-link:hover { color: var(--primary-blue); }

.country-top-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    margin-bottom: 60px;
    align-items: start;
}

.history-text h3 {
    font-size: 14px;
    text-transform: uppercase;
    color: var(--accent-red);
    margin-bottom: 10px;
}

.event-section {
    background-color: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

.event-header { margin-bottom: 40px; max-width: 800px; }

.event-title {
    font-size: 32px;
    color: var(--primary-blue);
    text-transform: uppercase;
    margin: 0 0 15px 0;
}

.event-desc { font-size: 16px; color: #555; line-height: 1.6; }

.gallery-container {
    position: relative;
    max-width: 900px; 
    margin: 0 auto; 
    background-color: #eee;
    border-radius: 4px;
    overflow: hidden;
}

.gallery-viewer {
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f4f4f4;
}

.gallery-main-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(14, 29, 62, 0.7);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    z-index: 2;
}

.gallery-btn:hover { background-color: var(--accent-red); }
.btn-prev { left: 20px; }
.btn-next { right: 20px; }

.gallery-counter {
    text-align: center;
    padding: 15px;
    font-weight: bold;
    color: var(--primary-blue);
    background-color: white;
    border-top: 1px solid #eee;
}

/* =========================================
   10. INDIVIDUAL PLAYER PROFILE
   ========================================= */
.profile-container { padding: 50px; }

.profile-hero {
    display: flex;
    gap: 50px;
    margin-bottom: 60px;
    align-items: center;
}

.profile-image-box {
    width: 350px; 
    flex-shrink: 0;
}

.large-portrait {
    width: 100%;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    display: block;
}

.profile-intro { flex: 1; }

.profile-label {
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    color: var(--accent-gold);
    display: block;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.nickname {
    font-family: serif;
    font-style: italic;
    font-size: 24px;
    color: var(--accent-red);
    margin-bottom: 25px;
}

.bio-text {
    font-size: 16px;
    line-height: 1.6;
    color: #444;
    margin-bottom: 30px;
}

.stats-wrapper {
    background-color: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    margin-bottom: 50px;
}

.section-title {
    font-size: 18px;
    font-weight: 900;
    text-transform: uppercase;
    color: var(--primary-blue);
    border-bottom: 2px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 30px;
}

.full-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.big-stat { display: flex; flex-direction: column; }

.bs-label {
    font-size: 11px;
    text-transform: uppercase;
    color: #999;
    font-weight: bold;
    margin-bottom: 5px;
}

.bs-value {
    font-size: 16px;
    color: var(--primary-blue);
    font-weight: bold;
}

.signature-move {
    background-color: var(--accent-red);
    color: white;
    padding: 40px;
    border-radius: 4px;
    margin-bottom: 40px;
}

.sig-title {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--accent-gold);
    font-weight: bold;
    display: block;
    margin-bottom: 10px;
}

.sig-name {
    font-size: 28px;
    margin: 0 0 15px 0;
    text-transform: uppercase;
}

.sig-desc {
    font-size: 16px;
    line-height: 1.5;
    opacity: 0.9;
    max-width: 800px;
}

/* =========================================
   11. MOBILE / RESPONSIVE STYLES
   ========================================= */
@media screen and (max-width: 768px) {
    
    /* Global Container */
    body { padding: 0; }
    .main-wrapper { width: 100%; box-shadow: none; }
    
    /* Header */
    header {
        flex-direction: column;
        padding: 20px;
        gap: 20px;
    }
    nav {
        flex-direction: column;
        gap: 15px;
    }
    nav a.nav-link { margin-left: 0; }
    .cta-group { margin-left: 0; margin-top: 10px; }

    /* Home Hero */
    .hero {
        height: auto;
        padding: 60px 20px;
        text-align: center;
        background-position: center center;
    }
    .hero h1 { font-size: 42px; }
    .hero p { font-size: 14px; }

    /* Grids (Stack everything to 1 column) */
    .team-grid, 
    .roster-grid, 
    .destination-grid, 
    .countries-grid, 
    .country-top-grid,
    .challenge-grid,
    .full-stats-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    /* Flex Containers to Columns */
    .next-battle, 
    .competition-section,
    .profile-hero {
        flex-direction: column;
        text-align: center;
    }

    .battle-info, .battle-map,
    .comp-image-col, .comp-text-col,
    .info-col, .form-col {
        width: 100%;
    }

    /* Adjust Images */
    .comp-img { min-height: 250px; }
    .profile-image-box { width: 100%; max-width: 300px; margin: 0 auto; }
    .gallery-viewer { height: 300px; }

    /* Timer Scale Down */
    .countdown-section .timer-number { font-size: 40px; }
    .countdown-section .timer-separator { font-size: 36px; }
    .countdown-section .timer-block { min-width: 60px; }

    /* General Padding Fixes */
    .page-container, 
    .countries-section, 
    .roster-section, 
    .country-detail-container, 
    .profile-container {
        padding: 30px 20px;
    }
}
