/* ============================================
   LGU Buug Portal - Modern Mobile-First Design
   ============================================ */

:root {
    --primary: #1a5f7a;
    --primary-dark: #134b61;
    --secondary: #57c5b6;
    --accent: #159895;
    --light: #f8f9fa;
    --dark: #212529;
    --gray: #6c757d;
    --white: #ffffff;
    --shadow: 0 4px 15px rgba(0,0,0,0.1);
    --shadow-hover: 0 8px 25px rgba(0,0,0,0.15);
    --radius: 12px;
    --radius-sm: 8px;
}

/* ============================================
   Hero Section with Search
   ============================================ */
.hero-section {
    position: relative;
    height: 50vh;
    min-height: 300px;
    max-height: 500px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(26, 95, 122, 0.85) 0%, rgba(21, 152, 149, 0.75) 100%);
    z-index: 2;
}

.hero-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.hero-slider .slider-image {
    display: none;
    animation: fade 1.5s;
}

.hero-slider .slider-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    padding: 1.5rem 1.5rem 2rem;
    max-width: 600px;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    margin: 0 1rem;
}

/* Hero Hotlines */
.hero-hotlines {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

.hotline-wrapper {
    position: relative;
}

.hotline-item {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0.6rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: var(--white);
    border-radius: 20px;
    font-size: 0.7rem;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    border: none;
    cursor: pointer;
}

.hotline-item i {
    font-size: 0.8rem;
}

.hotline-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 95, 122, 0.35);
    color: var(--white);
    text-decoration: none;
}

/* Hotline Popup */
.hotline-popup {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    min-width: 260px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 100;
    text-align: left;
    overflow: hidden;
}

.hotline-popup::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid var(--primary);
}

.hotline-wrapper:hover .hotline-popup,
.hotline-wrapper.active .hotline-popup {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) scale(1);
}

.popup-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: var(--white);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.popup-header i {
    font-size: 1.25rem;
}

.popup-header h4 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
}

.popup-body {
    padding: 0.75rem 1rem;
}

