/**
 * ZAHIRA THEME - Modern Village Website Theme
 * Based on Desa Balumbung design
 */

/* ============================================
   RESET & BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-blue: #1e40af;
    --dark-blue: #0f172a;
    --light-blue: #3b82f6;
    --accent-green: #10b981;
    --white: #ffffff;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-600: #4b5563;
    --gray-800: #1f2937;
    --yellow: #fbbf24;
    --max-width: 1320px;
    --sidebar-width: 280px;
    --header-height: 60px;
}

body.zahira-theme {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-100);
    color: var(--gray-800);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ============================================
   CONTAINER
   ============================================ */
.container-max {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   HEADER / TOP BAR
   ============================================ */
.top-header {
    background: var(--dark-blue);
    padding: 8px 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--header-height);
    display: flex;
    align-items: center;
}

.top-header .container-max {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    position: relative;
}

/* Site Name for Mobile */
.site-name-mobile {
    display: none;
    color: var(--white);
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 15px;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Hide menu navigation on mobile - show only hamburger */
@media (max-width: 991.98px) {
    .top-nav {
        display: none !important;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--dark-blue);
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        max-height: calc(100vh - var(--header-height));
        overflow-y: auto;
        z-index: 999;
    }
    
    .top-nav.active {
        display: flex !important;
    }
    
    .top-nav a {
        width: 100%;
        padding: 12px 15px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    /* Mobile dropdown menu styling */
    .nav-dropdown {
        width: 100%;
        position: relative;
    }
    
    .nav-dropdown .dropdown-menu {
        position: static;
        display: none;
        box-shadow: none;
        background: rgba(0,0,0,0.2);
        margin-top: 5px;
        border-radius: 8px;
        padding: 10px 0;
    }
    
    .nav-dropdown.dropdown-open .dropdown-menu {
        display: block;
    }
    
    .nav-dropdown .dropdown-menu a {
        padding: 10px 25px;
        font-size: 13px;
        color: rgba(255,255,255,0.9);
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }
    
    .nav-dropdown .dropdown-menu a:hover {
        background: rgba(255,255,255,0.1);
        color: var(--white);
    }
    
    .nav-dropdown .dropdown-menu a i {
        width: 20px;
        text-align: center;
    }
    
    .nav-link-dropdown .fa-chevron-down {
        margin-left: auto;
        transition: transform 0.3s;
    }
    
    .nav-dropdown.dropdown-open .nav-link-dropdown .fa-chevron-down {
        transform: rotate(180deg);
    }
    
    .top-nav-right {
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
    }
    
    .site-name-mobile {
        display: block;
    }
    
    /* Show mobile menu button */
    .mobile-menu-btn {
        display: flex;
    }
}

/* Desktop: Show full menu, hide mobile elements */
@media (min-width: 992px) {
    .top-nav {
        display: flex !important;
    }
    
    .site-name-mobile {
        display: none;
    }
    
    .mobile-menu-btn {
        display: none;
    }
    
    .top-nav-right {
        position: relative;
        right: auto;
        top: auto;
        transform: none;
    }
}

/* Top nav - hidden on mobile by default, shown on desktop */
.top-nav {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.top-nav-right {
    position: relative;
}

.top-nav a {
    color: var(--white);
    text-decoration: none;
    font-size: 14px;
    transition: opacity 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.top-nav a:hover {
    opacity: 0.8;
}

.top-nav i {
    font-size: 14px;
}

/* Dropdown Menu Styles */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.nav-link-dropdown {
    cursor: pointer;
}

.nav-link-dropdown .fa-chevron-down {
    font-size: 10px;
    margin-left: 5px;
    transition: transform 0.3s;
}

.nav-dropdown:hover .nav-link-dropdown .fa-chevron-down {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    min-width: 220px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 8px 0;
    margin-top: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
    max-height: 400px;
    overflow-y: auto;
}

.nav-dropdown:hover .dropdown-menu,
.nav-dropdown.dropdown-open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: var(--gray-800);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s;
    white-space: nowrap;
}

.dropdown-menu a:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-blue);
}

.dropdown-menu a i {
    width: 18px;
    text-align: center;
    font-size: 14px;
    color: var(--primary-blue);
}

/* Scrollbar for dropdown */
.dropdown-menu::-webkit-scrollbar {
    width: 6px;
}

.dropdown-menu::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 8px;
}

.dropdown-menu::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}

.dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: var(--gray-600);
}

/* ============================================
   SIDEBAR LEFT (FIXED)
   ============================================ */
.sidebar-left {
    position: fixed;
    left: 0;
    top: var(--header-height);
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 900;
    padding: 20px 0;
    transition: top 0.3s ease, height 0.3s ease;
}

.sidebar-left::-webkit-scrollbar {
    width: 6px;
}

.sidebar-left::-webkit-scrollbar-track {
    background: var(--gray-100);
}

.sidebar-left::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}

.sidebar-left::-webkit-scrollbar-thumb:hover {
    background: var(--gray-600);
}

.sidebar-section {
    padding: 0 15px;
    margin-bottom: 20px;
}

.sidebar-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--gray-600);
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    padding: 0 10px;
}

.sidebar-nav {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 5px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    color: var(--gray-800);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s;
    font-size: 14px;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-blue);
}

.sidebar-nav i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

/* ============================================
   MAIN CONTENT WRAPPER
   ============================================ */
.main-content-wrapper {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero-section {
    background: linear-gradient(135deg, var(--dark-blue) 0%, var(--primary-blue) 100%);
    padding: 60px 0;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    right: -200px;
    width: 800px;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 600"><path d="M0,300 Q200,100 400,300 T800,300 L800,600 L0,600 Z" fill="rgba(59,130,246,0.1)"/></svg>') no-repeat;
    background-size: contain;
    opacity: 0.5;
}

.hero-content {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 40px;
    align-items: center;
}

.hero-card {
    background: var(--white);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
}

.hero-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

.hero-card-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 48px;
    position: relative;
    overflow: hidden;
}

