/* --- BRAND COLOR PALETTE --- */
:root {
    /* Bright Mode (Default) */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F4F7FC;
    --bg-accent: #FFFFFF;
    --text-primary: #22252A;
    --text-secondary: #555555;
    --accent-color: #1A3766; /* Main Blue from logo */
    --highlight-color: #D82C2C; /* Red from logo */
    --border-color: #E0E0E0;
    --header-bg: rgba(255, 255, 255, 0.85);
    --footer-bg: #1A1D24;
}

body.dark-mode {
    /* Dark Mode Overrides */
    --bg-primary: #1A1D24;
    --bg-secondary: #111317;
    --bg-accent: #262A33;
    --text-primary: #F5F5F5;
    --text-secondary: #A9A9A9;
    --accent-color: #00CFE8; /* High-contrast Cyan for dark mode actions */
    --highlight-color: #D82C2C;
    --border-color: #333;
    --header-bg: rgba(26, 29, 36, 0.85);
    --footer-bg: #111317;
}

/* --- Global Styles --- */
body {
    background-color: var(--bg-primary);
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
    line-height: 1.8;
    margin: 0; padding: 0;
    transition: background-color 0.3s ease, color 0.3s ease;
}
h1, h2, h3, h4 { font-family: 'Poppins', sans-serif; color: var(--text-primary); }
h1 { font-size: 3.2rem; } h2 { font-size: 2.5rem; text-align: center; } 
h3 { font-size: 1.5rem; color: var(--highlight-color); }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* --- Header & Navigation --- */
.main-header {
    background-color: var(--header-bg); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color); position: sticky; top: 0; z-index: 1000;
}
.main-header .container { display: flex; justify-content: space-between; align-items: center; padding: 10px 20px; }
.main-nav { display: flex; align-items: center; gap: 20px; }
.main-nav ul { margin: 0; padding: 0; list-style: none; display: flex; align-items: center; gap: 30px; }
.main-nav a { text-decoration: none; color: var(--text-secondary); font-weight: 500; font-size: 0.9rem; position: relative; padding-bottom: 5px; transition: color 0.3s ease; }
.main-nav a:hover, .main-nav a.active { color: var(--accent-color); }
.main-nav a:after { content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 2px; background-color: var(--accent-color); transition: width 0.3s ease; }
.main-nav a:hover:after, .main-nav a.active:after { width: 100%; }

/* Dropdown Menu Styles */
.dropdown { position: relative; display: inline-block; }
.dropdown-content {
    display: none; position: absolute; background-color: var(--bg-accent);
    min-width: 220px; box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1001; border-radius: 8px; border: 1px solid var(--border-color);
    top: 100%; padding-top: 10px; padding-bottom: 10px; overflow: hidden;
}
.dropdown-content a { color: var(--text-secondary); padding: 12px 16px; text-decoration: none; display: block; font-size: 0.9rem; }
.dropdown-content a:hover { background-color: var(--bg-secondary); color: var(--accent-color); }
.dropdown:hover .dropdown-content { display: block; }
.dropbtn.active { color: var(--accent-color); }

/* --- LOGO STYLES --- */
.logo-link { display: block; line-height: 0; }
.logo-image { max-height: 90px; width: auto; }

/* --- THEME TOGGLE BUTTON --- */
.theme-toggle-button {
    background: var(--bg-secondary); border: 1px solid var(--border-color);
    color: var(--text-primary); width: 40px; height: 40px; border-radius: 50%;
    cursor: pointer; font-size: 1.2rem; display: flex; justify-content: center;
    align-items: center; transition: background-color 0.3s ease, transform 0.3s ease;
}
.theme-toggle-button:hover { transform: scale(1.1); }

