* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2d6a4f;
    --primary-dark: #1b4d3e;
    --primary-light: #40916c;
    --secondary-color: #ffb703;
    --secondary-dark: #fb8500;
    --accent-color: #219ebc;
    --text-dark: #2d3e50;
    --text-light: #6c757d;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --danger: #e63946;
    --success: #2ecc71;
    --warning: #f39c12;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.05);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-dark);
    background-color: var(--bg-light);
    line-height: 1.6;
    overflow-x: hidden;
}

.box-container {
    padding: 3%;
    border-radius: 10px;
    box-shadow: #7e7e7e;
    background-color: #dcdcdc;
}

.container {
    max-width: 80%; /* 1200px */
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.header {
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 80%;
    margin: 0 auto;
    padding: 1rem 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

.logo-text h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.logo-text p {
    font-size: 0.75rem;
    color: var(--text-light);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary-color);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 100%;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-dark);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 4rem 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 80%;
    margin: 0 auto;
}

.hero-content h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    animation: fadeInUp 0.8s ease;
}

.highlight {
    color: var(--secondary-color);
}

.hero-content p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    animation: fadeInUp 0.8s ease 0.2s backwards;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    animation: fadeInUp 0.8s ease 0.4s backwards;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--secondary-color);
    color: var(--text-dark);
}

.btn-primary:hover {
    background: var(--secondary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.btn-secondary:hover {
    background: white;
    color: var(--primary-color);
    transform: translateY(-2px);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-full {
    width: 100%;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 3rem;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.8s ease 0.6s backwards;
}

.stat-card {
    background: rgba(255, 255, 255, 0.1);
    /*backdrop-filter: blur(10px);*/
    padding: 1.5rem;
    border-radius: var(--border-radius);
    min-width: 150px;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.2);
}

.stat-card i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.stat-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-card p {
    font-size: 0.875rem;
    margin: 0;
}

/* Section Styles */
section {
    padding: 4rem 0;
}

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

.section-header h2 {
    font-size: 2rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.section-header p {
    color: var(--text-light);
}

/* Announcements Section */
.announcement-filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-white);
    border: 1px solid #ddd;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.875rem;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.announcements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.announcement-card {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

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

.announcement-card.emergency {
    border-left: 4px solid var(--danger);
}

.announcement-card.program {
    border-left: 4px solid var(--success);
}

.announcement-card.event {
    border-left: 4px solid var(--warning);
}

.announcement-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-emergency {
    background: var(--danger);
    color: white;
}

.badge-program {
    background: var(--success);
    color: white;
}

.badge-event {
    background: var(--warning);
    color: white;
}

.announcement-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    padding-right: 80px;
}

.announcement-date {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.announcement-description {
    color: var(--text-light);
    line-height: 1.6;
}

/* QR System Section */
.qr-system {
    background: var(--bg-white);
}

.qr-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.qr-scanner-card,
.qr-registration-card {
    background: var(--bg-light);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--primary-light);
}

.card-header i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.card-header h3 {
    font-size: 1.25rem;
}

.scanner-box {
    background: #e9ecef;
    border-radius: var(--border-radius);
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.scanner-placeholder {
    text-align: center;
    padding: 2rem;
}

.scanner-placeholder i {
    font-size: 3rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.scanner-placeholder p {
    margin-bottom: 1rem;
    color: var(--text-light);
}

#scannerContainer {
    width: 100%;
}

#scannerVideo {
    width: 100%;
    height: auto;
}

.scan-result {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--success);
    color: white;
    border-radius: var(--border-radius);
    animation: slideIn 0.3s ease;
}

.resident-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group label {
    font-weight: 600;
    font-size: 0.875rem;
}

.form-group input,
.form-group select {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.1);
}

.generated-qr {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--bg-white);
    border-radius: var(--border-radius);
    text-align: center;
}

#qrCodeDisplay {
    display: flex;
    justify-content: center;
    margin: 1rem 0;
}

/* Resident Info Section */
.resident-controls {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    max-width: 300px;
    position: relative;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
}

.resident-table-container {
    overflow-x: auto;
}

