/* Enhanced Styles for Grampanchayat Website */
:root {
    --primary-color: #2E7D32;
    --secondary-color: #FFC107;
    --dark-color: #1B5E20;
    --light-color: #E8F5E9;
}

body {
    font-family: 'Noto Sans Devanagari', 'Arial', sans-serif;
    line-height: 1.6;
    padding-top: 0;
}

/* Navbar Styles */
.navbar-brand {
    display: flex;
    align-items: center;
}

.brand-text h4 {
    color: var(--primary-color);
    margin-bottom: 0;
    font-size: 1.2rem;
}

.brand-text small {
    color: #666;
    font-size: 0.8rem;
}

.top-header {
    font-size: 0.9rem;
    background-color: var(--primary-color) !important;
}

.navbar-nav .nav-link {
    color: #333 !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--primary-color) !important;
}

/* Mobile Responsive Navbar */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background: white;
        padding: 1rem;
        border-radius: 0.5rem;
        box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.1);
        margin-top: 1rem;
        text-align: center;
    }
    
    .navbar-nav {
        text-align: center;
    }
    
    .navbar-nav .nav-item {
        margin: 0.5rem 0;
    }
    
    .navbar-toggler {
        border: none;
        padding: 0.25rem 0.5rem;
    }
    
    .navbar-toggler:focus {
        box-shadow: none;
    }
    
    .brand-text h4 {
        font-size: 1rem;
    }
}

/* Hero Slider */
.hero-slider .carousel-item {
    height: 500px;
}

.hero-slider .carousel-item img {
    object-fit: cover;
    height: 100%;
}

.hero-slider .carousel-caption {
    background: rgba(0,0,0,0.6);
    border-radius: 10px;
    padding: 20px;
    bottom: 50%;
    transform: translateY(50%);
}

.hero-slider .carousel-caption h2 {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

/* Mobile Hero Slider */
@media (max-width: 768px) {
    .hero-slider .carousel-item {
        height: 400px;
    }
    
    .hero-slider .carousel-caption {
        padding: 15px;
        bottom: 20px;
        transform: none;
    }
    
    .hero-slider .carousel-caption h2 {
        font-size: 1.5rem;
    }
    
    .hero-slider .carousel-caption p {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
    
    .hero-slider .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

/* Info Cards */
.info-card {
    padding: 20px;
    text-align: center;
    transition: transform 0.3s ease;
}

.info-card:hover {
    transform: translateY(-5px);
}

.info-card i {
    margin-bottom: 15px;
    color: var(--primary-color);
}

.info-card h3 {
    color: var(--primary-color);
    font-weight: bold;
    font-size: 2rem;
    margin: 1rem 0;
}

.info-card p {
    color: #666;
    font-weight: 500;
}

/* Section Styles */
.section-title {
    color: var(--primary-color);
    position: relative;
    padding-bottom: 15px;
    text-align: center;
    margin-bottom: 3rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: var(--secondary-color);
}

.section-subtitle {
    color: #666;
    text-align: center;
    margin-bottom: 2rem;
}

/* Cards */
.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.card-img-top {
    height: 200px;
    object-fit: cover;
}

/* Buttons */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--dark-color);
    border-color: var(--dark-color);
    transform: translateY(-2px);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Footer */
footer {
    margin-top: auto;
}

footer a:hover {
    color: var(--secondary-color) !important;
}

.social-links a {
    transition: transform 0.3s ease;
}

.social-links a:hover {
    transform: translateY(-3px);
}

/* Utility Classes */
.bg-light-custom {
    background-color: var(--light-color) !important;
}

.text-primary-custom {
    color: var(--primary-color) !important;
}

/* Responsive Utilities */
@media (max-width: 576px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .info-card {
        margin-bottom: 1rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}


/* Enhanced Mobile Dropdown Styles */
@media (max-width: 991.98px) {
    /* Fix dropdowns in mobile navbar */
    .navbar-nav .dropdown-menu {
        position: static !important;
        transform: none !important;
        border: none !important;
        background: transparent !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
        float: none !important;
    }
    
    .dropdown-toggle::after {
        float: right;
        margin-top: 0.5rem;
        transition: transform 0.3s ease;
    }
    
    .dropdown-toggle[aria-expanded="true"]::after {
        transform: rotate(180deg);
    }
    
    .dropdown-item {
        padding: 0.75rem 1.5rem !important;
        color: #333 !important;
        border-left: 3px solid transparent;
        transition: all 0.3s ease;
        background: transparent !important;
    }
    
    .dropdown-item:hover,
    .dropdown-item:focus {
        background: transparent !important;
        color: var(--primary-color) !important;
        border-left: 3px solid var(--primary-color);
    }
    
    /* Make dropdown items look like nested menu items */
    .dropdown-menu .dropdown-item {
        padding-left: 2.5rem !important;
        font-size: 0.95rem;
    }
    
    /* Remove the dropdown background and border */
    .dropdown-menu {
        background: transparent !important;
        border: none !important;
    }
}

/* Alternative Mobile Dropdown Solution */
/* If the above doesn't work perfectly, use this more robust solution */

.mobile-dropdown-fix .dropdown-menu {
    display: none;
    opacity: 0;
    transition: all 0.3s ease;
}

.mobile-dropdown-fix .dropdown-menu.show {
    display: block;
    opacity: 1;
}

@media (max-width: 991.98px) {
    .mobile-dropdown-fix .dropdown-menu {
        position: static !important;
        transform: none !important;
        float: none !important;
        width: 100%;
        margin-top: 0.5rem;
    }
}