/* --- Hero Section & Buttons --- */
.hero, .page-hero.automotive-hero-bg, .page-hero.ior-hero-bg { text-align: center; padding: 100px 20px; position:relative; background-size: cover; background-position: center;}
.hero::before, .page-hero.automotive-hero-bg::before, .page-hero.ior-hero-bg::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.6);}
.hero-content, .page-hero .container { position: relative; z-index: 2; }
.hero { background-image: url('../images/hero-background.jpg'); }
.page-hero.automotive-hero-bg { background-image: url('../images/automotive-hero.jpg'); }
.page-hero.ior-hero-bg { background-image: url('../images/ior-hero.jpg'); }
.hero h1, .hero p, .page-hero.automotive-hero-bg h1, .page-hero.automotive-hero-bg p, .page-hero.ior-hero-bg h1, .page-hero.ior-hero-bg p { color: #fff; }

.page-hero { padding: 80px 20px; text-align: center; background-color: var(--bg-secondary); border-bottom:1px solid var(--border-color); }
.page-hero h1 { color: var(--text-primary); } .page-hero p { color: var(--text-secondary); max-width: 650px; margin: 1rem auto 2rem auto; }

.btn {
    padding: 12px 28px; text-decoration: none; font-weight: 600; border-radius: 8px;
    transition: all 0.3s ease; font-family: 'Poppins', sans-serif; font-size: 0.9rem;
    display: inline-block; margin: 5px; border: 2px solid transparent; cursor: pointer;
}
.btn-primary { background-color: var(--accent-color); color: #FFFFFF; }
.btn-primary:hover { background-color: var(--highlight-color); transform: scale(1.05); }
.btn-secondary { background-color: transparent; color: #F5F5F5; border-color: #F5F5F5; }
.btn-secondary:hover { background-color: #F5F5F5; color: #1A1D24; }
.btn-large { padding: 16px 40px; font-size: 1rem; }
.learn-more { color: var(--highlight-color); font-weight: 600; text-decoration: none; display:inline-block; margin-top:1rem; }

/* --- MAP SHOWCASE --- */
#map-showcase { padding: 80px 20px; background-color: var(--bg-secondary); text-align: center; border-top: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color); }
body.dark-mode #map-showcase { background-image: linear-gradient(rgba(38, 42, 51, 0.9), rgba(38, 42, 51, 0.9)), url('../images/world-map.png'); background-size: cover; background-position: center;}
#map-showcase h2 { color: var(--text-primary); } #map-showcase p { color: var(--text-secondary); max-width: 600px; margin-left: auto; margin-right: auto; }

/* --- Content Sections & Cards --- */
.page-content, .services-overview, .value-proposition { padding: 100px 20px; }
.value-proposition { background-color: var(--bg-secondary); }
.section-header { margin-bottom: 4rem; text-align: center; }
.section-header p { font-size: 1.1rem; max-width: 700px; margin: 1rem auto 0 auto; }
.services-grid, .advantage-grid, .feature-grid, .advantage-grid-full, .resource-list-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px; }
.resource-list { max-width: 900px; margin: 0 auto; }
.service-card, .advantage-item, .feature-item, .solution-item, .cta-box, .advantage-box {
    background-color: var(--bg-accent); padding: 35px; border-radius: 10px;
    border: 1px solid var(--border-color); transition: all 0.3s ease;
}
.service-card:hover, .advantage-item:hover, .feature-item:hover { transform: translateY(-8px); border-color: var(--accent-color); }
.service-card.highlight { border-color: var(--accent-color); }
.content-layout { display: flex; gap: 60px; }
.main-content { flex: 2; }
.sidebar { flex: 1; position: sticky; top: 120px; align-self: flex-start; }
.text-content { max-width: 800px; margin: 0 auto; }

/* --- ABOUT US PAGE IMAGE FIX --- */
.about-section {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 5rem;
    gap: 50px;
}
.about-image-left, .about-image-right {
    flex: 1 1 300px; /* Let it grow/shrink with a base of 300px */
    max-width: 350px; /* Hard limit on how big it can get */
    width: 100%; /* Ensure it's responsive on small screens */
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    object-fit: cover;
    margin: 0 auto; /* Center image when it wraps on mobile */
}
.about-section div {
    flex: 2 1 400px; /* Give more space to the text block */
}


/* --- SVG ICON STYLES --- */
.feature-icon { margin-bottom: 1rem; height: 48px; width: 48px; margin-left: auto; margin-right: auto; }
.feature-icon svg { height: 100%; width: 100%; fill: var(--accent-color); }
.feature-item h4 { margin-top: 0; color: var(--text-primary); }
.solution-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.solution-grid-full { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 20px; }
.solution-item { border-left: 3px solid var(--accent-color); text-align:left; }
.solution-item strong { color: var(--text-primary); font-family: 'Poppins'; font-weight: 600; font-size: 1.1rem; }
.checklist li::before { color: var(--bg-primary); background-color: var(--accent-color); }
.solution-item.highlight-service { border-left-color: var(--highlight-color); }

/* --- FAQ STYLES --- */
.faq-container { max-width: 800px; margin: 0 auto; }
.faq-item {
    background-color: var(--bg-accent); border: 1px solid var(--border-color);
    border-radius: 8px; margin-bottom: 15px; transition: background-color 0.3s ease;
}
.faq-item summary {
    font-size: 1.1rem; font-weight: 600; font-family: 'Poppins', sans-serif;
    color: var(--text-primary); padding: 20px; cursor: pointer;
    position: relative; list-style: none;
}
.faq-item summary::after {
    content: '+'; position: absolute; right: 20px; font-size: 1.5rem;
    transition: transform 0.3s ease; color: var(--accent-color);
}
.faq-item[open] { background-color: var(--bg-secondary); }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { padding: 0 20px 20px 20px; margin: 0; line-height: 1.8; }






/* --- NEW WORKFLOW DIAGRAM STYLES --- */
.workflow-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 3rem 0;
}
.workflow-item {
    text-align: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    flex: 1; /* Allows items to grow and shrink */
    min-width: 140px; /* Prevents items from becoming too small */
}
.workflow-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: var(--accent-color);
    color: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px auto;
    font-weight: bold;
    font-family: 'Poppins', sans-serif;
}
.workflow-text {
    color: var(--text-primary);
    font-weight: 500;
}
.workflow-arrow {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 0 0 36px; /* Do not grow or shrink */
}
.workflow-arrow svg {
    width: 36px;
    height: 36px;
    fill: var(--accent-color);
}
/* Hide the last arrow when it wraps to a new line by itself */
.workflow-container > .workflow-item:last-child ~ .workflow-arrow {
    display: none;
}


/* --- Footer --- */
.main-footer { background-color: var(--footer-bg); color: #A9A9A9; padding: 60px 20px 30px 20px; }
.footer-grid {
    display: grid; grid-template-columns: 2fr 2fr 1fr; gap: 40px;
    max-width: 900px; margin: 0 auto 40px auto; text-align: left;
}
.footer-column { min-width: 180px; }
.footer-column h4 { color: #FFFFFF; font-size: 1.2rem; }
.footer-column ul { list-style: none; padding: 0; }
.footer-column ul li { margin-bottom: 10px; }
.footer-column a { color: #F5F5F5; text-decoration: none; transition: color 0.3s ease; }
.footer-column a:hover { color: var(--highlight-color); }
.footer-copyright { text-align: center; margin-top: 40px; padding-top: 20px; border-top: 1px solid #333; font-size: 0.9rem; }

/* --- MOBILE NAVIGATION --- */
/*
.hamburger-button { display: none; background: none; border: none; color: var(--text-primary); font-size: 2rem; cursor: pointer; }
.mobile-menu { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: var(--bg-primary); z-index: 2000; flex-direction: column; align-items: center; justify-content: center; }
.mobile-menu-header { position: absolute; top: 10px; right: 20px; width: 100%; display: flex; justify-content: flex-end; }
.close-menu-button { background: none; border: none; color: var(--text-primary); font-size: 2.5rem; cursor: pointer; }
.mobile-menu nav ul { flex-direction: column; gap: 30px; text-align: center; }
.mobile-menu nav a { font-size: 1.5rem; font-family: 'Poppins', sans-serif; color: var(--text-primary); text-decoration: none; }
.mobile-menu .dropdown-content { display: none !important; }
*/

/* --- MOBILE NAVIGATION --- */
.hamburger-button { display: none; background: none; border: none; color: var(--text-primary); font-size: 1.8rem; cursor: pointer; z-index: 2001; padding: 5px; }
.mobile-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(3px); z-index: 1999;
    opacity: 0; transition: opacity 0.3s ease;
}
.mobile-overlay.active { display: block; opacity: 1; }
.mobile-menu {
    position: fixed; top: 0; right: 0; width: 80%; max-width: 300px; height: 100%;
    background-color: var(--bg-accent); z-index: 2000;
    transform: translateX(100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -5px 0 25px rgba(0,0,0,0.15); display: flex; flex-direction: column;
    padding: 20px; border-left: 1px solid var(--border-color);
}
.mobile-menu.open { transform: translateX(0); display: flex; }
.mobile-menu-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 40px; padding-bottom: 15px; border-bottom: 1px solid var(--border-color); }
.mobile-logo { height: 35px; width: auto; }
/* REMOVED mobile logo inversion */
.close-menu-button { background: none; border: none; color: var(--text-primary); font-size: 2rem; cursor: pointer; line-height: 1; }
.mobile-menu nav ul { display: flex; flex-direction: column; gap: 0; list-style: none; padding: 0; margin: 0; text-align: left; }
.mobile-menu nav li { border-bottom: 1px solid var(--border-color); }
.mobile-menu nav a { display: block; font-size: 1.1rem; font-family: 'Poppins', sans-serif; color: var(--text-primary); text-decoration: none; padding: 15px 0; transition: color 0.2s ease, padding-left 0.2s ease; }
.mobile-menu nav a:hover { color: var(--accent-color); padding-left: 10px; }
.mobile-menu .dropdown-content { display: none !important; }
.mobile-cta { margin-top: auto; padding-top: 20px; }
.mobile-cta .btn { width: 100%; text-align: center; justify-content: center; }

/* --- Responsive Design Update --- */
@media (max-width: 992px) {
    .main-nav ul { display: none; } /* Hide desktop links */
    .hamburger-button { display: block; } /* Show hamburger */
}




/* --- Responsive Design --- */
@media (max-width: 1024px) {
    /* No special grid rules needed anymore, flexbox handles wrapping */
}

@media (max-width: 992px) {
    .content-layout { flex-direction: column; }
    .sidebar { position: static; }
    .main-nav ul { display: none; }
    .hamburger-button { display: block; }
}
@media (max-width: 768px) {
    h1 { font-size: 2.5rem; } h2 { font-size: 2rem; }
    .solution-grid, .solution-grid-full, .advantage-grid-full { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; text-align: center; }
    .workflow-container {
        flex-direction: column;
        align-items: stretch;
    }
    .workflow-arrow {
        transform: rotate(90deg);
        margin: 15px 0;
    }
}


/* --- NEW TRACKING PAGE STYLES --- */
.tracking-form-container {
    max-width: 600px;
    margin: 0 auto 40px auto;
}
#tracking-form {
    display: flex;
    gap: 10px;
}
#tracking-number {
    flex-grow: 1;
    padding: 15px;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-accent);
    color: var(--text-primary);
}
.results-container {
    max-width: 800px;
    margin: 40px auto;
}
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--bg-secondary);
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.error-message {
    text-align: center;
    padding: 20px;
    border: 1px solid var(--highlight-color);
    color: var(--highlight-color);
    border-radius: 8px;
    background-color: var(--bg-secondary);
}
.tracking-timeline {
    list-style: none;
    padding: 0;
    position: relative;
    border-left: 2px solid var(--border-color);
    margin-left: 20px;
}
.timeline-item {
    position: relative;
    padding: 10px 0 30px 40px;
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: -11px; /* (dot width / 2) + border width */
    top: 15px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: var(--border-color);
    border: 3px solid var(--bg-primary);
}
.timeline-item.latest::before {
    background-color: var(--accent-color);
}
.timeline-status {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
    margin: 0 0 5px 0;
}
.timeline-item.latest .timeline-status {
    color: var(--accent-color);
    font-size: 1.3rem;
}
.timeline-location {
    margin: 0 0 5px 0;
}
.timeline-date {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}
/* --- PAGE SPECIFIC HERO BACKGROUNDS --- */