.resident-table {
    width: 100%;
    background: var(--bg-white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.resident-table th,
.resident-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.resident-table th {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

.resident-table tr:hover {
    background: var(--bg-light);
}

.resident-table .qr-code-img {
    width: 40px;
    height: 40px;
    cursor: pointer;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    padding: 0.25rem 0.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.view-btn {
    background: var(--primary-light);
    color: white;
}

.delete-btn {
    background: var(--danger);
    color: white;
}

/* About Section */
.about {
    background: var(--bg-white);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.about-text h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.about-text p {
    margin-bottom: 1rem;
    color: var(--text-light);
}

.about-features {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.feature-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-sm);
}

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

.feature-item h4 {
    margin-bottom: 0.25rem;
}

.feature-item p {
    font-size: 0.875rem;
    color: var(--text-light);
}

/* Footer */
.footer {
    background: var(--text-dark);
    color: white;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

.footer-section p {
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: white;
    text-decoration: none;
    opacity: 0.8;
    transition: var(--transition);
}

.footer-section ul li a:hover {
    opacity: 1;
}

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

.social-links a {
    color: white;
    font-size: 1.25rem;
    opacity: 0.8;
    transition: var(--transition);
}

.social-links a:hover {
    opacity: 1;
    transform: translateY(-2px);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.875rem;
    opacity: 0.8;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 1280px) {
    .mobile-menu-btn {
        display: block;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-white);
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
        box-shadow: var(--shadow);
    }

    .nav-menu.active {
        display: flex;
    }

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

    .hero-stats {
        flex-direction: column;
        gap: 1rem;
    }

    .stat-card {
        min-width: auto;
    }

    .qr-container {
        grid-template-columns: 1fr;
    }

    .about-content {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .announcements-grid {
        grid-template-columns: 1fr;
    }

    .resident-controls {
        flex-direction: column;
    }

    .search-box {
        max-width: 100%;
    }
}

/* Loading States */
.loading {
    text-align: center;
    padding: 2rem;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Add to existing style.css */

/* Profile Section */
.profile-section {
    background: linear-gradient(135deg, #f5f7fa 0%, #ffffff 100%);
}

.resident-selector {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    align-items: center;
    flex-wrap: wrap;
}

.resident-select {
    flex: 1;
    max-width: 300px;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
}

/* Profile Tabs */
.profile-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 0.5rem;
}

.tab-btn {
    padding: 0.75rem 1.25rem;
    background: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    color: var(--text-light);
}

.tab-btn i {
    margin-right: 0.5rem;
}

.tab-btn:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

.tab-btn.active {
    background: var(--primary-color);
    color: white;
}

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

/* Profile Card */
.profile-card {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
}

.profile-header {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--bg-light);
}

.profile-avatar i {
    font-size: 5rem;
    color: var(--primary-color);
}

.profile-basic-info h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.profile-basic-info p {
    color: var(--text-light);
    margin: 0.25rem 0;
}

/* Personal Details */
.personal-details {
    margin-top: 1rem;
}

.detail-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.detail-item.full-width {
    grid-column: 1 / -1;
}

.detail-item label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-dark);
}

.detail-item span {
    color: var(--text-light);
    font-size: 1rem;
}

.detail-item input,
.detail-item select {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
}

/* Documents Grid */
.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.document-category {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.document-category h3 {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-light);
    color: var(--primary-color);
}

.document-category h3 i {
    margin-right: 0.5rem;
}

.document-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.document-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-light);
    border-radius: 8px;
    transition: var(--transition);
}

.document-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-sm);
}

.document-item i {
    color: var(--success);
    font-size: 1.25rem;
}

.document-item span {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.btn-doc-request,
.btn-doc-view,
.btn-doc-upload {
    padding: 0.25rem 0.75rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: var(--transition);
}

.btn-doc-request {
    background: var(--primary-color);
    color: white;
}

.btn-doc-view {
    background: var(--secondary-color);
    color: var(--text-dark);
}

.btn-doc-upload {
    background: var(--accent-color);
    color: white;
}

.btn-doc-request:hover,
.btn-doc-view:hover,
.btn-doc-upload:hover {
    opacity: 0.8;
    transform: translateY(-1px);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: var(--bg-white);
    margin: 5% auto;
    padding: 2rem;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 500px;
    position: relative;
    animation: slideIn 0.3s ease;
}

.modal-large {
    max-width: 800px;
}

.close {
    position: absolute;
    right: 1.5rem;
    top: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    transition: var(--transition);
}

.close:hover {
    color: var(--danger);
}

/* Document View Styles */
.document-viewer {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-top: 1rem;
}

.document-preview {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: var(--border-radius);
    margin: 1rem 0;
}

.document-preview i {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.document-info {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: var(--border-radius);
}

.document-info p {
    margin: 0.5rem 0;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .profile-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .detail-row {
        grid-template-columns: 1fr;
    }
    
    .documents-grid {
        grid-template-columns: 1fr;
    }
    
    .document-item {
        flex-wrap: wrap;
    }
    
    .document-item span {
        width: 100%;
        order: -1;
    }
    
    .profile-tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        width: 100%;
        text-align: left;
    }
    
    .resident-selector {
        flex-direction: column;
        align-items: stretch;
    }
    
    .resident-select {
        max-width: 100%;
    }
    
    .modal-content {
        margin: 10% auto;
        padding: 1.5rem;
        width: 95%;
    }
}