.hero-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.hero-card:hover .hero-card-image img {
    transform: scale(1.05);
}

.hero-logo-text {
    font-size: 32px;
    font-weight: 900;
    letter-spacing: 3px;
    text-transform: uppercase;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
    position: relative;
    z-index: 1;
    animation: float 3s ease-in-out infinite;
}

.hero-card-image::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
    animation: pulse 3s ease-in-out infinite;
}

.hero-card-image i {
    position: relative;
    z-index: 1;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.hero-card h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--dark-blue);
    margin-bottom: 10px;
}

.hero-card p {
    font-size: 14px;
    color: var(--gray-600);
    margin-bottom: 20px;
}

.hero-main {
    color: var(--white);
}

.hero-main h1 {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-main .village-gov {
    background: rgba(255,255,255,0.1);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.hero-main .village-gov-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
}

.hero-main .btn-smart {
    background: var(--yellow);
    color: var(--dark-blue);
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    overflow: hidden;
}

.hero-main .btn-smart::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(15,23,42,0.1) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}

.hero-main .btn-smart:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(251,191,36,0.4);
}

.hero-main .btn-smart:hover::before {
    width: 300px;
    height: 300px;
}

.hero-main .btn-smart i {
    position: relative;
    z-index: 1;
    animation: rotate 3s linear infinite;
}

.hero-main .description {
    font-size: 16px;
    line-height: 1.8;
    opacity: 0.95;
    margin-top: 20px;
}

.hero-main .description p {
    margin-bottom: 10px;
}

.hero-main .description p:last-child {
    margin-bottom: 0;
}

.hero-main .description strong,
.hero-main .description b {
    font-weight: 600;
}

.hero-main .description em,
.hero-main .description i {
    font-style: italic;
}

.hero-main .description ul,
.hero-main .description ol {
    margin-left: 20px;
    margin-bottom: 10px;
}

.hero-main .description li {
    margin-bottom: 5px;
}

/* ============================================
   INFO BAR
   ============================================ */
.info-bar {
    background: var(--light-blue);
    color: var(--white);
    padding: 15px 0;
    overflow: hidden;
    position: relative;
}

.info-bar .container-max {
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-bar i {
    font-size: 18px;
    animation: pulse 2s ease-in-out infinite;
    flex-shrink: 0;
}

.info-bar-text-wrapper {
    flex: 1;
    overflow: hidden;
    position: relative;
    min-width: 0;
}

.info-bar-text {
    display: inline-block;
    white-space: nowrap;
    animation: scroll-text 25s linear infinite;
    padding-left: 100%;
    will-change: transform;
}

@keyframes scroll-text {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-100%);
    }
}

.info-bar-text:hover {
    animation-play-state: paused;
}

/* Responsive untuk mobile */
@media (max-width: 768px) {
    .info-bar-text {
        animation-duration: 20s;
    }
}

/* ============================================
   VILLAGE GREETING
   ============================================ */
.village-greeting {
    background: var(--primary-blue);
    color: var(--white);
    padding: 25px 0;
}

.greeting-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.greeting-icon {
    font-size: 32px;
    color: var(--yellow);
    animation: float 3s ease-in-out infinite;
}

.greeting-icon i {
    display: block;
}

.greeting-text {
    font-size: 16px;
    line-height: 1.6;
}

.greeting-text strong {
    font-weight: 600;
    display: block;
    margin-bottom: 8px;
    font-size: 18px;
}

.greeting-link {
    color: var(--yellow);
    text-decoration: none;
    font-weight: 600;
    margin-left: 10px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: opacity 0.3s;
}

.greeting-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* ============================================
   ARTICLES SECTION
   ============================================ */
.articles-section {
    padding: 60px 0;
    background: var(--white);
}

.section-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--dark-blue);
    margin-bottom: 40px;
    text-align: center;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

.article-card {
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid var(--gray-200);
    position: relative;
}

.article-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.article-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--light-blue) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 48px;
    position: relative;
    overflow: hidden;
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.article-card:hover .article-image img {
    transform: scale(1.1);
}

.article-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.3) 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.article-card:hover .article-image-overlay {
    opacity: 1;
}

.article-image::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
    animation: pulse 3s ease-in-out infinite;
}

.article-image i {
    position: relative;
    z-index: 1;
    transition: transform 0.3s;
    animation: float 3s ease-in-out infinite;
}

.article-card:hover .article-image i {
    transform: scale(1.2) rotate(5deg);
}

.article-content {
    padding: 25px;
}

.article-content h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--dark-blue);
    margin-bottom: 15px;
    line-height: 1.4;
}

.article-content p {
    color: var(--gray-600);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--gray-600);
    padding-top: 15px;
    border-top: 1px solid var(--gray-200);
}

/* ============================================
   STATISTICS SECTION
   ============================================ */
.stats-section {
    padding: 60px 0;
    background: var(--gray-100);
}

.stats-header {
    background: linear-gradient(135deg, #0ea5e9 0%, #10b981 100%);
    border-radius: 16px;
    padding: 20px 30px;
    margin-bottom: 40px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    position: relative;
    overflow: hidden;
}

.stats-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
    animation: rotate 15s linear infinite;
}

.stats-header h2 {
    color: var(--white);
    font-size: 32px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0;
    position: relative;
    z-index: 1;
    animation: pulse 2s ease-in-out infinite;
}

