/* ===================================
   Village Search - Public Information Portal
   Clean & Optimized CSS
   ================================== */

/* Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #334155;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body::before {
    content: "";
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(rgba(203, 219, 255, 0.85), rgba(200, 255, 233, 0.85)), url('../../../assets/img/background.webp') center/cover no-repeat;
    filter: blur(5px);
    z-index: -1;
}

/* ===================================
   Header
   ================================== */
.main-header {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid #e2e8f0;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-icon img {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    object-fit: cover;
}

.logo-text h1 {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.logo-text p {
    font-size: 13px;
    color: #64748b;
    margin: 0;
}

.header-nav .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.header-nav .nav-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* ===================================
   Main Content
   ================================== */
.main-content {
    padding: 40px 20px 60px;
    flex: 1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Hero Section */
.hero-section {
    text-align: center;
    margin-bottom: 40px;
}

.hero-text h1 {
    font-size: 36px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 12px;
}

.hero-text p {
    font-size: 18px;
    color: #64748b;
}

/* ===================================
   Search Section
   ================================== */
.search-browse-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

.search-section {
    margin-bottom: 0;
}

/* OR Divider */
.or-divider {
    text-align: center;
    margin: 2rem 0;
    color: #64748b;
    font-size: 1.1rem;
    font-weight: 500;
}

.or-divider span {
    background: white;
    padding: 0 1rem;
}

.search-card {
    background: white;
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.search-header {
    margin-bottom: 24px;
}

.search-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-header h2 i {
    color: #667eea;
}

.search-header p {
    color: #64748b;
    font-size: 14px;
}

/* Form Styles */
.search-form, .selection-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.selection-form {
    background: #f8fafc;
    padding: 24px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.form-row {
    display: grid;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label,
.form-group-select label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input,
.input-wrapper select,
.form-group-select select {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    background: white;
    transition: all 0.3s ease;
    outline: none;
}

.form-group-select select {
    padding: 14px 40px 14px 16px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
}

.input-wrapper input:focus,
.input-wrapper select:focus,
.form-group-select select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-icon {
    position: absolute;
    left: 16px;
    color: #9ca3af;
    font-size: 16px;
    pointer-events: none;
}

/* Buttons */
.search-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    border: none;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: white;
    color: #64748b;
    border: 2px solid #e5e7eb;
}

.btn-secondary:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

/* ===================================
   Search Results
   ================================== */
.results-section {
    margin-top: 40px;
}

.results-header {
    margin-bottom: 24px;
}

.results-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
}

.results-header p {
    color: #64748b;
    font-size: 15px;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.village-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    border: 2px solid #e5e7eb;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: block;
}

.village-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: #667eea;
}

.village-card.no-officer {
    opacity: 0.6;
}

.village-card-header {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.village-name {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}

.village-number {
    font-size: 13px;
    color: #64748b;
    font-weight: 600;
}

.village-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.village-info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #64748b;
}

.village-info-item i {
    color: #667eea;
    width: 18px;
}

.status-registered {
    color: #22c55e;
}

.status-not-registered {
    color: #94a3b8;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

/* ===================================
   Village Details Modal
   ================================== */
.village-details {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    backdrop-filter: blur(4px);
    overflow-y: auto;
}

.village-modal {
    background: white;
    border-radius: 20px;
    max-width: 1000px;
    width: 100%;
    height: 90vh;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    position: relative;
    margin: auto;
    display: flex;
    flex-direction: column;
}

.modal-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 24px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 20px 20px 0 0;
}

.modal-header h2 {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    cursor: pointer;
    padding: 10px 20px;
    border-radius: 10px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.modal-body {
    padding: 32px;
    overflow-y: auto;
    flex: 1;
}

.village-details-grid {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
    gap: 32px;
}

.village-info-section{
    margin-bottom: 10px;
}

.village-info-section,
.officer-info-section,
.announcements-info-section {
    background: #f8fafc;
    border-radius: 16px;
    padding: 24px;
        margin-bottom: 10px;

}

.village-info-section h3,
.officer-info-section h3,
.announcements-info-section h3 {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.village-info-section h3 i,
.officer-info-section h3 i,
.announcements-info-section h3 i {
    color: #667eea;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.stat-card {
    background: white;
    margin-bottom: 5px;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid #e5e7eb;
}

.stat-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
}

.stat-label {
    display: block;
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

/* Officer Card */
.officer-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #e5e7eb;
}

.officer-profile {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.officer-avatar {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.officer-info h4 {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}

.officer-info p {
    font-size: 14px;
    color: #64748b;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #64748b;
}

.contact-item i {
    color: #667eea;
    width: 20px;
}

.no-officer-message {
    color: #64748b;
    text-align: center;
    padding: 2rem;
}

/* Announcements */
.announcements-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.announcement-item {
    background: white;
    border-radius: 12px;
    padding: 20px;
    border-left: 4px solid #667eea;
}

.announcement-item.urgent {
    border-left-color: #ef4444;
}

.announcement-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.announcement-title {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.announcement-title h4 {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.announcement-title i {
    color: #667eea;
}

.urgent-badge {
    background: #fef2f2;
    color: #ef4444;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.announcement-content p {
    color: #64748b;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 12px;
}

.announcement-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #94a3b8;
}

.announcement-date {
    display: flex;
    align-items: center;
    gap: 6px;
}

.announcement-category {
    background: #f1f5f9;
    padding: 4px 12px;
    border-radius: 6px;
    font-weight: 500;
}

.no-announcements {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
}

.no-announcements i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

/* ===================================
   Footer
   ================================== */
.main-footer {
    background: white;
    border-top: 1px solid #e2e8f0;
    padding: 24px 0;
    margin-top: auto;
}

.footer-content {
    text-align: center;
    color: #64748b;
    font-size: 14px;
}

/* ===================================
   Responsive Design
   ================================== */
@media (max-width: 768px) {
    .hero-text h1 {
        font-size: 28px;
    }
    
    .hero-text p {
        font-size: 16px;
    }
    
    .search-browse-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .search-card {
        padding: 24px;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .header-container {
        height: auto;
        padding: 16px;
        flex-direction: column;
        gap: 16px;
    }
    
    .search-actions {
        flex-direction: column;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}

/* ===================================
   Scrollbar Styling
   ================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
