/* ============================================
   RESET AND BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    position: relative;
    color: white;
}

/* Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('backgroundpage2.jpg') no-repeat center center fixed;
    background-size: cover;
    z-index: -2;
}

.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: -1;
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */
.main-header {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.government-title h1 {
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
}

.government-title p {
    font-size: 0.85rem;
    opacity: 0.9;
    color: rgba(255, 255, 255, 0.9);
}

.main-nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.main-nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    padding: 0.5rem 0;
    position: relative;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: white;
    transition: width 0.3s ease;
}

.main-nav a:hover::after {
    width: 100%;
}

.login-section {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.login-button {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.7rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(5px);
    font-size: 0.95rem;
}

.login-button:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: white;
    transform: translateY(-2px);
}

/* Top Navigation Bar (for internal pages) */
.top-nav-bar {
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid rgba(255, 255, 255, 0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.8rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-logo {
    width: 45px;
    height: 45px;
    object-fit: contain;
}

.nav-govt {
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
}

.nav-province {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.9);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    color: white;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
}

.nav-btn:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.2);
    border-color: white;
}

.search-btn {
    background: rgba(44, 82, 130, 0.5);
}

.logout-btn {
    background: rgba(220, 38, 38, 0.4);
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero-section {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 2rem;
}

.hero-content {
    max-width: 800px;
}

.hero-title {
    font-size: 4rem;
    font-family: Inter, sans-serif
    margin-bottom: 1rem;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    color: white;
    animation: fadeInUp 1s ease;
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 1s ease 0.2s both;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    animation: fadeInUp 1s ease 0.4s both;
}

.btn-primary, .btn-secondary {
    padding: 1rem 2.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary {
    background: rgba(44, 82, 130, 0.8);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-primary:hover, .btn-secondary:hover {
    transform: translateY(-3px);
    background: rgba(44, 82, 130, 0.9);
    border-color: white;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ============================================
   CONTENT SECTIONS
   ============================================ */
.content-section {
    padding: 5rem 2rem;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.content-section.alt-bg {
    background: rgba(0, 0, 0, 0.5);
}

.section-container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    font-size: 2.5rem;
    font-family: Inter, sans-serif
    margin-bottom: 2rem;
    text-align: center;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.section-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    font-size: 1.1rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.gallery-item {
    aspect-ratio: 4/3;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
}

.gallery-item:hover {
    transform: scale(1.05);
    border-color: white;
}

.gallery-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #2c5282, #1e3a5f);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 500;
    font-size: 1.2rem;
}

/* ============================================
   MODAL STYLES
   ============================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: rgba(20, 30, 40, 0.95);
    backdrop-filter: blur(10px);
    margin: 10% auto;
    padding: 2.5rem;
    border-radius: 20px;
    max-width: 450px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideUp 0.4s ease;
}

.modal-content h2 {
    color: white;
    font-size: 2rem;
    margin-bottom: 1rem;
    text-align: center;
}

.close {
    position: absolute;
    right: 1.5rem;
    top: 1rem;
    color: rgba(255, 255, 255, 0.6);
    font-size: 2rem;
    cursor: pointer;
}

.close:hover {
    color: white;
}

#loginForm .form-group {
    margin-bottom: 1.5rem;
}

#loginForm label {
    display: block;
    color: white;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

#loginForm input {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.error-message {
    color: #ff6b6b;
    text-align: center;
    margin: 1rem 0;
    padding: 0.5rem;
    background: rgba(255, 107, 107, 0.1);
    border-radius: 8px;
    display: none;
}

.login-submit {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #2c5282, #1e3a5f);
    color: white;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.login-submit:hover {
    transform: translateY(-2px);
}

.login-hint {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
}

/* ============================================
   REGISTRATION FORM
   ============================================ */
.registration-section {
    padding: 2rem 1rem;
    max-width: 1000px;
    margin: 0 auto;
}

.form-container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.form-header {
    background: linear-gradient(135deg, rgba(44, 82, 130, 0.8), rgba(71, 61, 139, 0.8));
    color: white;
    padding: 2rem;
    text-align: center;
}

.form-header h1 {
    font-size: 2.5rem;
    font-family: Inter, sans-serif
    margin-bottom: 0.5rem;
}

form {
    padding: 2rem;
}

.form-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
}

.form-section h3 {
    color: white;
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    padding-left: 0.5rem;
    border-left: 4px solid #4a90e2;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    flex: 1 1 calc(50% - 1rem);
    min-width: 200px;
}

.form-group.full-width {
    flex: 1 1 100%;
}

label {
    display: block;
    margin-bottom: 0.3rem;
    color: white;
    font-weight: 500;
    font-size: 0.9rem;
}

.required:after {
    content: " *";
    color: #ff6b6b;
}

input, select, textarea {
    width: 100%;
    padding: 0.7rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    color: white;
    font-size: 0.95rem;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: white;
}

.checkbox-group {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 1rem;
    max-height: 250px;
    overflow-y: auto;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.5rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem;
    color: white;
}

.checkbox-item input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
}

.note-section {
    background: rgba(44, 82, 130, 0.2);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

.form-actions {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.btn-primary {
    background: linear-gradient(135deg, #2c5282, #1e3a5f);
    color: white;
    border: none;
    padding: 1rem 3rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

/* ============================================
   FOOTER
   ============================================ */
.main-footer {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    padding: 3rem 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}

.footer-info p {
    margin: 0.3rem 0;
    color: rgba(255, 255, 255, 0.8);
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: white;
    text-decoration: none;
}

.footer-links a:hover {
    opacity: 0.7;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
    
    .nav-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-buttons {
        flex-direction: column;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .footer-container {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-links {
        justify-content: center;
    }
}

/* ============================================
   DUPLICATE ERROR MODAL - SAME AS LOGIN MODAL
   ============================================ */
.duplicate-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.duplicate-modal-content {
    background: rgba(20, 30, 40, 0.95);
    backdrop-filter: blur(10px);
    margin: 10% auto;
    padding: 2rem;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideUp 0.4s ease;
    color: white;
}

.duplicate-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.duplicate-modal-header h3 {
    color: #e74c3c;
    font-size: 1.3rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.duplicate-modal-close {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.8rem;
    cursor: pointer;
    transition: all 0.3s;
    line-height: 1;
}

.duplicate-modal-close:hover {
    color: white;
    transform: scale(1.1);
}

.duplicate-modal-body {
    padding: 0.5rem 0;
}

.duplicate-details {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 1rem;
    margin: 1rem 0;
    font-size: 0.9rem;
}

.duplicate-details p {
    margin: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.duplicate-details strong {
    color: #4a90e2;
    min-width: 100px;
}

.duplicate-modal-footer {
    margin-top: 1.5rem;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
}

.duplicate-modal-footer button {
    background: linear-gradient(135deg, #4a90e2, #357abd);
    color: white;
    border: none;
    padding: 0.6rem 2rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.duplicate-modal-footer button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(74,144,226,0.4);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   ANNOUNCEMENTS SECTION ON LOGIN PAGE
   ============================================ */
.announcements-section {
    max-width: 500px;
    margin: 1.5rem auto 0;
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1rem;
    border: 1px solid rgba(255,255,255,0.15);
}

.announcements-header {
    font-size: 0.9rem;
    font-weight: 600;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    margin-bottom: 0.8rem;
    color: #4a90e2;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.announcements-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.announcement-card {
    background: rgba(0,0,0,0.3);
    border-radius: 12px;
    padding: 0.8rem;
    border-left: 4px solid;
}

.announcement-alert { border-left-color: #e74c3c; }
.announcement-warning { border-left-color: #f39c12; }
.announcement-info { border-left-color: #3498db; }
.announcement-success { border-left-color: #2ecc71; }

.announcement-card-title {
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
}

.announcement-card-content {
    font-size: 0.75rem;
    opacity: 0.9;
    line-height: 1.4;
}

.announcement-card-date {
    font-size: 0.65rem;
    opacity: 0.6;
    margin-top: 0.3rem;
}

/* ============================================
   FAMILY TREE VIEW STYLES
   ============================================ */
.tree-node {
    transition: transform 0.3s ease;
}

.tree-node:hover {
    transform: translateY(-5px);
}