.stats-layout {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 40px;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.stats-left-column,
.stats-right-column {
    display: flex;
    flex-direction: column;
    gap: 25px;
    justify-content: center;
}

.stats-center {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.stats-center-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
}


/* Central Population Card */
.stats-circle {
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background-image:
        linear-gradient(135deg, #06b6d4 0%, #0ea5e9 100%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='150' viewBox='0 0 200 150'%3E%3Cg fill='%23ffffff' opacity='.12'%3E%3Ccircle cx='30' cy='25' r='12'/%3E%3Crect x='18' y='40' width='24' height='30' rx='12'/%3E%3Ccircle cx='80' cy='20' r='10'/%3E%3Crect x='70' y='32' width='20' height='26' rx='10'/%3E%3Ccircle cx='130' cy='30' r='14'/%3E%3Crect x='114' y='48' width='32' height='34' rx='16'/%3E%3Ccircle cx='30' cy='95' r='11'/%3E%3Crect x='18' y='110' width='24' height='28' rx='12'/%3E%3Ccircle cx='90' cy='90' r='13'/%3E%3Crect x='76' y='108' width='28' height='30' rx='14'/%3E%3Ccircle cx='150' cy='92' r='12'/%3E%3Crect x='138' y='108' width='24' height='28' rx='12'/%3E%3C/g%3E%3C/svg%3E");
    background-size: cover, 220px;
    background-repeat: no-repeat, repeat;
    background-position: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--white);
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
    padding: 40px 25px;
    border: 4px solid rgba(255,255,255,0.3);
}

.stats-circle::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
    animation: rotate 12s linear infinite;
}

.stats-circle::after {
    content: '';
    position: absolute;
    top: -100px;
    left: -100px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 4s ease-in-out infinite;
}

.populasi-icon-top {
    font-size: 64px;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
    position: relative;
    z-index: 1;
    opacity: 0.95;
}

.populasi-label {
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 15px;
    opacity: 0.95;
    position: relative;
    z-index: 1;
}

.populasi-number {
    font-size: 56px;
    font-weight: 900;
    line-height: 1;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
    animation: pulse 2s ease-in-out infinite;
}

.gender-mini-icons {
    display: flex;
    gap: 30px;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 0;
    margin-top: 0;
}

.mini-gender {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
}

.gender-icon-wrapper {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.gender-icon-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s;
}

.mini-gender:hover .gender-icon-wrapper::before {
    opacity: 1;
    animation: pulse 1.5s ease-in-out infinite;
}

.mini-gender i {
    font-size: 48px;
    position: relative;
    z-index: 1;
    animation: float 3s ease-in-out infinite;
}

.mini-gender.male .gender-icon-wrapper {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: var(--white);
    box-shadow: 0 6px 20px rgba(59,130,246,0.5);
}

.mini-gender.male i {
    animation: float 3s ease-in-out infinite, rotate 4s linear infinite;
}

.mini-gender.female .gender-icon-wrapper {
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
    color: var(--white);
    box-shadow: 0 6px 20px rgba(236,72,153,0.5);
}

.mini-gender.female i {
    animation: float 3s ease-in-out infinite, pulse 2s ease-in-out infinite;
}

.mini-label-left {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gray-800);
    text-align: right;
    min-width: 70px;
    line-height: 1.3;
}

.mini-number-right {
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
    color: var(--gray-800);
    text-align: left;
    min-width: 60px;
}

/* Side Cards */
.stat-card-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--white);
    padding: 20px 25px;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    min-height: 80px;
}

.stat-card-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59,130,246,0.1), transparent);
    transition: left 0.5s;
}

.stat-card-item:hover::before {
    left: 100%;
}

.stat-card-item:hover {
    transform: translateX(10px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.stat-icon-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 24px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    transition: transform 0.3s;
    animation: float 3s ease-in-out infinite;
}

.stat-card-item:hover .stat-icon-circle {
    transform: scale(1.15) rotate(10deg);
}

.stat-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-800);
    line-height: 1.4;
    position: relative;
    z-index: 1;
    flex: 1;
    text-align: left;
}

/* Animations */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Apply animations on scroll */
.stat-card-item[data-animate="slideInLeft"] {
    opacity: 0;
    animation: slideInLeft 0.6s ease-out forwards;
}

.stat-card-item[data-animate="slideInRight"] {
    opacity: 0;
    animation: slideInRight 0.6s ease-out forwards;
}

.stat-card-item.animate-in[data-animate="slideInLeft"] {
    animation: slideInLeft 0.6s ease-out forwards;
}

.stat-card-item.animate-in[data-animate="slideInRight"] {
    animation: slideInRight 0.6s ease-out forwards;
}

.stats-circle[data-animate="zoomIn"] {
    opacity: 0;
    animation: zoomIn 0.8s ease-out forwards, float 3s ease-in-out infinite 0.8s;
}

.stats-circle.animate-in[data-animate="zoomIn"] {
    animation: zoomIn 0.8s ease-out forwards, float 3s ease-in-out infinite 0.8s;
}

/* Delay for staggered animation */
.stats-left-column .stat-card-item:nth-child(1) {
    animation-delay: 0.1s;
}

.stats-left-column .stat-card-item:nth-child(2) {
    animation-delay: 0.2s;
}

.stats-left-column .stat-card-item:nth-child(3) {
    animation-delay: 0.3s;
}

.stats-right-column .stat-card-item:nth-child(1) {
    animation-delay: 0.4s;
}

.stats-right-column .stat-card-item:nth-child(2) {
    animation-delay: 0.5s;
}

.stats-right-column .stat-card-item:nth-child(3) {
    animation-delay: 0.6s;
}

/* Responsive */
@media (max-width: 968px) {
    .stats-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .stats-left-column,
    .stats-right-column {
        order: 2;
    }
    
    .stats-center {
        order: 1;
    }
    
    .stats-circle {
        width: 280px;
        min-height: 350px;
    }
}

/* ============================================
   OFFICIALS SECTION
   ============================================ */
.officials-section {
    padding: 60px 0;
    background: var(--white);
}

/* Officials Slider */
.officials-slider-wrapper {
    position: relative;
    margin: 30px 0;
}

.officials-slider-container {
    overflow: hidden;
    margin: 0 50px;
    position: relative;
}

.officials-slider-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    gap: 20px;
}

.official-slide {
    flex: 0 0 calc(33.333% - 14px);
    min-width: 0;
}

.official-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.official-card {
    background: var(--white);
    border-radius: 16px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 1px solid var(--gray-200);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.official-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
    border-color: var(--primary-blue);
}

