/* ============================================
   FONTS - GOTHAM WEB FONTS
   ============================================ */

/* Gotham Light - Weight 300 */
@font-face {
    font-family: 'Gotham';
    src: url('fonts/GothamPro-light.woff2') format('woff2'),
         url('fonts/GothamPro-light.woff') format('woff');
    font-weight: 300;
    font-style: normal;
}

   /* Gotham Regular - Weight 400 */
@font-face {
    font-family: 'Gotham';
    src: url('fonts/GothamPro-regular.woff2') format('woff2'),
         url('fonts/GothamPro-regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
}

/* Gotham Medium - Weight 500 */
@font-face {
    font-family: 'Gotham';
    src: url('fonts/GothamPro-medium.woff2') format('woff2'),
         url('fonts/GothamPro-medium.woff') format('woff');
    font-weight: 500;
    font-style: normal;
}

/* Gotham Semibold - Weight 600 */
@font-face {
    font-family: 'Gotham';
    src: url('fonts/GothamPro-semibold.woff2') format('woff2'),
         url('fonts/GothamPro-semibold.woff') format('woff');
    font-weight: 600;
    font-style: normal;
}

/* ============================================
   DESIGN SYSTEM & COLOR VARIABLES
   ============================================ */

:root {
    /* Brand Colors */
    --color-navy: #1D1740;
    --color-red: #E4002B;
    --color-light-blue: #0093AD;
    --color-yellow: #F1B434;
    
    /* Neutral Colors */
    --color-white: #FFFFFF;
    --color-off-white: #F8F8FA;
    --color-gray-50: #F5F5F7;
    --color-gray-100: #EFEFEF;
    --color-gray-200: #D1D1D1;
    --color-gray-300: #A8A8A8;
    --color-gray-700: #4A4A4A;
    --color-gray-900: #1A1A1A;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
    
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    /* Typography */
    --font-family: 'Gotham', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 
                   'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    --font-size-xs: 12px;
    --font-size-sm: 13px;
    --font-size-base: 14px;
    --font-size-md: 16px;
    --font-size-lg: 18px;
    --font-size-xl: 20px;
    --font-size-2xl: 24px;
    --font-size-3xl: 32px;
    
    /* Line Heights */
    --line-height-tight: 1.2;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--color-white);
    color: var(--color-gray-900);
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1, h2, h3, h4, h5, h6 {
    font-weight: 500;
    line-height: var(--line-height-tight);
}

.accent {
    color: var(--color-light-blue);
}

/* ============================================
   LAYOUT: SIDEBAR + MAP
   ============================================ */

body {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 400px;
    height: 100vh;
    background-color: var(--color-navy);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    overflow-y: auto;
    z-index: 100;
    box-shadow: var(--shadow-md);
    padding: var(--spacing-2xl) var(--spacing-xl);
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xl);
}

.map-container {
    flex: 1;
    margin-left: 380px;
    position: relative;
}

#map {
    width: 100%;
    height: 100%;
}

/* ============================================
   SIDEBAR: LOGO
   ============================================ */

.sidebar-logo {
    width: 100%;
    max-width: 140px;
    margin-bottom: 0px;
}

.sidebar-logo img {
    width: 100%;
    height: auto;
    display: block;
}

/* ============================================
   SIDEBAR: HEADER
   ============================================ */

.sidebar-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
    padding-bottom: var(--spacing-lg);
}

.sidebar-title {
    font-size: 40px;
    font-weight: 500;
    color: var(--color-white);
    line-height: var(--line-height-tight);
}

/* ============================================
   SIDEBAR: STATS
   ============================================ */

.stats-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
    padding: var(--spacing-lg);
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    text-align: center;
}

.stat-label {
    font-size: var(--font-size-xs);
    font-weight: 400;
    color: rgba(255, 255, 255, 1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 20px;
}

.stat-value {
    font-size: 40px;
    font-weight: 400;
    color: var(--color-light-blue);
    line-height: 40px;
}

/* ============================================
   SIDEBAR: COUNTRIES
   ============================================ */

.countries-section {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.section-title {
    font-size: var(--font-size-lg);
    font-weight: 400;
    color: var(--color-white);
}

.countries-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
    align-items: stretch;
}

.country-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    transition: background-color var(--transition-fast);
    cursor: pointer;
    min-width: 0;
    overflow: hidden;
}