.popup-body p {
    margin: 0 0 0.5rem;
    font-size: 0.8rem;
    color: var(--dark);
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.popup-body p:last-child {
    margin-bottom: 0;
}

.popup-body p i {
    color: var(--primary);
    font-size: 0.9rem;
    width: 16px;
    flex-shrink: 0;
    margin-top: 2px;
}

.popup-body p a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.popup-body p a:hover {
    text-decoration: underline;
}

.popup-footer {
    display: flex;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.popup-link {
    flex: 1;
    padding: 0.6rem;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--primary);
    text-decoration: none;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
}

.popup-link:hover {
    background: var(--light);
    text-decoration: none;
}

.popup-link.primary {
    background: var(--primary);
    color: var(--white);
}

.popup-link.primary:hover {
    background: var(--primary-dark);
}

.popup-link i {
    font-size: 0.9rem;
}

.hero-content h1 {
    color: var(--primary);
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: none;
}

.hero-content > p {
    color: var(--gray);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.hero-search {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
    min-width: 0;
}

.hero-search input {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid #e9ecef;
    border-radius: var(--radius);
    font-size: 1rem;
    box-shadow: var(--shadow);
    height: 54px;
    box-sizing: border-box;
}

.hero-search input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Search Suggestions Dropdown */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 100;
}

.search-suggestions.active {
    max-height: 400px;
    overflow-y: auto;
    opacity: 1;
    visibility: visible;
    border: 2px solid var(--primary);
    border-top: none;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--dark);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item.selected {
    background: linear-gradient(135deg, rgba(26, 95, 122, 0.08) 0%, rgba(21, 152, 149, 0.08) 100%);
    text-decoration: none;
}

.suggestion-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.suggestion-icon i {
    color: var(--white);
    font-size: 1rem;
}

.suggestion-content {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.suggestion-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suggestion-title mark {
    background: rgba(87, 197, 182, 0.3);
    color: var(--primary);
    padding: 0 2px;
    border-radius: 2px;
}

.suggestion-dept {
    font-size: 0.75rem;
    color: var(--gray);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 2px;
}

.suggestion-dept i {
    font-size: 0.7rem;
}

.suggestion-arrow {
    color: var(--gray);
    font-size: 1rem;
    opacity: 0;
    transform: translateX(-5px);
    transition: all 0.2s ease;
}

.suggestion-item:hover .suggestion-arrow,
.suggestion-item.selected .suggestion-arrow {
    opacity: 1;
    transform: translateX(0);
    color: var(--primary);
}

.suggestion-empty {
    padding: 1.5rem 1rem;
    text-align: center;
    color: var(--gray);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.suggestion-empty i {
    font-size: 2rem;
    opacity: 0.5;
}

.suggestion-empty span {
    font-size: 0.85rem;
}

.hero-search button {
    padding: 1rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    background: var(--primary);
    height: 54px;
    box-sizing: border-box;
    color: var(--white);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.hero-search button:hover {
    background: var(--primary-dark);
}

/* Hero Tags - Quick service links */
.hero-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.25rem;
    padding: 0;
}

.hero-tag {
    display: inline-block;
    padding: 0.4rem 0.75rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: var(--white);
    border-radius: 20px;
    font-size: 0.75rem;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 2px 8px rgba(26, 95, 122, 0.25);
}

.hero-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 95, 122, 0.35);
}

.hero-section .prev,
.hero-section .next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 4;
    background: rgba(255,255,255,0.2);
    color: var(--white);
    border: none;
    padding: 1rem;
    cursor: pointer;
    font-size: 1.25rem;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-section .prev { left: 10px; }
.hero-section .next { right: 10px; }

.hero-section .prev:hover,
.hero-section .next:hover {
    background: rgba(255,255,255,0.4);
}

/* ============================================
   Quick Access Services Grid - Enhanced
   ============================================ */
.quick-services {
    padding: 2.5rem 0;
    background: linear-gradient(180deg, var(--white) 0%, #f0f7f7 100%);
    margin-top: -2rem;
    position: relative;
    z-index: 5;
    border-radius: var(--radius) var(--radius) 0 0;
}

.quick-services::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 2px;
}

.section-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 0.5rem 1rem 0;
}

.section-header h2 {
    font-size: 1.35rem;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 0.25rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.section-header h2 i {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-header p {
    color: var(--gray);
    font-size: 0.85rem;
    margin: 0;
}

.quick-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    padding: 0 1rem;
    max-width: 900px;
    margin: 0 auto;
}

.quick-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.25rem 0.75rem;
    background: var(--white);
    border-radius: var(--radius);
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    position: relative;
    overflow: hidden;
}

.quick-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.quick-item:hover::before,
.quick-item:active::before {
    transform: scaleX(1);
}

.quick-item:hover,
.quick-item:active {
    background: var(--white);
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(26, 95, 122, 0.15);
}

.quick-icon {
    width: 55px;
    height: 55px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(26, 95, 122, 0.25);
}

.quick-item:hover .quick-icon {
    transform: scale(1.1) rotate(5deg);
    border-radius: 20px;
}

.quick-icon i {
    font-size: 1.5rem;
    color: var(--white);
}

.quick-item span {
    font-size: 0.8rem;
    color: var(--dark);
    font-weight: 600;
    text-align: center;
    line-height: 1.3;
}

.quick-item:hover span {
    color: var(--primary);
}

/* View All special styling */
.quick-item:last-child {
    background: linear-gradient(135deg, rgba(26, 95, 122, 0.05) 0%, rgba(21, 152, 149, 0.05) 100%);
    border: 2px dashed rgba(26, 95, 122, 0.2);
}

.quick-item:last-child:hover {
    border-style: solid;
    border-color: var(--primary);
    background: var(--white);
}
    text-align: center;
}

/* ============================================
   Statistics Section
   ============================================ */
.stats-section {
    padding: 2rem 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
}

.stats-section .section-header h2 {
    color: var(--white);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 0 1rem;
}

