:root {
    --primary: #4b6cb7;
    --primary-gradient: linear-gradient(to right, #4b6cb7, #182848);
    --secondary: #f8f9fa;
    --accent: #e74c3c;
    --text-dark: #2c3e50;
    --text-light: #ffffff;
    --border: #dee2e6;
    --shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    --container-width: 1200px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f7f6;
    color: var(--text-dark);
    line-height: 1.6;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1rem;
}

/* Cografya Hocasi Style Header */
header {
    background: white;
    border-bottom: 3px solid var(--primary);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.top-bar {
    background: var(--primary-gradient);
    color: white;
    padding: 0.5rem 0;
    font-size: 0.85rem;
}

.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.main-nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo a {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo span {
    color: var(--text-dark);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    transition: 0.3s;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
}

/* Dropdown Menu Styles */
.nav-links li {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-top: 3px solid var(--primary);
    list-style: none;
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: 0.3s;
    z-index: 1100;
}

.nav-links li:hover>.dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    width: 100%;
}

.dropdown-menu a {
    display: block;
    padding: 0.8rem 1.2rem;
    text-transform: none;
    font-size: 0.85rem;
    border-bottom: 1px solid #eee !important;
}

.dropdown-menu a:hover {
    background: #f8f9fa;
    color: var(--primary);
    padding-left: 1.5rem;
}

/* Old Header Search */
.search-container {
    display: none;
    /* Hidden requested by user context implies focusing on Hero search */
}

/* Hero Section & Search */
.hero {
    background: white;
    padding: 4rem 0;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
}

.hero-text h1 {
    font-size: 2.8rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-text p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 2rem;
}

.hero-image img {
    width: 100%;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

/* New Hero Search Bar */
.hero-search-wrapper {
    margin-top: 2rem;
    width: 100%;
    max-width: 600px;
}

.hero-search-box {
    display: flex;
    background: white;
    border: 2px solid var(--primary);
    border-radius: 50px;
    padding: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.hero-search-box input {
    flex: 1;
    border: none;
    padding: 15px 20px;
    font-size: 1rem;
    outline: none;
    border-radius: 50px 0 0 50px;
}

.hero-search-box button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0 30px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: 0.3s;
}

.hero-search-box button:hover {
    background: #182848;
}

/* Content Layout (Main + Sidebar) */
.main-layout {
    display: grid;
    grid-template-columns: 8fr 4fr;
    gap: 2rem;
    margin-bottom: 4rem;
}

.content-area {
    min-width: 0;
    /* Critical for overflow-x to work in grid */
}

/* Feature Cards */
.section-title {
    background: var(--primary);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 5px 5px 0 0;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0;
}

.card-container {
    background: white;
    padding: 2rem;
    border-radius: 0 0 5px 5px;
    border: 1px solid var(--border);
    border-top: none;
    margin-bottom: 2rem;
    overflow: hidden;
    /* Ensures container respects width */
}

.resource-grid {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    /* Prevents stretching */
}

.resource-grid::-webkit-scrollbar {
    height: 6px;
}

.resource-grid::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.resource-card {
    min-width: 220px;
    flex: 0 0 auto;
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    transition: 0.3s;
}

.resource-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.resource-card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.resource-info {
    padding: 1rem;
}

.resource-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.resource-info p {
    font-size: 0.9rem;
    color: #666;
}

/* Sidebar Widgets */
.sidebar-widget {
    background: white;
    margin-bottom: 2rem;
    border-radius: 5px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.widget-title {
    background: #f8f9fa;
    padding: 1rem;
    border-bottom: 2px solid var(--primary);
    font-weight: 700;
    color: var(--primary);
}

.widget-content {
    padding: 1rem;
}

.widget-list {
    list-style: none;
}

.widget-list li {
    padding: 0.5rem 0;
    border-bottom: 1px dashed var(--border);
}

.widget-list a {
    text-decoration: none;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.widget-list a:hover {
    color: var(--accent);
}

/* News List */
.news-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.news-item img {
    width: 120px;
    height: 80px;
    border-radius: 5px;
    object-fit: cover;
}

.news-item-content h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

/* Footer */
footer {
    background: #2c3e50;
    color: white;
    padding: 4rem 0 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-logo {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.footer-logo span {
    color: #4b6cb7;
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Buttons */
.btn-download {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.9rem;
    margin-top: 1rem;
}

.btn-download:hover {
    background: var(--accent);
}

/* Responsive */
@media (max-width: 992px) {
    .main-layout {
        grid-template-columns: 1fr;
    }

    .hero-grid {
        grid-template-columns: 1fr;
    }

    .hero-search-wrapper {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
}