.country-item:hover {
    background-color: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.4)
}

.country-flag {
    font-size: var(--font-size-2xl);
    line-height: 1;
    flex-shrink: 0;
}

.country-name {
    font-size: var(--font-size-sm);
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.country-count {
    font-size: var(--font-size-lg);
    font-weight: 400;
    color: var(--color-yellow);
    margin-left: auto;
    flex-shrink: 0;
}

/* ============================================
   SIDEBAR: INSTRUCTION
   ============================================ */

.sidebar-instruction {
    margin-top: auto;
    padding-top: var(--spacing-xl);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-instruction p {
    font-size: var(--font-size-sm);
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
    line-height: var(--line-height-relaxed);
}

/* ============================================
   PROJECT CARD
   ============================================ */

.project-card {
    position: fixed;
    bottom: var(--spacing-xl);
    right: var(--spacing-xl);
    width: 400px;
    max-height: 75vh;
    background-color: var(--color-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    z-index: 200;
    display: flex;
    flex-direction: column;
    animation: slideUp var(--transition-base);
}

.card-close {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-gray-50);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: var(--font-size-2xl);
    color: var(--color-gray-700);
    transition: background-color var(--transition-fast);
    z-index: 10;
}

.card-close:hover {
    background-color: var(--color-gray-100);
}

.card-image-wrapper {
    position: relative;
    width: 100%;
    height: 240px;
    overflow: hidden;
    background-color: var(--color-gray-100);
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-content {
    flex: 1;
    padding: var(--spacing-xl);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.card-title {
    font-size: var(--font-size-xl);
    font-weight: 400;
    color: var(--color-navy);
    line-height: var(--line-height-tight);
}

.card-details {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--color-gray-100);
}

.detail-row.highlight {
    background-color: var(--color-off-white);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    border-bottom: none;
    margin: 0 calc(-1 * var(--spacing-xl)) calc(-1 * var(--spacing-xl)) calc(-1 * var(--spacing-xl));
    padding: var(--spacing-md) var(--spacing-xl);
}

.detail-label {
    font-size: var(--font-size-xs);
    font-weight: 400;
    color: var(--color-gray-300);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.detail-value {
    font-size: var(--font-size-md);
    font-weight: 400;
    color: var(--color-gray-900);
    text-align: right;
    flex: 1;
    margin-left: var(--spacing-md);
}

.detail-row.highlight .detail-value {
    color: var(--color-red);
    font-size: var(--font-size-lg);
}

/* ============================================
   MAPBOX OVERRIDES (Greyscale styling)
   ============================================ */

.mapboxgl-canvas {
    filter: saturate(0.85) brightness(1.05);
}

/* ============================================
   RESPONSIVE: TABLET & MOBILE
   ============================================ */

@media (max-width: 1280px) {
    .sidebar {
        width: 320px;
        padding: var(--spacing-xl);
    }
    
    .map-container {
        margin-left: 320px;
    }
    
    .project-card {
        width: 360px;
        right: var(--spacing-md);
    }
    
    .countries-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    body {
        flex-direction: column;
    }
    
    .sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        width: 100%;
        height: auto;
        max-height: 40vh;
        border-right: none;
        border-top: 1px solid var(--color-gray-100);
        overflow-y: auto;
        z-index: 100;
        padding: var(--spacing-lg);
    }
    
    .sidebar-content {
        gap: var(--spacing-lg);
    }
    
    .map-container {
        margin-left: 0;
        height: 60vh;
    }
    
    .project-card {
        position: fixed;
        bottom: auto;
        top: var(--spacing-xl);
        left: var(--spacing-xl);
        right: var(--spacing-xl);
        width: auto;
        max-width: 500px;
    }
}

@media (max-width: 640px) {
    .sidebar {
        padding: var(--spacing-md);
    }
    
    .sidebar-title {
        font-size: var(--font-size-xl);
    }
    
    .stats-section {
        grid-template-columns: 1fr;
    }
    
    .countries-list {
        display: grid;
        grid-template-columns: 1fr;
    }
    
    .project-card {
        left: var(--spacing-sm);
        right: var(--spacing-sm);
        width: auto;
        max-height: 45vh;
    }
    
    .card-content {
        padding: var(--spacing-lg);
    }
}