.stat-card {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    padding: 1.25rem;
    border-radius: var(--radius);
    text-align: center;
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.stat-icon {
    margin-bottom: 0.5rem;
}

.stat-icon i {
    font-size: 2rem;
    color: var(--primary);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ============================================
   Information Cards Section
   ============================================ */
.info-section {
    padding: 2rem 0;
    background: var(--light);
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 0 1rem;
}

.info-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
    transition: all 0.3s ease;
}

.info-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.info-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.info-icon i {
    font-size: 1.75rem;
    color: var(--white);
}

.info-card h3 {
    font-size: 1.1rem;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.info-card p {
    font-size: 0.85rem;
    color: var(--gray);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.info-card .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.info-card .btn-primary {
    background: var(--primary);
    color: var(--white);
}

.info-card .btn-primary:hover {
    background: var(--primary-dark);
}

.info-card .btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.info-card .btn-outline:hover {
    background: var(--primary);
    color: var(--white);
}

/* ============================================
   LGU Services Section - Department Boxes
   ============================================ */
.lgu-services-section {
    padding: 3rem 0;
    background: var(--light);
}

.lgu-services-section .section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.lgu-services-section .section-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.lgu-services-section .section-header h2 i {
    margin-right: 0.5rem;
}

.lgu-services-section .section-header p {
    font-size: 1rem;
    color: var(--gray);
    margin: 0;
}

/* Department Boxes Grid */
.departments-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (min-width: 576px) {
    .departments-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.25rem;
    }
}

@media (min-width: 992px) {
    .departments-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem;
    }
}

@media (min-width: 1200px) {
    .departments-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Individual Department Box */
.department-box {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.department-box:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--secondary);
}

.department-box .dept-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.department-box:hover .dept-icon {
    transform: scale(1.1);
}

.department-box .dept-icon i {
    font-size: 1.75rem;
    color: var(--white);
}

.department-box .dept-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--dark);
    margin: 0 0 0.5rem;
    line-height: 1.3;
    min-height: 2.6em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.department-box .dept-count {
    display: inline-block;
    font-size: 0.75rem;
    color: var(--white);
    background: var(--secondary);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-weight: 500;
}

