/* --- RESET & BASIC SETUP --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f4f9;
    color: #333;
}

/* --- HEADER STYLING --- */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    background-color: #002b5c; /* Deep Sky Blue */
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* --- LOGO --- */
/* --- LOGO --- */
.logo {
    display: flex;
    align-items: center;
    gap: 15px; /* Slightly more space between image and text */
}

.logo-img {
    height: 45px; /* Forces a consistent height */
    width: auto;  /* Keeps the image from stretching/squishing */
}


.logo-icon {
    font-size: 2rem;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: bold;
    color: #f4b400; /* Solar Yellow/Gold */
    letter-spacing: 1px;
}

/* --- NAVIGATION LINKS --- */
.nav-links {
    display: flex;
    list-style: none;
    gap: 25px;
}

.nav-links li a {
    text-decoration: none;
    color: #ffffff;
    font-weight: 500;
    font-size: 1rem;
    padding: 5px 0;
    transition: color 0.3s ease;
}

.nav-links li a:hover {
    color: #f4b400; /* Turns solar yellow on hover */
}

/* Highlights the current active page */
.nav-links li a.active {
    color: #4caf50; /* Kenya Green */
    border-bottom: 2px solid #4caf50;
}

/* --- MOBILE HAMBURGER MENU --- */
.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: #f4b400;
    border-radius: 5px;
    transition: 0.3s;
}

/* --- PLACEHOLDER CONTENT (Just for layout testing) --- */
.placeholder-content {
    text-align: center;
    margin-top: 15%;
    color: #888;
}

/* --- RESPONSIVE DESIGN (Mobile Phones) --- */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: #002b5c;
        flex-direction: column;
        align-items: center;
        padding: 20px 0;
        gap: 15px;
        display: none; /* Hidden by default on mobile */
        box-shadow: 0 5px 10px rgba(0,0,0,0.2);
    }

    /* JS will toggle this class to show/hide menu */
    .nav-links.active {
        display: flex;
    }
}

/* --- PREVIOUS HEADER CSS GOES HERE --- */
/* (Ensure your header CSS from Step 1 is at the top of this file) */


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

