:root {
    --primary-color: #FF6B6B;
    --secondary-color: #4ECDC4;
    --accent-color: #FFD93D;
    --gov-blue: #2c3e50;
    --bg-color: #F8FAFC;
    /* Dinamik balandlik: Mobil uchun 120px, Desktop uchun 160px */
    --header-height: clamp(120px, 15vh, 160px); 
    --footer-height: 50px;
}

body {
    margin: 0;
    font-family: 'Nunito', sans-serif;
    /* Kontent header ostida qolib ketmasligi uchun dinamik padding */
    padding-top: calc(var(--header-height) + 20px);
    background-color: var(--bg-color);
    padding-bottom: calc(var(--footer-height) + 40px);
    overflow-x: hidden;
    background-image: url('../images/pattern.png');
    background-position: center;
    background-attachment: fixed; /* Scroll qilganda fon qotib turishi uchun professional yechim */
}

/* --- Header & Navigation --- */
.fixed-top {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-height);
    background: white;
    box-shadow: 0 4px 25px rgba(0,0,0,0.06);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 5px solid var(--secondary-color);
    background-image: url('../images/bg-1.png');
    background-position: center;
    background-size: cover;
}

.gov-container {
    width: 92%;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px; /* Elementlar orasidagi masofa */
}

.gerb-img { 
    height: clamp(50px, 8vw, 75px); /* Ekran o'zgarishiga qarab rasm o'lchami o'zgaradi */
    width: auto; 
    transition: transform 0.3s ease;
}

.section-title {
    font-family: 'Fredoka', cursive;
    margin: 0;
    /* Font o'lchami ekranga qarab 1.1rem va 1.8rem orasida o'ynaydi */
    font-size: clamp(1.1rem, 4vw, 1.8rem);
    color: #4168dc;
    text-shadow: 1px 1px 0px rgba(0,0,0,0.05);
    text-align: center;
    line-height: 1.2;
}

/* --- Grid Tizimi (Auto-Responsive) --- */
.content-wrapper { 
    padding: 20px 4%; 
    max-width: 96%;
    margin: 0 auto;
}

.topics-grid {
    display: grid;
    /* Desktopda qat'iy 7 ta ustun */
    grid-template-columns: repeat(7, 1fr); 
    gap: clamp(1px, 2vw, 15px);
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
}

.topic-card {
    background: white;
    border-radius: 25px;
    padding: 10px 25px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 8px 20px rgba(0,0,0,0.05);
    cursor: pointer;
    border: 4px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1.1; /* Kartochkalar deyarli kvadrat shaklda chiroyli turadi */
    margin-top: 0px !important;
}

.topic-card:hover {
    transform: translateY(-8px);
    border-color: var(--secondary-color);
    box-shadow: 0 15px 25px rgba(78, 205, 196, 0.2);
}

/* Mobil qurilmalar uchun bosish effekti */
.topic-card:active {
    transform: scale(0.95);
}

.image-wrapper {
    width: 60%;
    aspect-ratio: 1 / 1;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.topic-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.topic-card h3 {
    margin: 0;
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    font-weight: 700;
    color: #444;
    line-height: 1.2;
}

/* --- Footer --- */
.fixed-bottom {
    position: fixed;
    bottom: 0;
    width: 100%;
    height: var(--footer-height);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px); /* Shaffof va blur effektli zamonaviy footer */
    display: flex;
    justify-content: center;
    align-items: center;
    border-top: 1px solid #eee;
    font-size: 0.85rem;
    color: #888;
    z-index: 1000;
}

/* --- Media Queries (Faqat zaruriy tuzatishlar uchun) --- */
@media (max-width: 600px) {
    .topics-grid {
        /* Mobilda 2 ta ustun sig'ishi uchun */
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .content-wrapper {
        padding: 10px 15px;
    }

    .gov-container {
        width: 95%;
    }
}