.official-photo {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: var(--gray-200);
    margin: 0 auto 20px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-600);
    font-size: 56px;
    transition: all 0.3s ease;
    position: relative;
    border: 4px solid var(--white);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.official-card:hover .official-photo {
    transform: scale(1.08);
    box-shadow: 0 8px 25px rgba(59,130,246,0.4);
    border-color: var(--primary-blue);
}

.official-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.official-info {
    width: 100%;
}

.official-name {
    font-weight: 700;
    color: var(--dark-blue);
    margin-bottom: 8px;
    font-size: 16px;
    line-height: 1.4;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.official-position {
    font-size: 13px;
    color: var(--gray-600);
    font-weight: 500;
}

/* Slider Buttons */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 45px;
    height: 45px;
    background: var(--white);
    border: 2px solid var(--gray-300);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    color: var(--dark-blue);
    font-size: 18px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.slider-btn:hover:not(:disabled) {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: var(--white);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 15px rgba(59,130,246,0.3);
}

.slider-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.slider-btn-prev {
    left: 0;
}

.slider-btn-next {
    right: 0;
}

/* Slider Dots */
.slider-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 25px;
}

.slider-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--gray-300);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.slider-dot:hover {
    background: var(--gray-500);
    transform: scale(1.2);
}

.slider-dot.active {
    background: var(--primary-blue);
    width: 30px;
    border-radius: 5px;
}

/* ============================================
   SELF SERVICE SECTION
   ============================================ */
.self-service-section {
    padding: 60px 0;
    background: var(--gray-100);
}

.self-service-card {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--light-blue) 100%);
    border-radius: 16px;
    padding: 40px;
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 40px;
    align-items: center;
    color: var(--white);
}

.self-service-illustration {
    font-size: 80px;
    opacity: 0.8;
    display: flex;
    gap: 10px;
    position: relative;
}

.self-service-illustration i {
    animation: float 3s ease-in-out infinite;
    position: relative;
}

.self-service-illustration i:nth-child(1) {
    animation-delay: 0s;
}

.self-service-illustration i:nth-child(2) {
    animation-delay: 1.5s;
}

.self-service-content h3 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 15px;
}

.service-description {
    font-size: 15px;
    margin-bottom: 15px;
    opacity: 0.95;
    line-height: 1.6;
}

.service-location {
    font-size: 14px;
    margin-bottom: 25px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 8px;
}

.service-location i {
    font-size: 16px;
}

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

.btn-service {
    background: var(--yellow);
    color: var(--dark-blue);
    padding: 14px 28px;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-size: 15px;
    border: 2px solid transparent;
}

.btn-service:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.4);
}

.btn-service i {
    font-size: 16px;
}

.btn-login {
    background: var(--yellow);
    color: var(--dark-blue);
}

.btn-login:hover {
    background: var(--dark-blue);
    color: var(--yellow);
    border-color: var(--yellow);
}

.btn-register {
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.btn-register:hover {
    background: var(--white);
    color: var(--primary-blue);
    border-color: var(--white);
}

/* ============================================
   GALLERY SECTION
   ============================================ */
.gallery-section {
    padding: 60px 0;
    background: var(--white);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

.gallery-item h4 {
    font-size: 24px;
    font-weight: 600;
    color: var(--dark-blue);
    margin-bottom: 20px;
}

.gallery-preview {
    width: 100%;
    height: 300px;
    background: var(--gray-200);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-600);
    font-size: 64px;
    transition: transform 0.3s, box-shadow 0.3s, background 0.3s;
    position: relative;
    overflow: hidden;
}

.gallery-item:hover .gallery-preview {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--light-blue) 100%);
    color: var(--white);
}

.gallery-preview::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}

.gallery-item:hover .gallery-preview::before {
    opacity: 1;
    animation: pulse 2s ease-in-out infinite;
}

.gallery-preview i {
    position: relative;
    z-index: 1;
    transition: transform 0.3s;
}

.gallery-item:hover .gallery-preview i {
    transform: scale(1.2) rotate(10deg);
    animation: bounce 1s ease-in-out;
}

/* ============================================
   BUDGET TRANSPARENCY
   ============================================ */
.budget-section {
    padding: 60px 0;
    background: var(--gray-100);
    position: relative;
    overflow: hidden;
}

.budget-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        url("data:image/svg+xml,%3Csvg width='100' height='100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 20h60v60h-60z' fill='none' stroke='rgba(59,130,246,0.05)' stroke-width='1'/%3E%3Ccircle cx='30' cy='30' r='5' fill='rgba(59,130,246,0.08)'/%3E%3Ccircle cx='70' cy='70' r='5' fill='rgba(59,130,246,0.08)'/%3E%3Cpath d='M25 25 L75 75 M75 25 L25 75' stroke='rgba(59,130,246,0.05)' stroke-width='0.5'/%3E%3C/svg%3E");
    background-size: 150px 150px;
    opacity: 0.3;
    animation: float 20s ease-in-out infinite;
    pointer-events: none;
}

.budget-section .section-title {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: center;
}

.budget-section .section-title i {
    font-size: 32px;
    color: var(--primary-blue);
    animation: pulse 2s ease-in-out infinite;
}

.budget-table {
    background: var(--white);
    border-radius: 16px;
    overflow-x: auto;
    overflow-y: visible;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1;
    transition: transform 0.3s, box-shadow 0.3s;
    opacity: 0;
    transform: translateY(30px);
    -webkit-overflow-scrolling: touch;
}

@media (min-width: 992px) {
    .budget-table {
        overflow-x: visible;
    }
}

.budget-table.animate-in {
    opacity: 1;
    transform: translateY(0);
    animation: slideInUp 0.6s ease-out forwards;
}

.budget-table:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(0,0,0,0.15);
}

.budget-table table {
    width: 100%;
    border-collapse: collapse;
    min-width: 100%;
}

.budget-table th {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--light-blue) 100%);
    color: var(--white);
    padding: 18px 15px;
    text-align: left;
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.budget-table th::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.budget-table th i {
    margin-right: 8px;
    font-size: 16px;
    animation: float 3s ease-in-out infinite;
}

