/* --- Global Layout Constraints --- */
body {
    max-width: 1200px; /* Keeps the site from stretching too wide on giant monitors */
    margin: 0 auto;    /* Centers the entire website block on the screen */
    padding: 0 5%;     /* Creates a perfect 5% invisible border on the left and right */

    /* NEW: Forces the page to be at least the height of the monitor */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* NEW: Controls the middle content block */
main {
    flex: 1; /* This pushes the footer to the absolute bottom */
    display: flex;
    flex-direction: column;
    justify-content: center; /* This centers your content vertically on short hub pages */
    padding: 2rem 0; /* Ensures content never touches the header/footer */
}


/* --- Advanced Navigation Layout --- */
.main-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 0; /* Gives the header some vertical breathing room */
}

/* Force the center menu to take up available space and align its links dead center */
.nav-center {
    display: flex;
    gap: 2rem; /* The space between the words (About Us, Exports, etc.) */
    flex: 1;
    justify-content: center;
}

/* Keep the logo and button anchored strictly to their corners */
.nav-left, .nav-right {
    display: flex;
    flex: 0 0 auto; 
    align-items: center;
}

/* Ensure the theme button margin is removed since it's now in its own zone */
.theme-btn {
    margin-left: 0; 
}

/* --- Mobile Responsiveness --- */
/* On phones, this pushes the menu to a new line below the Logo and Button */
@media (max-width: 768px) {
    .main-nav {
        flex-wrap: wrap;
        gap: 1rem;
    }
    .nav-center {
        order: 3; /* Pushes the center menu to the bottom */
        width: 100%;
        gap: 1rem;
        flex-wrap: wrap;
    }
}


/* Responsive Image Defaults */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Image Gallery Grid for 6+ images */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.image-grid img {
    width: 100%;
    height: 250px; 
    object-fit: cover; 
    border-radius: 6px; 
}

/* Globe Container (Used ONLY on Home Page) */
#globe-container {
    width: 100%;
    height: 400px;
    background: var(--bg-surface);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
}

/* Hero Image Container for Sub-pages */
.hero-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 2rem;
}


/* Force Light Mode variables */
html[data-theme="light"] {
    color-scheme: light;
    --bg: #ffffff;
    --bg-surface: #f8f9fa;
    --text: #212529;
    --text-muted: #6c757d;
    --border: #dee2e6;
}

/* Force Dark Mode variables */
html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #121212;
    --bg-surface: #1e1e1e;
    --text: #f8f9fa;
    --text-muted: #adb5bd;
    --border: #343a40;
}

/* Hub Page Navigation Cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 2rem;
}

.card {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2rem 1rem;
    text-align: center;
    background: var(--bg-surface);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none; 
    color: var(--text);
    display: block;
    height: 100%;
}

/* Hover effect for a premium feel */
.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    border-color: var(--text-muted);
}

.card h3 {
    margin: 0;
    font-size: 1.25rem;
}

/* Professional Theme Toggle Button Styling */
.theme-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.4rem;
    margin-left: 1rem;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

/* Hover effect */
.theme-btn:hover {
    background: var(--bg-surface);
    color: var(--text);
}

/* --- The Swapping Logic --- */

/* 1. Default State (Failsafe): Hide the sun by default */
.sun-icon { display: none; }

/* 2. If the theme is explicitly light, hide the sun and show the moon */
html[data-theme="light"] .sun-icon { display: none; }
html[data-theme="light"] .moon-icon { display: block; }

/* 3. If the theme is dark, hide the moon and show the sun */
html[data-theme="dark"] .moon-icon { display: none; }
html[data-theme="dark"] .sun-icon { display: block; }