/* 1. About Us Page */
.page-hero.about-hero-bg {
    background-image: url('../images/about-hero.png');
    background-size: cover;
    background-position: center;
    position: relative;
}

/* 2. Tracking Page */
.page-hero.tracking-hero-bg {
    background-image: url('../images/tracking-hero.png');
    background-size: cover;
    background-position: center;
    position: relative;
}

/* 3. Why Transnet Page */
.page-hero.why-hero-bg {
    background-image: url('../images/why-hero.png');
    background-size: cover;
    background-position: center bottom; /* Anchors buildings to bottom */
    position: relative;
}

/* 4. Resources Page */
.page-hero.resources-hero-bg {
    background-image: url('../images/resources-hero.png');
    background-size: cover;
    background-position: center;
    position: relative;
}

/* --- HERO OVERLAY (APPLIES TO ALL ABOVE) --- */
/* This ensures the white text is readable over the images */
.page-hero.about-hero-bg::before,
.page-hero.tracking-hero-bg::before,
.page-hero.why-hero-bg::before,
.page-hero.resources-hero-bg::before {
    content: '';
    position: absolute;
    top: 0; 
    left: 0; 
    right: 0; 
    bottom: 0;
    background: rgba(0, 0, 0, 0.65); /* Dark overlay */
    z-index: 1;
}

/* Ensure Text sits on top of the overlay */
.page-hero.about-hero-bg .container,
.page-hero.tracking-hero-bg .container,
.page-hero.why-hero-bg .container,
.page-hero.resources-hero-bg .container {
    position: relative;
    z-index: 2;
}

.page-hero.about-hero-bg h1, .page-hero.about-hero-bg p,
.page-hero.tracking-hero-bg h1, .page-hero.tracking-hero-bg p,
.page-hero.why-hero-bg h1, .page-hero.why-hero-bg p,
.page-hero.resources-hero-bg h1, .page-hero.resources-hero-bg p {
    color: #ffffff; /* Force white text */
}