.budget-table td {
    padding: 18px 15px;
    border-bottom: 1px solid var(--gray-200);
    transition: background-color 0.3s;
}

.budget-table tr:last-child td {
    border-bottom: none;
}

.budget-row {
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.3s;
}

.budget-row.animate-in {
    opacity: 1;
    transform: translateX(0);
    animation: slideInLeft 0.5s ease-out forwards;
}

.budget-row:hover {
    background: rgba(59,130,246,0.05);
    transform: translateX(5px);
}

.budget-row:hover td {
    color: var(--primary-blue);
}

.budget-row td i {
    margin-right: 8px;
    color: var(--primary-blue);
    font-size: 14px;
    transition: transform 0.3s;
}

.budget-row:hover td i {
    transform: scale(1.2) rotate(5deg);
}

.budget-amount {
    font-weight: 600;
    color: var(--gray-800);
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
}

.percentage-container {
    width: 100%;
    height: 30px;
    background: var(--gray-200);
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.percentage-bar {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    width: 0%;
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(16,185,129,0.3);
}

.percentage-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: progressShine 2s infinite;
}

.percentage-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, rgba(255,255,255,0.1) 0%, transparent 50%);
    border-radius: 15px;
    animation: progressGlow 2s ease-in-out infinite;
}

@keyframes progressShine {
    0% { left: -100%; }
    100% { left: 100%; }
}

@keyframes progressGlow {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.percentage-bar.animated {
    animation: progressBarPulse 1s ease-out;
}

@keyframes progressBarPulse {
    0% {
        transform: scaleX(0);
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: scaleX(1);
    }
}

.percentage-text {
    color: var(--white);
    font-weight: 700;
    font-size: 12px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    position: relative;
    z-index: 1;
}

/* Budget Chart Container Styles */
.budget-chart-container {
    background: var(--white);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.budget-chart-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #10b981, #3b82f6, #ef4444, #8b5cf6, #f59e0b);
    background-size: 200% 100%;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.budget-chart-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(0,0,0,0.15);
}

.budget-chart-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--gray-200);
}

.budget-chart-header h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark-blue);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.budget-chart-header h3 i {
    color: var(--primary-blue);
    animation: pulse 2s ease-in-out infinite;
}

.budget-chart-subtitle {
    color: var(--gray-600);
    font-size: 14px;
    margin: 0;
}

.budget-chart-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.budget-chart-left {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.budget-chart-left canvas {
    max-width: 100%;
    height: auto !important;
}

.budget-chart-right {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.budget-legend {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.budget-legend-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
    background: var(--gray-100);
    border-radius: 12px;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.budget-legend-item:hover {
    background: var(--white);
    border-left-color: var(--primary-blue);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 2px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    animation: colorPulse 2s ease-in-out infinite;
}

@keyframes colorPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.9; }
}

.legend-content {
    flex: 1;
}

.legend-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 16px;
    color: var(--dark-blue);
}

.legend-header i {
    color: var(--primary-blue);
    font-size: 14px;
}

.legend-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.legend-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--gray-600);
}

.legend-row strong {
    color: var(--dark-blue);
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.percentage-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    min-width: 50px;
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   MAPS SECTION
   ============================================ */
.maps-section {
    padding: 60px 0;
    background: var(--white);
}

.maps-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

.map-item h4 {
    font-size: 20px;
    font-weight: 600;
    color: var(--dark-blue);
    margin-bottom: 20px;
}

.map-container {
    width: 100%;
    height: 300px;
    background: var(--gray-200);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-600);
    overflow: hidden;
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: var(--dark-blue);
    color: var(--white);
    padding: 40px 0 20px;
    margin-top: 60px;
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

/* Footer Responsive */
@media (max-width: 991.98px) {
    .footer {
        margin-left: 0;
        width: 100%;
    }
}

@media (max-width: 767.98px) {
    .footer {
        padding: 30px 0 15px;
    }
    
    .footer-content {
        gap: 25px;
    }
    
    .footer-section h4 {
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    .footer-bottom {
        padding-top: 15px;
        font-size: 11px;
    }
    
    .footer-bottom p {
        margin-bottom: 5px;
    }
}

.footer-section h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
}

.footer-section p,
.footer-section a {
    color: rgba(255,255,255,0.8);
    font-size: 14px;
    line-height: 1.8;
    text-decoration: none;
}

.footer-section a:hover {
    color: var(--yellow);
}

/* Footer Navigation List */
.footer-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

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

.footer-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    padding: 5px 0;
}

.footer-nav a:hover {
    color: var(--yellow);
    transform: translateX(5px);
}

.footer-nav a i {
    width: 18px;
    text-align: center;
    font-size: 14px;
    opacity: 0.8;
}

.footer-social {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.footer-social a {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.footer-social a:hover {
    background: var(--yellow);
    color: var(--dark-blue);
}

/* Footer Social Links (New Style) */
.footer-social-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.footer-social-links .social-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid rgba(255,255,255,0.1);
}

.footer-social-links .social-link:hover {
    background: rgba(255,255,255,0.1);
    transform: translateX(5px);
    border-color: rgba(255,255,255,0.2);
}

.footer-social-links .social-link i {
    width: 20px;
    text-align: center;
    font-size: 18px;
    transition: transform 0.3s ease;
}

.footer-social-links .social-link:hover i {
    transform: scale(1.2);
}

.footer-social-links .social-link span {
    font-size: 14px;
    font-weight: 500;
}

/* Social Media Brand Colors */
.footer-social-links .social-link.facebook:hover {
    background: rgba(24, 119, 242, 0.2);
    border-color: rgba(24, 119, 242, 0.4);
    color: #1877f2;
}

.footer-social-links .social-link.twitter:hover {
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(0, 0, 0, 0.4);
    color: #000000;
}

.footer-social-links .social-link.youtube:hover {
    background: rgba(255, 0, 0, 0.2);
    border-color: rgba(255, 0, 0, 0.4);
    color: #ff0000;
}

.footer-social-links .social-link.instagram:hover {
    background: linear-gradient(135deg, rgba(225, 48, 108, 0.2) 0%, rgba(245, 96, 64, 0.2) 50%, rgba(252, 175, 69, 0.2) 100%);
    border-color: rgba(225, 48, 108, 0.4);
    color: #e1306c;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 12px;
    color: rgba(255,255,255,0.6);
}

/* ============================================
   BOTTOM NAVIGATION BAR (MOBILE)
   ============================================ */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    padding: 8px 0;
    max-height: 70px;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--gray-600);
    font-size: 11px;
    padding: 6px 8px;
    min-width: 60px;
    transition: all 0.3s ease;
    flex: 1;
}