.panel {
    padding: 60px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-header h2 {
    font-size: 2.2rem;
    color: #002b5c;
    margin-bottom: 10px;
}

.section-header p {
    color: #666;
    font-size: 1.1rem;
}

/* --- BUTTONS --- */
.btn {
    display: inline-block;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background-color: #ff9800; /* Bright pale orange */
    color: #002b5c;
}

.btn-primary:hover {
    background-color: #fb8c00;
}

.btn-secondary {
    background-color: transparent;
    color: #ffffff;
    border: 2px solid #ffffff;
}

.btn-secondary:hover {
    background-color: #ffffff;
    color: #002b5c;
}

.btn-outline {
    background-color: transparent;
    color: #002b5c;
    border: 1px solid #002b5c;
    padding: 8px 16px;
}

.btn-outline:hover {
    background-color: #002b5c;
    color: #fff;
}


/* --- PANEL 1: HERO --- */
.hero-panel {
    background-color: #002b5c;
    color: white;
    padding-bottom: 0;
}

.hero-grid {
    display: flex;
    gap: 40px;
    align-items: center;
}

.hero-content {
    flex: 1;
}

.trumpet-text {
    color: #f4b400;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.hero-content h1 {
    font-size: 2.8rem;
    margin: 15px 0 20px 0;
    line-height: 1.2;
}

.hero-content p {
    color: #d1d5db;
    margin-bottom: 30px;
    font-size: 1.1rem;
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.hero-map {
    flex: 1;
    position: relative;
}

.map-placeholder {
    width: 100%;
    height: auto; /* Allows the SVG to dictate the height */
    min-height: 350px; /* Keeps a minimum size if the map isn't loaded yet */
    background-color: #ffffff; /* Changed to white so the map colors pop */
    border: 1px solid #e0e0e0; /* Subtle border instead of dashed */
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f4b400;
    font-size: 1.2rem;
    overflow: hidden; /* Ensures nothing spills out */
}

.map-links {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 0.9rem;
}

.map-links a {
    color: #f4b400;
    text-decoration: none;
}

.stats-bar {
    display: flex;
    justify-content: space-around;
    background-color: #001d3d;
    padding: 30px;
    margin-top: 50px;
    border-radius: 10px 10px 0 0;
    text-align: center;
}

.stat-item h3 {
    color: #f4b400;
    font-size: 1.8rem;
}

.stat-item p {
    color: #ffffff;
    font-size: 0.9rem;
    margin-top: 5px;
}


/* --- PANEL 2: SEARCH --- */
.search-panel {
    background-color: #f9f9f9;
    padding: 30px 0;
    border-bottom: 1px solid #ddd;
}

.search-box {
    display: flex;
    max-width: 700px;
    margin: 0 auto 15px auto;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.search-box input {
    flex: 1;
    padding: 15px;
    border: 1px solid #ccc;
    border-right: none;
    border-radius: 5px 0 0 5px;
    font-size: 1rem;
}

.search-box .btn {
    border-radius: 0 5px 5px 0;
}

.popular-searches {
    text-align: center;
    font-size: 0.9rem;
    color: #666;
}

.popular-searches a {
    color: #002b5c;
    text-decoration: none;
    margin: 0 5px;
}

.popular-searches a:hover {
    text-decoration: underline;
}


/* --- MAGIC RESPONSIVE GRIDS --- */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
}


/* --- CARDS BASE --- */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.3s;
    overflow: hidden;
}

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

.card-body {
    padding: 25px;
}

.card-link {
    color: #ff9800;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
}

/* --- PANEL 4: SUPPLIER CARDS --- */
.supplier-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.supplier-logo {
    width: 50px;
    height: 50px;
    background-color: #002b5c;
    color: #f4b400;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.supplier-info h3 {
    font-size: 1.1rem;
    color: #333;
}

.rating {
    color: #f4b400;
    font-size: 0.85rem;
}

.rating span {
    color: #666;
}

.location, .specialty {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 5px;
}

/* --- PANEL 5: NEWS CARDS --- */
.news-img {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    font-weight: bold;
}

.news-meta {
    color: #ff9800;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
}

.news-card h3 {
    margin: 10px 0;
    font-size: 1.1rem;
    color: #222;
}

.news-card p {
    color: #555;
    font-size: 0.95rem;
    margin-bottom: 10px;
}

.news-date {
    color: #999;
    font-size: 0.85rem;
}

/* --- PANEL 6: CALCULATOR CARDS --- */
.center-text {
    text-align: center;
}

.calc-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.calc-card h3 {
    margin-bottom: 10px;
}

.calc-card p {
    color: #666;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

/* --- PANEL 7: NETWORK STATS --- */
.network-panel {
    background-color: #f4f4f9;
}

.stats-grid {
    text-align: center;
}

.stat-box {
    padding: 20px;
}

.stat-box h2 {
    color: #002b5c;
    font-size: 2.5rem;
}

.stat-box p {
    color: #666;
    margin-top: 5px;
}


/* --- FOOTER --- */
.main-footer {
    background-color: #111;
    color: #bbb;
    padding: 60px 0 0 0;
}

.main-footer .logo-text {
    color: #f4b400;
}

.footer-col h4 {
    color: white;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul li a {
    color: #bbb;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-col ul li a:hover {
    color: #f4b400;
}

.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.newsletter-form input {
    padding: 12px;
    border-radius: 4px;
    border: none;
}

.social-icons a {
    display: inline-flex; /* Changed from inline-block */
    align-items: center; /* Added */
    justify-content: center; /* Added */
    background: #333;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    margin-right: 10px;
    text-decoration: none;
    font-size: 1rem; /* Slightly larger for FA icons */
    transition: background 0.3s;
}

/* Make them turn Solar Yellow on hover */
.social-icons a:hover {
    background: #f4b400;
}

.footer-bottom {
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    border-top: 1px solid #333;
    font-size: 0.9rem;
    color: #777;
}


/* --- MOBILE OVERRIDES --- */
@media (max-width: 768px) {
    .hero-grid {
        flex-direction: column;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .stats-bar {
        flex-direction: column;
        gap: 20px;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .search-box input {
        border-right: 1px solid #ccc;
        border-radius: 5px;
    }
    
    .search-box .btn {
        border-radius: 5px;
    }
}

/* --- DIRECTORY PAGE STYLES --- */
.directory-section {
    background-color: #f4f4f9;
    padding-top: 20px; /* Shrinks the gap between the banner and the search box */

}

.directory-controls {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.search-main {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.search-main input {
    flex: 1;
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1.1rem;
}

.filter-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-group select {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background: white;
    color: #333;
    flex: 1;
    min-width: 150px;
}

.btn-text {
    color: #666;
    text-decoration: none;
    font-size: 0.9rem;
}
.btn-text:hover { text-decoration: underline; color: #002b5c; }

.btn-sm { padding: 8px 16px; font-size: 0.85rem; }

.results-count {
    margin: 15px 0;
    font-size: 0.9rem;
    color: #666;
    font-weight: bold;
}

/* The Scrolling List */
.directory-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.directory-item {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
    display: flex;
    gap: 20px;
    align-items: flex-start;
    border-left: 4px solid transparent;
    transition: all 0.2s;
}

.directory-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-left-color: #ff9800;
}

/* Premium Highlight */
.premium-highlight {
    background: #fffcf0;
    border-left-color: #f4b400;
}

.item-logo {
    flex-shrink: 0;
}

.logo-placeholder {
    width: 60px;
    height: 60px;
    background-color: #002b5c;
    color: #f4b400;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
}

.item-logo img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

.item-details {
    flex: 1;
}

.item-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 8px;
}

.item-title-row h3 {
    font-size: 1.15rem;
    color: #222;
    margin: 0;
}

.badge-premium {
    font-size: 0.75rem;
    background: #f4b400;
    color: #002b5c;
    padding: 3px 8px;
    border-radius: 20px;
    margin-left: 10px;
}

.license-badge {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
}

.item-meta {
    display: flex;
    gap: 20px;
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.item-desc {
    font-size: 0.9rem;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

.item-desc.unclaimed {
    font-style: italic;
    color: #999;
}

.item-desc.unclaimed a {
    color: #ff9800;
    font-weight: bold;
    font-style: normal;
}

.item-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 8px;
}

/* Directory Mobile Responsive */
@media (max-width: 768px) {
    .directory-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .item-title-row {
        flex-direction: column;
    }
    
    .item-meta {
        justify-content: center;
    }
    
    .item-actions {
        flex-direction: row;
        width: 100%;
        justify-content: center;
    }
    
    .filter-group {
        flex-direction: column;
    }
    
    .filter-group select {
        width: 100%;
    }
}

/* --- ADVERTISER BANNER STYLES --- */
.ad-banner-container {
    max-width: 1200px;
    margin: 15px auto 0 auto; /* 15px on top, 0px on bottom */
    padding: 0 20px;
}

.ad-banner-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    border: 1px solid #ddd;
}

/* MAGIC: If the image is missing (e.g., advertiser hasn't paid yet), 
   this shows a placeholder so your layout doesn't break */
.ad-banner-img[src]:not([src=""]) {
    background-color: transparent !important;
    border: none !important;
}

.ad-banner-img:not([src]),
.ad-banner-img[src=""] {
    /* Placeholder styles when no image is uploaded */
    background-color: #f9f9f9;
    border: 2px dashed #cbd5e1;
    color: #64748b;
    text-align: center;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px; /* Desktop height */
}

/* Mobile placeholder height adjustment */
@media (max-width: 768px) {
    .ad-banner-img:not([src]),
    .ad-banner-img[src=""] {
        min-height: 100px; /* Mobile height */
    }
}