:root {
    --primary: #0f766e;
    --primary-light: #14b8a6;
    --secondary: #d97706;
    --accent: #fb7185;
    --danger: #ef4444;
    --success: #10b981;
    --dark: #134e4a;
    --footer-bg: #0d2b29;
    --light: #fffdfa;
    --white: #ffffff;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-600: #475569;

    /* Theme Variables - Default Light */
    --bg-body: var(--light);
    --bg-card: var(--white);
    --bg-navbar: rgba(255, 255, 255, 0.92);
    --text-main: var(--dark);
    --text-muted: var(--gray-600);
    --border-color: var(--gray-200);
    --card-shadow: 0 15px 35px rgba(0,0,0,0.04);
}

body.dark-theme {
    --bg-body: #0a1918;
    --bg-card: #112b29;
    --bg-navbar: rgba(10, 25, 24, 0.92);
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --border-color: rgba(255,255,255,0.1);
    --gray-100: #1a3533;
    --gray-200: #2d4a47;
    --white: #112b29;
    --card-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

/* IMPORTANT: HIDE MODALS BY DEFAULT */
.modal { 
    display: none; 
    position: fixed; 
    z-index: 2000; 
    left: 0; top: 0; 
    width: 100%; height: 100%; 
    background: rgba(19, 78, 74, 0.6); 
    backdrop-filter: blur(12px); 
    align-items: center; 
    justify-content: center; 
    padding: 20px;
}
/* Ensure critical modals are always on top */
#verify-modal { z-index: 2100; }
#confirm-modal { z-index: 2200; }
#toast { z-index: 9999; }

/* Verification Inputs */
.verify-digit {
    width: 48px !important;
    height: 56px !important;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 800;
    border-radius: 12px;
    border: 2px solid var(--gray-200);
    background: var(--gray-100);
    color: var(--dark);
    padding: 0 !important;
    line-height: 56px !important;
    transition: all 0.3s ease;
    outline: none;
}
.verify-digit:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Outfit', sans-serif; background: var(--bg-body); color: var(--text-main); line-height: 1.6; transition: background 0.3s, color 0.3s; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.text-center { text-align: center; }
textarea { resize: none; }

/* Navbar */
.navbar { background: var(--bg-navbar); backdrop-filter: blur(15px); height: 80px; display: flex; align-items: center; position: sticky; top: 0; z-index: 1000; border-bottom: 1px solid var(--border-color); transition: background 0.3s; }
.nav-content { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.logo { font-size: 1.75rem; font-weight: 800; color: var(--primary); white-space: nowrap; flex-shrink: 0; }
.logo span { color: var(--secondary); }
.nav-links { display: flex; align-items: center; gap: 16px; margin: 0 15px; }
.nav-links a { text-decoration: none; color: var(--text-main); font-weight: 600; transition: 0.3s; white-space: nowrap; font-size: 0.95rem; }
.nav-links a:hover { color: var(--primary); }
.nav-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.theme-btn { color: var(--text-main); cursor: pointer; transition: 0.3s; padding: 10px; font-size: 1.2rem; display: flex; align-items: center; justify-content: center; border-radius: 12px; background: var(--gray-100); width: 42px; height: 42px; }
.theme-btn:hover { color: var(--primary); transform: scale(1.05); background: var(--gray-200); }

/* Language Selector */
.lang-selector { position: relative; display: flex; align-items: center; }
.lang-btn { background: var(--gray-100); border: none; padding: 0 12px; border-radius: 12px; font-weight: 700; color: var(--text-main); cursor: pointer; display: flex; align-items: center; gap: 8px; font-size: 0.85rem; transition: 0.3s; height: 42px; border: 1px solid var(--border-color); }
.lang-btn:hover { background: var(--gray-200); border-color: var(--primary-light); }
.lang-dropdown { position: absolute; top: 50px; right: 0; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 16px; width: 180px; display: none; padding: 8px; z-index: 1100; box-shadow: 0 15px 40px rgba(0,0,0,0.15); backdrop-filter: blur(10px); }
.lang-item { padding: 10px 15px; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 0.9rem; transition: 0.3s; color: var(--text-main); display: flex; align-items: center; gap: 10px; }
.lang-item:hover { background: var(--primary); color: white; }
.lang-dropdown.active { display: block; animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1); }

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

/* Hero */
.hero { padding: 180px 0 140px; background: linear-gradient(rgba(19, 78, 74, 0.8), rgba(19, 78, 74, 0.6)), url('hero.png'); background-size: cover; background-position: center; background-attachment: fixed; color: white; text-align: center; }
.hero-badge { display: inline-block; padding: 8px 16px; background: rgba(255,255,255,0.1); border-radius: 50px; font-weight: 700; margin-bottom: 20px; border: 1px solid rgba(255,255,255,0.2); }
.hero h2 { font-size: 4.5rem; font-weight: 800; margin-bottom: 24px; line-height: 1.1; }
.hero h2 span { color: var(--secondary); }
.hero p { font-size: 1.4rem; max-width: 800px; margin: 0 auto 48px; opacity: 0.9; }

/* Stats */
.stats { margin-top: -80px; position: relative; z-index: 10; }
.stats-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; background: white; padding: 40px; border-radius: 40px; box-shadow: 0 30px 60px rgba(0,0,0,0.1); }
@media (max-width: 992px) { .stats-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-item h4 { font-size: 3rem; color: var(--primary); font-weight: 800; }
.stat-item p { font-weight: 700; color: var(--text-muted); text-transform: uppercase; font-size: 0.85rem; letter-spacing: 1px; }

/* Support Grid */
.support { padding: 120px 0; background: var(--bg-body); opacity: 0.98; }
.support-grid { display: grid !important; grid-template-columns: repeat(3, 1fr) !important; gap: 40px !important; margin-top: 60px; }
.support-card { background: var(--bg-card); padding: 60px 40px; border-radius: 45px; text-align: center; box-shadow: var(--card-shadow); transition: 0.3s; border: 1px solid var(--border-color); }
.support-card:hover { transform: translateY(-10px); }
.support-card i { font-size: 4rem; margin-bottom: 30px; display: block; }
.section-badge { background: var(--secondary); color: white; padding: 5px 15px; border-radius: 50px; font-weight: 800; font-size: 0.8rem; }

/* Residents Grid */
.card-section { padding: 120px 0; background: var(--bg-body); }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 60px; }
.grid { display: grid !important; grid-template-columns: repeat(3, 1fr) !important; gap: 40px !important; }
.card { background: var(--bg-card); border-radius: 40px; overflow: hidden; box-shadow: var(--card-shadow); border: 1px solid var(--border-color); transition: 0.3s; display: flex; flex-direction: column; height: 100%; }
.card:hover { transform: translateY(-5px); box-shadow: 0 20px 45px rgba(0,0,0,0.15); }
.card-img { 
    height: 280px; 
    position: relative; 
    overflow: hidden;
}
.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.33, 1, 0.68, 1);
}
.card:hover .card-img img { transform: scale(1.1); }
.card-body { padding: 32px; display: flex; flex-direction: column; flex: 1; }
.card-body h3 { font-size: 1.5rem; font-weight: 800; margin-bottom: 12px; color: var(--primary); }
.card-body .loc { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 15px; display: flex; align-items: center; gap: 6px; }
.card-body .desc { font-size: 0.95rem; line-height: 1.5; color: var(--gray-600); margin-bottom: 20px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-actions { margin-top: auto; }

/* Action Buttons in Cards */
.btn-action { background: var(--gray-100); border: none; padding: 12px; border-radius: 12px; cursor: pointer; transition: 0.3s; color: var(--dark); font-size: 1.1rem; }
.btn-action:hover { background: var(--primary); color: white; }

.card-footer {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: auto;
    padding-top: 20px;
}
.card-actions-mini {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}
.action-btn-mini {
    background: var(--gray-100);
    padding: 12px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 700;
    color: var(--primary);
    cursor: pointer;
    transition: 0.3s;
    font-size: 0.9rem;
}
.action-btn-mini:hover {
    background: var(--primary);
    color: white;
}
.action-btn-mini i {
    font-size: 1.1rem;
}
.action-btn-mini.likes i {
    color: var(--accent);
}
.action-btn-mini:hover i {
    color: white;
}

.btn-adopt-full {
    background: var(--success);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
    width: 100%;
    font-size: 0.95rem;
}
.btn-adopt-full:hover {
    background: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-adopt-full.lost {
    background: var(--danger);
}
.btn-adopt-full.lost:hover {
    background: #c53030;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

/* Footer */
footer { background: var(--footer-bg) !important; color: white; padding: 120px 0 60px; }
.footer-contact-box { background: rgba(255,255,255,0.04); padding: 70px; border-radius: 50px; display: grid; grid-template-columns: 1fr 1fr; gap: 80px; margin-bottom: 80px; border: 1px solid rgba(255,255,255,0.1); }
.footer-contact-form { display: flex; flex-direction: column; gap: 20px; }
.footer-contact-form input, .footer-contact-form textarea { background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.2); border-radius: 16px; padding: 20px; color: white; font-family: inherit; font-size: 1rem; width: 100%; resize: none; }
.footer-contact-form button { background: var(--primary); color: white; padding: 20px; border-radius: 16px; font-weight: 800; border: none; cursor: pointer; transition: 0.3s; }
.footer-contact-form button:hover { background: var(--primary-light); color: var(--dark); }

.footer-bottom { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 60px; }
.social-links { display: flex; gap: 20px; }
.social-links a { color: white; font-size: 1.8rem; opacity: 0.7; transition: 0.3s; }
.social-links a:hover { opacity: 1; color: var(--primary-light); }

/* Back to Top */
.back-to-top { position: fixed; bottom: 30px; right: 30px; background: var(--primary); color: white; width: 50px; height: 50px; border-radius: 50%; border: none; cursor: pointer; box-shadow: 0 10px 20px rgba(0,0,0,0.1); z-index: 100; transition: 0.3s; }
.back-to-top:hover { transform: scale(1.1); background: var(--primary-light); color: var(--dark); }

/* Modals */
.modal-content { background: var(--bg-card); padding: 50px; border-radius: 40px; width: 100%; max-width: 600px; position: relative; box-shadow: 0 30px 60px rgba(0,0,0,0.3); color: var(--text-main); border: 1px solid var(--border-color); }
.close { position: absolute; right: 30px; top: 30px; font-size: 30px; cursor: pointer; color: var(--text-muted); }
.modal-content input, .modal-content textarea, .modal-content select { 
    width: 100%; 
    padding: 16px 20px; 
    border-radius: 16px; 
    border: 1px solid var(--border-color); 
    background: var(--gray-100); 
    font-family: inherit; 
    font-size: 1rem; 
    color: var(--text-main); 
    transition: all 0.3s ease; 
    outline: none;
}
.modal-content input:focus, .modal-content textarea:focus, .modal-content select:focus { 
    border-color: var(--primary-light); 
    background: var(--bg-card); 
    box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.1); 
}

/* Buttons & Utils */
.btn-primary { background: var(--primary); color: white; padding: 18px 36px; border-radius: 16px; font-weight: 800; border: none; cursor: pointer; transition: 0.3s; }
.btn-primary:hover { background: var(--primary-light); color: var(--dark); }
.btn-secondary { background: var(--bg-card); color: var(--text-main); padding: 18px 36px; border-radius: 16px; font-weight: 800; border: 2px solid var(--border-color); cursor: pointer; }
.btn-emergency { background: #fee2e2; color: #dc2626; padding: 10px 20px; border-radius: 12px; font-weight: 700; border: none; cursor: pointer; margin-left: 10px; }
.filter-group { display: flex; flex-wrap: wrap; gap: 8px; background: var(--bg-card); padding: 10px 14px; border-radius: 20px; border: 1px solid var(--border-color); box-shadow: 0 4px 10px rgba(0,0,0,0.03); justify-content: center; align-items: center; }
.btn-filter { background: transparent; border: none; padding: 8px 16px; border-radius: 50px; font-weight: 600; cursor: pointer; transition: 0.3s; color: var(--text-muted); display: flex; align-items: center; gap: 6px; font-size: 0.85rem; white-space: nowrap; }
.btn-filter i { font-size: 1rem; opacity: 0.7; }
.btn-filter:hover { background: var(--gray-100); color: var(--dark); }
.btn-filter.active { background: var(--gray-600); color: white; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.btn-filter.active i { opacity: 1; }

/* Category Specific Filter Colors */
.filter-vaccinated { color: #10b981; }
.filter-observation { color: var(--primary); }
.filter-new { color: #3b82f6; }
.filter-baby { color: #ec4899; }
.filter-adopted { color: #166534; }
.filter-lost { color: var(--danger); }

.filter-vaccinated.active { background: #10b981 !important; color: white !important; }
.filter-observation.active { background: var(--primary-light) !important; color: white !important; }
.filter-new.active { background: #3b82f6 !important; color: white !important; }
.filter-baby.active { background: #ec4899 !important; color: white !important; }
.filter-adopted.active { background: #166534 !important; color: white !important; }
.filter-lost.active { background: var(--danger) !important; color: white !important; }


.badge { 
    position: absolute; 
    top: 20px; 
    left: 20px; 
    padding: 8px 16px; 
    border-radius: 50px; 
    font-weight: 800; 
    font-size: 0.85rem; 
    color: white; 
    z-index: 5;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}
.badge i { margin-right: 5px; }
.card:hover .badge { transform: scale(1.05); }

.badge-success { 
    background: var(--success); 
    overflow: hidden;
}
.badge-success::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 3s infinite;
}

.badge-danger { 
    background: var(--danger); 
    animation: pulse-danger 2s infinite;
}

/* Responsive */
@media (max-width: 992px) {
    .grid, .support-grid, .stats-grid, .footer-contact-box { grid-template-columns: 1fr !important; }
    .footer-bottom { flex-direction: column; gap: 30px; }
    .hero h2 { font-size: 3rem; }
    .nav-links { display: none; }
}

@keyframes pulse-danger {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

@keyframes shimmer {
    0% { left: -100%; }
    20% { left: 100%; }
    100% { left: 100%; }
}

/* Auth Modal & Tabs */
.auth-tabs { display: flex; gap: 20px; margin-bottom: 25px; border-bottom: 1px solid var(--gray-200); }
.auth-tab { padding: 10px 0; cursor: pointer; font-weight: 700; color: var(--gray-600); position: relative; }
.auth-tab.active { color: var(--primary); }
.auth-tab.active::after { content: ''; position: absolute; bottom: -1px; left: 0; width: 100%; height: 2px; background: var(--primary); }

.user-menu { display: flex; align-items: center; gap: 8px; cursor: pointer; background: var(--gray-100); padding: 5px 12px; border-radius: 50px; position: relative; white-space: nowrap; }
.user-avatar { width: 32px; height: 32px; background: var(--primary); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.8rem; }
.user-dropdown { position: absolute; top: 100%; right: 0; background: white; box-shadow: 0 10px 30px rgba(0,0,0,0.1); border-radius: 15px; width: 200px; display: none; padding: 10px; z-index: 1000; }
/* Menu ile buton arasindaki kopru */
.user-dropdown::before { content: ''; position: absolute; top: -15px; left: 0; width: 100%; height: 15px; }
.user-menu:hover .user-dropdown { display: block; }
.dropdown-item { padding: 12px 15px; border-radius: 8px; color: var(--dark); font-size: 0.95rem; transition: 0.3s; cursor: pointer; display: flex; align-items: center; gap: 10px; }
.dropdown-item:hover { background: var(--gray-100); color: var(--primary); }
.dropdown-item i { width: 20px; }

/* Toast Notifications */
.toast {
    position: fixed;
    top: 30px;
    right: 30px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-left: 5px solid var(--success);
    padding: 20px 30px;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 9999;
    transform: translateX(120%);
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.toast.active { transform: translateX(0); }
.toast i { font-size: 1.5rem; color: var(--success); }
.toast-content { display: flex; flex-direction: column; }
.toast-title { font-weight: 800; color: var(--dark); font-size: 1.1rem; }
.toast-msg { color: var(--gray-600); font-size: 0.9rem; }

/* Unified Report Modal Styles */
.report-tabs {
    display: flex;
    background: var(--gray-100);
    padding: 6px;
    border-radius: 18px;
    gap: 6px;
}
.report-tab {
    flex: 1;
    padding: 12px;
    text-align: center;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--gray-600);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.report-tab i { font-size: 1rem; }
.report-tab.active {
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
#tab-new.active { color: #0f766e; }
#tab-new.active i { color: #10b981; }
#tab-lost.active { color: #c2410c; }
#tab-lost.active i { color: #ef4444; }
.report-tab:not(.active):hover {
    background: rgba(255,255,255,0.5);
    color: var(--dark);
}
@keyframes floatHeart {
    0% { transform: translateY(0) scale(1); opacity: 1; }
    100% { transform: translateY(-40px) scale(1.5); opacity: 0; }
}
.floating-heart {
    position: absolute;
    color: var(--accent);
    pointer-events: none;
    animation: floatHeart 1s ease-out forwards;
}

/* Lost Mode Theme */
.report-modal-content.lost-mode {
    border-top: 5px solid var(--danger);
}
.report-modal-content.lost-mode .report-tab.active {
    color: var(--danger);
}
.report-modal-content.lost-mode #report-title {
    color: var(--danger);
}
.report-modal-content.lost-mode #btn-report-submit {
    background: var(--danger);
}
.report-modal-content.lost-mode #report-file-zone {
    border-color: rgba(239, 68, 68, 0.2);
    background: #fef2f2;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.report-modal-content {
    animation: modalFadeIn 0.4s ease-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-10px); }
    40%, 80% { transform: translateX(10px); }
}