.department-box .dept-hover-hint {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: var(--white);
    padding: 0.5rem;
    font-size: 0.75rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.department-box:hover .dept-hover-hint {
    transform: translateY(0);
}

/* Matching box highlight when searching */
.department-box.has-match {
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(87, 197, 182, 0.3), var(--shadow-hover);
}

.department-box.has-match .dept-icon {
    animation: pulse 1.5s infinite;
}

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

/* Department Modal */
.dept-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.dept-modal {
    background: var(--white);
    border-radius: var(--radius);
    max-width: 800px;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.dept-modal-overlay.active .dept-modal {
    transform: scale(1) translateY(0);
}

.dept-modal-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.dept-modal-header .modal-dept-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dept-modal-header .modal-dept-icon i {
    font-size: 1.5rem;
    color: var(--white);
}

.dept-modal-header h3 {
    flex: 1;
    color: var(--white);
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.dept-modal-header .modal-close {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: background 0.2s ease;
}

.dept-modal-header .modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.dept-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
    background: #f9fafb;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

@media (min-width: 576px) {
    .dept-modal-body {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Modal Service Cards */
.modal-service-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--white);
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.modal-service-card:hover {
    background: linear-gradient(135deg, rgba(26, 95, 122, 0.05) 0%, rgba(21, 152, 149, 0.05) 100%);
    text-decoration: none;
    border-color: var(--secondary);
    box-shadow: 0 4px 12px rgba(21, 152, 149, 0.12);
    transform: translateY(-2px);
}

.modal-service-card .service-icon {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.modal-service-card .service-icon i {
    font-size: 1.25rem;
    color: var(--white);
}

.modal-service-card .service-info {
    flex: 1;
    min-width: 0;
}

.modal-service-card .service-info h5 {
    font-size: 0.9rem;
    color: var(--dark);
    margin: 0 0 0.25rem;
    font-weight: 600;
}

.modal-service-card .service-info p {
    font-size: 0.8rem;
    color: var(--gray);
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.modal-service-card .service-arrow {
    color: var(--gray);
    font-size: 1rem;
    opacity: 0;
    transform: translateX(-5px);
    transition: all 0.2s ease;
}

.modal-service-card:hover .service-arrow {
    opacity: 1;
    transform: translateX(0);
    color: var(--primary);
}

.dept-modal-body .no-services {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--gray);
    padding: 2rem;
}

/* ============================================
   Animations
   ============================================ */
@keyframes fade {
    from { opacity: 0.4; }
    to { opacity: 1; }
}

/* Mobile Popup Positioning Fix */
@media (max-width: 575px) {
    .hotline-popup {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) scale(0.9);
        min-width: 280px;
        max-width: 90vw;
    }

    .hotline-popup::before {
        display: none;
    }

    .hotline-wrapper:hover .hotline-popup,
    .hotline-wrapper.active .hotline-popup {
        transform: translate(-50%, -50%) scale(1);
    }

    .hotline-wrapper.active::after {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 50;
    }
}

/* ============================================
   Tablet Breakpoint (576px+)
   ============================================ */
@media (min-width: 576px) {
    .hero-content h1 {
        font-size: 2.25rem;
    }

    .hotline-item {
        font-size: 0.75rem;
        padding: 0.4rem 0.75rem;
    }

    .hero-search {
        flex-direction: row;
    }

    .search-input-wrapper {
        flex: 1;
    }

    .hero-search input {
        border-radius: var(--radius) 0 0 var(--radius);
    }

    .search-suggestions.active {
        border-radius: 0 0 var(--radius) var(--radius);
    }

    .hero-search button {
        border-radius: 0 var(--radius) var(--radius) 0;
        padding: 1rem 1.5rem;
    }

    .hero-tags {
        gap: 0.75rem;
    }

    .hero-tag {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .quick-services {
        padding: 3rem 0;
    }

    .quick-services::before {
        width: 80px;
        height: 5px;
    }

    .quick-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 1rem;
    }

    .quick-item {
        padding: 1.5rem 0.75rem;
    }

    .quick-icon {
        width: 65px;
        height: 65px;
        border-radius: 18px;
    }

    .quick-icon i {
        font-size: 1.75rem;
    }

    .quick-item span {
        font-size: 0.85rem;
    }

    .info-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ============================================
   Desktop Breakpoint (768px+)
   ============================================ */
@media (min-width: 768px) {
    .hero-section {
        height: 60vh;
    }

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

    .hero-content > p {
        font-size: 1.1rem;
    }

    .section-header h2 {
        font-size: 1.6rem;
    }

    /* Services Grid - 2 columns on tablet */
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .service-card {
        padding: 1.25rem 1.5rem;
    }

    .quick-services {
        padding: 3.5rem 0;
    }

    .quick-grid {
        gap: 1.25rem;
        padding: 0 2rem;
    }

    .quick-item {
        padding: 1.75rem 1rem;
    }

    .quick-icon {
        width: 70px;
        height: 70px;
        margin-bottom: 1rem;
    }

    .quick-icon i {
        font-size: 2rem;
    }

    .quick-item span {
        font-size: 0.9rem;
    }

    .stats-section {
        padding: 3rem 0;
    }

    .stat-value {
        font-size: 2rem;
    }

    .info-section {
        padding: 3rem 0;
    }

    .info-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .department-title {
        font-size: 1.25rem;
    }
}

/* ============================================
   Large Desktop (992px+)
   ============================================ */
@media (min-width: 992px) {
    .hero-section {
        height: 70vh;
        max-height: 600px;
    }

    .hero-content {
        max-width: 700px;
    }

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

    /* Services Grid - 3 columns on desktop */
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .lgu-services-section {
        padding: 4rem 0;
    }

    .quick-item:hover .quick-icon {
        transform: scale(1.1);
    }

    .quick-icon {
        transition: transform 0.3s ease;
    }
}

/* ============================================
   Weather & Map Section
   ============================================ */
.weather-map-section {
    padding: 3rem 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.weather-map-section .section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.weather-map-section .section-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.weather-map-section .section-header h2 i {
    margin-right: 0.5rem;
    color: var(--accent);
}

.weather-map-section .section-header p {
    font-size: 1rem;
    color: var(--gray);
    margin: 0;
}

.weather-map-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

/* Weather Card */
.weather-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.weather-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: var(--white);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.weather-header i {
    font-size: 1.5rem;
}

.weather-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.weather-content {
    padding: 1.5rem;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.weather-loading {
    text-align: center;
    color: var(--gray);
}

.weather-loading i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.weather-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.weather-icon-large {
    font-size: 3.5rem;
    color: var(--accent);
}

.weather-icon-img {
    width: 80px;
    height: 80px;
}

.weather-temp {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary);
}

.weather-desc {
    font-size: 1.1rem;
    color: var(--gray);
    text-transform: capitalize;
    margin-bottom: 1rem;
}

.weather-details {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    width: 100%;
}

.weather-detail {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--dark);
    background: var(--light);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
}

.weather-detail i {
    color: var(--accent);
}

.weather-note {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--light);
    color: var(--gray);
    font-size: 0.8rem;
}

.weather-footer {
    background: var(--light);
    padding: 0.75rem 1.5rem;
    text-align: center;
    color: var(--gray);
    font-size: 0.85rem;
    border-top: 1px solid #e9ecef;
}

/* Map Card */
.map-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.map-header {
    background: linear-gradient(135deg, var(--accent) 0%, var(--secondary) 100%);
    color: var(--white);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.map-header i {
    font-size: 1.5rem;
}

.map-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.map-container {
    position: relative;
    width: 100%;
    height: 300px;
}

.map-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.map-footer {
    padding: 1rem 1.5rem;
    text-align: center;
    background: var(--light);
    border-top: 1px solid #e9ecef;
}

.btn-outline-sm {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 2px solid var(--accent);
    color: var(--accent);
    background: transparent;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-outline-sm:hover {
    background: var(--accent);
    color: var(--white);
    text-decoration: none;
}

/* Tablet and Desktop */
@media (min-width: 768px) {
    .weather-map-grid {
        grid-template-columns: 1fr 2fr;
    }

    .map-container {
        height: 350px;
    }
}

@media (min-width: 992px) {
    .weather-map-section {
        padding: 4rem 0;
    }

    .weather-map-section .section-header h2 {
        font-size: 2rem;
    }

    .weather-map-grid {
        grid-template-columns: 1fr 2.5fr;
    }

    .map-container {
        height: 380px;
    }
}

/* ============================================
   Municipal Leadership Section
   ============================================ */
.leadership-section {
    padding: 3rem 0;
    background: var(--white);
}

.leadership-section .section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.leadership-section .section-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.leadership-section .section-header h2 i {
    margin-right: 0.5rem;
    color: var(--accent);
}

.leadership-section .section-header p {
    font-size: 1rem;
    color: var(--gray);
    margin: 0;
}

.leadership-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

.leader-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.leader-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.leader-photo {
    position: relative;
    height: 200px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

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

.leader-badge {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: var(--white);
    padding: 1.5rem 1rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.leader-info {
    padding: 1.5rem;
    text-align: center;
}

.leader-info h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0.25rem;
}

.leader-info .leader-title {
    font-size: 0.9rem;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 1rem;
}

.leader-contact {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.leader-contact .contact-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--gray);
    font-size: 0.9rem;
    text-decoration: none;
    transition: color 0.3s ease;
}

.leader-contact .contact-link:hover {
    color: var(--primary);
}

.leader-contact .contact-link i {
    color: var(--accent);
}

.leadership-footer {
    text-align: center;
    margin-top: 2rem;
}

/* ============================================
   Contact Information Section
   ============================================ */
.contact-section {
    padding: 3rem 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
}

.contact-section .section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.contact-section .section-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 0.5rem;
}

.contact-section .section-header h2 i {
    margin-right: 0.5rem;
}

.contact-section .section-header p {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.contact-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: var(--white);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.contact-card:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
    text-decoration: none;
    color: var(--white);
}

.contact-icon {
    width: 60px;
    height: 60px;
    background: var(--secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contact-icon i {
    font-size: 1.5rem;
    color: var(--white);
}

.contact-details h4 {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--secondary);
    margin-bottom: 0.25rem;
}

.contact-details .contact-value {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--white);
}

.contact-details .contact-note {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

.contact-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.25rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-link:hover {
    transform: translateY(-3px);
    color: var(--white);
}

.social-link.facebook:hover {
    background: #1877f2;
}

.social-link.messenger:hover {
    background: #0084ff;
}

.social-link.email:hover {
    background: var(--accent);
}

.quick-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1.5rem;
}

.quick-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.quick-links a:hover {
    color: var(--secondary);
    text-decoration: underline;
}

/* Leadership & Contact Responsive */
@media (min-width: 576px) {
    .leadership-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .contact-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .contact-card.address-card {
        grid-column: span 2;
    }
}

@media (min-width: 768px) {
    .leader-card {
        flex-direction: row;
    }

    .leader-photo {
        width: 180px;
        height: auto;
        min-height: 200px;
    }

    .leader-info {
        text-align: left;
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .leader-contact {
        align-items: flex-start;
    }

    .leader-contact .contact-link {
        justify-content: flex-start;
    }

    .contact-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .contact-card.address-card {
        grid-column: span 1;
    }
}

@media (min-width: 992px) {
    .leadership-section {
        padding: 4rem 0;
    }

    .leadership-section .section-header h2 {
        font-size: 2rem;
    }

    .contact-section {
        padding: 4rem 0;
    }

    .contact-section .section-header h2 {
        font-size: 2rem;
    }

    .contact-footer {
        flex-direction: row;
        justify-content: space-between;
    }
}

/* Barangay Modal Styles */
.clickable-stat { cursor: pointer; transition: transform 0.2s; }
.clickable-stat:hover { transform: translateY(-5px); }
.stat-hint { font-size: 0.75rem; color: var(--gray); margin-top: 0.5rem; opacity: 0; transition: opacity 0.2s; }
.clickable-stat:hover .stat-hint { opacity: 1; }
.barangay-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; padding: 1rem; }
@media (max-width: 992px) { .barangay-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) { .barangay-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .barangay-grid { grid-template-columns: repeat(1, 1fr); } }
.barangay-mini-card { background: #f8f9fa; border: 1px solid #eee; border-radius: var(--radius-sm); padding: 1rem; text-align: center; transition: all 0.2s; }
.barangay-mini-card:hover { background: var(--primary); color: white; border-color: var(--primary); transform: scale(1.05); }
.brgy-icon { font-size: 1.5rem; color: var(--accent); margin-bottom: 0.5rem; }
.barangay-mini-card:hover .brgy-icon { color: white; }
.barangay-mini-card h5 { margin: 0; font-size: 0.95rem; font-weight: 600; }


@media (max-width: 992px) { .dept-modal-body .departments-grid { grid-template-columns: repeat(2, 1fr) !important; } }
@media (max-width: 576px) { .dept-modal-body .departments-grid { grid-template-columns: 1fr !important; } }


/* Unified Modal and Grid Adjustments */
.dept-modal { max-width: 1200px !important; width: 95% !important; }
.dept-modal-body .departments-grid { padding: 10px; }
@media (max-width: 992px) { .dept-modal-body .departments-grid { grid-template-columns: repeat(2, 1fr) !important; } }
@media (max-width: 576px) { .dept-modal-body .departments-grid { grid-template-columns: 1fr !important; } }
.clickable-stat { position: relative; overflow: hidden; transition: all 0.3s ease; }
.clickable-stat:hover { transform: translateY(-5px); border-color: var(--secondary); }


/* Fix for Barangay Box Widths within Modal */
.dept-modal-body .departments-grid { display: grid !important; width: 100% !important; grid-template-columns: repeat(5, 1fr) !important; gap: 1.5rem !important; padding: 20px !important; }
.dept-modal-body .department-box { width: 100% !important; min-width: 0 !important; margin: 0 !important; }
@media (max-width: 1200px) { .dept-modal-body .departments-grid { grid-template-columns: repeat(4, 1fr) !important; } }
@media (max-width: 992px) { .dept-modal-body .departments-grid { grid-template-columns: repeat(3, 1fr) !important; } }
@media (max-width: 768px) { .dept-modal-body .departments-grid { grid-template-columns: repeat(2, 1fr) !important; } }
@media (max-width: 480px) { .dept-modal-body .departments-grid { grid-template-columns: 1fr !important; } }


/* Force Modal Grid to spread across full width and fill space */
.dept-modal-body .departments-grid { display: grid !important; width: 100% !important; grid-template-columns: repeat(5, 1fr) !important; gap: 1.5rem !important; justify-content: space-between !important; }
.dept-modal-body .department-box { width: 100% !important; box-sizing: border-box !important; }
@media (max-width: 1400px) { .dept-modal-body .departments-grid { grid-template-columns: repeat(4, 1fr) !important; } }
@media (max-width: 992px) { .dept-modal-body .departments-grid { grid-template-columns: repeat(3, 1fr) !important; } }
@media (max-width: 768px) { .dept-modal-body .departments-grid { grid-template-columns: repeat(2, 1fr) !important; } }
@media (max-width: 480px) { .dept-modal-body .departments-grid { grid-template-columns: 1fr !important; } }


/* ULTIMATE FIX FOR MODAL GRID MAXIMIZATION */
.dept-modal-body { width: 100% !important; padding: 20px !important; box-sizing: border-box !important; }
.dept-modal-body .departments-grid { display: grid !important; width: 100% !important; max-width: 100% !important; margin: 0 auto !important; grid-template-columns: repeat(5, 1fr) !important; gap: 20px !important; }
.dept-modal-body .department-box { width: 100% !important; min-width: 0 !important; margin: 0 !important; flex: 1 !important; }
@media (max-width: 1200px) { .dept-modal-body .departments-grid { grid-template-columns: repeat(4, 1fr) !important; } }
@media (max-width: 900px) { .dept-modal-body .departments-grid { grid-template-columns: repeat(3, 1fr) !important; } }
@media (max-width: 600px) { .dept-modal-body .departments-grid { grid-template-columns: repeat(2, 1fr) !important; } }
@media (max-width: 400px) { .dept-modal-body .departments-grid { grid-template-columns: 1fr !important; } }


/* Dedicated Barangay Modal Styles */
.barangay-modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.7); display: none; align-items: center; justify-content: center; z-index: 1000; padding: 20px; box-sizing: border-box; }
.barangay-modal-overlay.active { display: flex; }
.barangay-modal-container { background: #fff; width: 95%; max-width: 1300px; max-height: 90vh; border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 10px 30px rgba(0,0,0,0.3); animation: modalFadeUp 0.3s ease; }
.barangay-modal-header { padding: 20px 25px; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: space-between; }
.barangay-modal-header h3 { margin: 0; font-size: 1.5rem; display: flex; align-items: center; gap: 10px; }
.barangay-modal-close { background: rgba(255,255,255,0.2); border: none; color: #fff; width: 35px; height: 35px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.2s; }
.barangay-modal-close:hover { background: rgba(255,255,255,0.3); }
.barangay-modal-body { padding: 30px; overflow-y: auto; flex-grow: 1; }
.barangay-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; width: 100%; }
.barangay-box { background: #fff; border: 1px solid #eee; border-radius: 10px; padding: 25px 15px; text-align: center; transition: all 0.3s ease; box-shadow: 0 4px 6px rgba(0,0,0,0.05); cursor: pointer; position: relative; overflow: hidden; }
.barangay-box:hover { transform: translateY(-5px); box-shadow: 0 8px 15px rgba(0,0,0,0.1); border-color: var(--secondary); }
.barangay-box i { font-size: 2rem; color: var(--primary); margin-bottom: 15px; display: block; }
.barangay-box h4 { margin: 0 0 5px; font-size: 1.1rem; color: #333; }
.barangay-box span { font-size: 0.85rem; color: #777; }
@media (max-width: 1200px) { .barangay-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 992px) { .barangay-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) { .barangay-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .barangay-grid { grid-template-columns: 1fr; } }