.bottom-nav-item i {
    font-size: 20px;
    margin-bottom: 4px;
    transition: all 0.3s ease;
}

.bottom-nav-item span {
    font-size: 10px;
    font-weight: 500;
    white-space: nowrap;
}

.bottom-nav-item.active {
    color: var(--accent-green);
}

.bottom-nav-item.active i {
    color: var(--accent-green);
    transform: scale(1.1);
}

.bottom-nav-item:hover {
    color: var(--primary-blue);
}

.bottom-nav-item:hover i {
    color: var(--primary-blue);
    transform: scale(1.1);
}

/* Hide bottom nav on desktop */
@media (min-width: 992px) {
    .bottom-nav {
        display: none !important;
    }
}

/* Show bottom nav on mobile */
@media (max-width: 991.98px) {
    .bottom-nav {
        display: flex;
    }
    
    /* Add padding bottom to body to prevent content from being hidden behind bottom nav */
    body.zahira-theme {
        padding-bottom: 70px;
    }
    
    .footer {
        margin-bottom: 70px;
    }
}

/* ============================================
   MOBILE MENU BUTTON (HAMBURGER)
   ============================================ */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    position: relative;
}

.mobile-menu-btn span {
    width: 100%;
    height: 3px;
    background: var(--white);
    border-radius: 3px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

/* Mobile Overlay */
.mobile-overlay {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

@media (min-width: 992px) {
    .mobile-overlay {
        display: none;
    }
}

.mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Hide nav text on mobile */
.nav-text {
    display: inline;
}

/* ============================================
   RESPONSIVE DESIGN - MOBILE FIRST
   ============================================ */

/* Extra Small Devices (phones, 320px and up) */
@media (max-width: 575.98px) {
    :root {
        --header-height: 56px;
        --sidebar-width: 280px;
    }
    
    body.zahira-theme {
        font-size: 14px;
    }
    
    .container-max {
        padding: 0 15px;
    }
    
    /* Header Mobile */
    .top-header {
        height: var(--header-height);
        padding: 0;
    }
    
    .top-header .container-max {
        padding: 0 15px;
    }
    
    .mobile-menu-btn {
        display: flex;
        flex-shrink: 0;
    }
    
    .site-name-mobile {
        display: block;
        font-size: 14px;
        margin-left: 12px;
        max-width: calc(100vw - 120px);
    }
    
    .top-nav-right {
        flex-shrink: 0;
        margin-left: auto;
    }
    
    .top-nav {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--dark-blue);
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0;
        max-height: calc(100vh - var(--header-height));
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 999;
        box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    }
    
    .top-nav.active {
        transform: translateX(0);
    }
    
    .top-nav a {
        padding: 15px 20px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        width: 100%;
        justify-content: flex-start;
        font-size: 15px;
    }
    
    .nav-text {
        display: inline;
    }
    
    .nav-dropdown {
        width: 100%;
    }
    
    .nav-link-dropdown {
        width: 100%;
        justify-content: space-between;
    }
    
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: rgba(0,0,0,0.2);
        margin: 0;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    .nav-dropdown.dropdown-open .dropdown-menu {
        max-height: 500px;
    }
    
    .dropdown-menu a {
        padding: 12px 20px 12px 40px;
        font-size: 14px;
    }
    
    .top-nav-right {
        position: static;
        transform: none;
        flex-direction: row;
        justify-content: flex-end;
        padding: 0;
        background: transparent;
        box-shadow: none;
    }
    
    /* Sidebar Mobile */
    .sidebar-left {
        width: var(--sidebar-width);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 997;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    }
    
    .sidebar-left.open {
        transform: translateX(0);
    }
    
    .main-content-wrapper {
        margin-left: 0;
        margin-top: var(--header-height);
    }
    
    /* Typography Mobile */
    h1 { font-size: 24px; }
    h2 { font-size: 20px; }
    h3 { font-size: 18px; }
    h4 { font-size: 16px; }
    
    /* Page Header Mobile */
    .page-header {
        padding: 30px 0;
        margin-top: var(--header-height);
    }
    
    .page-header h1 {
        font-size: 24px;
    }
    
    .page-header p {
        font-size: 14px;
    }
    
    /* Hero Section Mobile */
    .hero-section {
        padding: 30px 0;
        margin-top: var(--header-height);
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .hero-main h1 {
        font-size: 24px;
        margin-bottom: 15px;
    }
    
    .hero-main .village-gov {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .hero-main .village-gov-title {
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    .hero-main .btn-smart {
        padding: 10px 20px;
        font-size: 13px;
        width: 100%;
        justify-content: center;
    }
    
    .hero-main .description {
        font-size: 14px;
        margin-top: 15px;
    }
    
    .hero-card {
        text-align: center;
    }
    
    .hero-card h2 {
        font-size: 18px;
    }
    
    .hero-card p {
        font-size: 13px;
    }
    
    /* Village Greeting Mobile */
    .village-greeting {
        padding: 20px 0;
        margin: 0;
    }
    
    .greeting-content {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .greeting-icon {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    
    .greeting-text {
        font-size: 14px;
    }
    
    .greeting-text strong {
        font-size: 15px;
        display: block;
        margin-bottom: 8px;
    }
    
    /* Info Bar Mobile */
    .info-bar {
        padding: 12px 0;
        font-size: 13px;
    }
    
    /* Articles Section Mobile */
    .articles-section {
        padding: 30px 0;
    }
    
    .section-title {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    .article-card {
        margin-bottom: 20px;
    }
    
    .article-content h3 {
        font-size: 16px;
        margin-bottom: 10px;
    }
    
    .article-content p {
        font-size: 13px;
        margin-bottom: 12px;
    }
    
    .article-meta {
        font-size: 12px;
    }
    
    /* Stats Section Mobile */
    .stats-section {
        padding: 30px 0;
    }
    
    .stats-header h2 {
        font-size: 20px;
        margin-bottom: 25px;
    }
    
    .stats-layout {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .stats-left-column,
    .stats-right-column {
        order: 2;
        display: flex;
        flex-direction: column;
        gap: 15px;
    }
    
    .stats-center {
        order: 1;
        margin-bottom: 20px;
    }
    
    .stats-center-wrapper {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }
    
    .stats-circle {
        width: 180px;
        height: 180px;
        min-width: 180px;
        min-height: 180px;
    }
    
    .populasi-icon-top {
        font-size: 32px;
    }
    
    .populasi-label {
        font-size: 12px;
    }
    
    .populasi-number {
        font-size: 28px;
    }
    
    .gender-mini-icons {
        flex-direction: row;
        gap: 20px;
        justify-content: center;
        width: 100%;
    }
    
    .mini-gender {
        flex-direction: column;
        gap: 8px;
        align-items: center;
        padding: 12px;
        min-width: 100px;
    }
    
    .mini-label-left {
        font-size: 10px;
        min-width: auto;
        text-align: center;
    }
    
    .mini-number-right {
        font-size: 22px;
        min-width: auto;
        text-align: center;
    }
    
    .gender-icon-wrapper {
        width: 50px;
        height: 50px;
    }
    
    .stat-card-item {
        padding: 15px;
        min-height: 70px;
        flex-direction: row;
        gap: 12px;
    }
    
    .stat-icon-circle {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .stat-text {
        font-size: 13px;
    }
    
    /* Budget Section Mobile */
    .budget-section {
        padding: 30px 0;
        overflow-x: hidden;
    }
    
    .budget-section .container-max {
        padding: 0 15px;
    }
    
    .budget-section .section-title {
        font-size: 20px;
        margin-bottom: 25px;
    }
    
    .budget-section .section-title i {
        font-size: 24px;
    }
    
    .budget-chart-container {
        padding: 20px 15px;
        margin-bottom: 25px;
        border-radius: 16px;
    }
    
    .budget-chart-header {
        margin-bottom: 20px;
        padding-bottom: 15px;
    }
    
    .budget-chart-header h3 {
        font-size: 18px;
        flex-direction: column;
        gap: 8px;
    }
    
    .budget-chart-subtitle {
        font-size: 12px;
    }
    
    .budget-chart-wrapper {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .budget-chart-left {
        order: 2;
        max-width: 100%;
    }
    
    .budget-chart-left canvas {
        max-width: 280px !important;
        max-height: 280px !important;
        margin: 0 auto;
        width: 100% !important;
        height: auto !important;
    }
    
    .budget-chart-right {
        order: 1;
    }
    
    .budget-legend {
        gap: 12px;
    }
    
    .budget-legend-item {
        padding: 12px;
        gap: 12px;
    }
    
    .legend-color {
        width: 16px;
        height: 16px;
    }
    
    .legend-header {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .legend-details {
        gap: 5px;
    }
    
    .legend-row {
        font-size: 12px;
        flex-wrap: wrap;
    }
    
    .legend-row strong {
        font-size: 11px;
        word-break: break-all;
    }
    
    .percentage-badge {
        font-size: 11px;
        padding: 3px 8px;
        min-width: 45px;
    }
    
    /* Self Service Mobile */
    .self-service-section {
        padding: 30px 0;
    }
    
    .self-service-card {
        padding: 20px;
        flex-direction: column;
        text-align: center;
    }
    
    .self-service-card h3 {
        font-size: 18px;
        margin-bottom: 10px;
    }
    
    .self-service-card p {
        font-size: 13px;
        margin-bottom: 15px;
    }
    
    .btn-service {
        width: 100%;
        padding: 12px;
        font-size: 14px;
    }
    
    /* Gallery Section Mobile */
    .gallery-section {
        padding: 30px 0;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .gallery-item {
        padding: 20px;
    }
    
    .gallery-item h4 {
        font-size: 16px;
    }
    
    /* Cards Mobile */
    .article-card,
    .stat-card-item,
    .official-card {
        min-width: 0;
        width: 100%;
    }
    
    /* Grid Mobile */
    .articles-grid,
    .stats-container {
        grid-template-columns: 1fr;
    }
    
    .footer {
        margin-left: 0;
        width: 100%;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .footer-section {
        margin-bottom: 25px;
    }
    
    .footer-section h4 {
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    .footer-social-links {
        gap: 10px;
    }
    
    .footer-social-links .social-link {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .footer-social-links .social-link i {
        font-size: 16px;
        width: 18px;
    }
    
    .footer-social-links .social-link span {
        font-size: 13px;
    }
    
    /* Tables Mobile */
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }
    
    /* Buttons Mobile */
    .btn-ajukan,
    button[type="submit"],
    .btn {
        padding: 12px 20px;
        font-size: 14px;
        width: 100%;
        max-width: 100%;
    }
    
    /* Forms Mobile */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    select,
    textarea {
        width: 100%;
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px;
    }
    
    /* Stats Circle Mobile */
    .stats-circle {
        width: 100%;
        max-width: 280px;
        margin: 0 auto;
    }
    
    /* Officials Slider Mobile */
    .officials-slider-container {
        margin: 0 40px;
    }
    
    .official-slide {
        flex: 0 0 100%;
    }
    
    .slider-btn {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
    
    .official-card {
        padding: 20px;
    }
    
    .official-photo {
        width: 120px;
        height: 120px;
        font-size: 48px;
    }
    
    .official-name {
        font-size: 15px;
        min-height: auto;
    }
    
    .official-position {
        font-size: 12px;
    }
    
    .service-buttons {
        flex-direction: column;
    }
    
    .btn-service {
        width: 100%;
        justify-content: center;
    }
    
    /* Legacy - Officials Scroll Mobile */
    .officials-container {
        -webkit-overflow-scrolling: touch;
    }
    
    .official-card {
        min-width: 180px;
    }
}

/* Small Devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    :root {
        --header-height: 58px;
    }
    
    .container-max {
        padding: 0 20px;
    }
    
    .mobile-menu-btn {
        display: flex;
        flex-shrink: 0;
    }
    
    .site-name-mobile {
        display: block;
        font-size: 15px;
        margin-left: 15px;
    }
    
    .top-nav-right {
        flex-shrink: 0;
        margin-left: auto;
    }
    
    .top-nav {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--dark-blue);
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0;
        max-height: calc(100vh - var(--header-height));
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 999;
        box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    }
    
    .top-nav.active {
        transform: translateX(0);
    }
    
    .top-nav a {
        padding: 15px 20px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        width: 100%;
        justify-content: flex-start;
    }
    
    .nav-dropdown {
        width: 100%;
    }
    
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: rgba(0,0,0,0.2);
        margin: 0;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    .nav-dropdown.dropdown-open .dropdown-menu {
        max-height: 500px;
    }
    
    .dropdown-menu a {
        padding: 12px 20px 12px 40px;
    }
    
    .top-nav-right {
        position: static;
        transform: none;
        flex-direction: row;
        justify-content: flex-end;
        padding: 0;
        background: transparent;
        box-shadow: none;
    }
    
    .sidebar-left {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar-left.open {
        transform: translateX(0);
    }
    
    .main-content-wrapper {
        margin-left: 0;
    }
    
    .footer {
        margin-left: 0;
        width: 100%;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
    }
    
    .articles-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    
    .stats-container {
        grid-template-columns: 1fr;
    }
    
    /* Stats Section Small Mobile */
    .stats-layout {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .stats-left-column,
    .stats-right-column {
        order: 2;
        display: flex;
        flex-direction: column;
        gap: 15px;
    }
    
    .stats-center {
        order: 1;
        margin-bottom: 20px;
    }
    
    .stats-circle {
        width: 200px;
        height: 200px;
    }
    
    .stat-card-item {
        padding: 15px;
    }
    
    /* Budget Section Small Mobile */
    .budget-table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-left: -20px;
        margin-right: -20px;
        padding: 0 20px;
        width: calc(100% + 40px);
    }
    
    .budget-table table {
        min-width: 700px;
        font-size: 12px;
    }
    
    .budget-table th {
        padding: 12px 10px;
        font-size: 11px;
        min-width: 120px;
    }
    
    .budget-table th:first-child {
        min-width: 180px;
    }
    
    .budget-table td {
        padding: 12px 10px;
        font-size: 11px;
    }
    
    .budget-table td:first-child {
        max-width: 200px;
        word-wrap: break-word;
        white-space: normal;
    }
    
    .budget-amount {
        font-size: 10px;
    }
}

/* Medium Devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .mobile-menu-btn {
        display: flex;
    }
    
    .top-nav {
        gap: 10px;
    }
    
    .top-nav a {
        font-size: 13px;
    }
    
    .nav-text {
        display: none;
    }
    
    .nav-link-main i,
    .nav-link-dropdown i:first-child {
        margin-right: 0;
    }
    
    .sidebar-left {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar-left.open {
        transform: translateX(0);
    }
    
    .main-content-wrapper {
        margin-left: 0;
    }
    
    .footer {
        margin-left: 0;
        width: 100%;
    }
    
    .official-slide {
        flex: 0 0 calc(50% - 10px);
    }
    
    .hero-content {
        grid-template-columns: 200px 1fr;
    }
    
    .articles-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

/* Large Devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .top-nav {
        gap: 12px;
    }
    
    .top-nav a {
        font-size: 13px;
    }
    
    .nav-text {
        display: inline;
    }
    
    .hero-content {
        grid-template-columns: 250px 1fr;
    }
    
    .articles-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

/* Extra Large Devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .top-nav {
        gap: 15px;
    }
    
    .nav-text {
        display: inline;
    }
}

/* Landscape Orientation Mobile */
@media (max-width: 991.98px) and (orientation: landscape) {
    .top-nav {
        max-height: calc(100vh - var(--header-height));
    }
    
    .sidebar-left {
        max-height: 100vh;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .top-nav a,
    .sidebar-nav a,
    .dropdown-menu a,
    button,
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Remove hover effects on touch devices */
    .nav-dropdown:hover .dropdown-menu {
        opacity: 0;
        visibility: hidden;
    }
    
    /* Better scrolling */
    * {
        -webkit-overflow-scrolling: touch;
    }
}

/* Prevent horizontal scroll on all devices */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
    width: 100%;
}

* {
    max-width: 100%;
    box-sizing: border-box;
}

img, video, iframe, embed, object {
    max-width: 100%;
    height: auto;
}

/* Ensure all containers don't overflow */
.container-max,
.container,
.wrapper,
.main-content-wrapper {
    max-width: 100%;
    overflow-x: hidden;
}

/* Fix for tables and wide content */
table {
    width: 100%;
    table-layout: auto;
}

@media (max-width: 767.98px) {
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }
    
    /* Prevent text overflow */
    p, span, div, h1, h2, h3, h4, h5, h6 {
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
    
    /* Fix for pre and code blocks */
    pre, code {
        white-space: pre-wrap;
        word-wrap: break-word;
        max-width: 100%;
        overflow-x: auto;
    }
}

/* Android-like Card Design for Mobile */
@media (max-width: 767.98px) {
    .article-card,
    .stat-card-item,
    .official-card,
    .info-box,
    .error-box {
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        margin-bottom: 16px;
    }
    
    /* Material Design-like elevation */
    .article-card:active,
    .stat-card-item:active {
        transform: scale(0.98);
        box-shadow: 0 1px 4px rgba(0,0,0,0.15);
    }
}

