/* ✨ ENCHANTING UI THEME - CivicFix 2.0 ✨ */
:root {
    --primary-color: #2E7D32;       /* Deep Eco Green */
    --primary-hover: #1B5E20;       /* Darker Green for hover */
    --accent-color: #81C784;        /* Soft Green */
    --accent-glow: rgba(129, 199, 132, 0.4);
    --gold-color: #FFD700;          /* For Points/Awards */
    --danger-color: #E53935;        /* For Alerts/Logout */
    
    /* Magical Gradient Background */
    --bg-gradient: linear-gradient(135deg, #e0f7fa 0%, #e8f5e9 50%, #f1f8e9 100%);
    
    /* Glassmorphism Variables */
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.6);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    padding-top: 76px; /* Adjusted for taller navbar */
    color: #333;
    overflow-x: hidden; /* Prevent horizontal scroll */
    -webkit-font-smoothing: antialiased; /* Smoother text */
}

/* 🌿 Navbar Styling - Floating & Glassy */
.navbar {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    padding: 12px 0;
    transition: all 0.3s ease;
}

.navbar-brand {
    font-weight: 700;
    color: var(--primary-color) !important;
    font-size: 1.6rem;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-brand i {
    font-size: 1.8rem;
    background: -webkit-linear-gradient(45deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-link {
    color: #555 !important;
    font-weight: 500;
    font-size: 0.95rem;
    margin: 0 5px;
    padding: 8px 16px !important;
    border-radius: 50px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover, .nav-link.active {
    color: var(--primary-color) !important;
    background: rgba(46, 125, 50, 0.08);
    transform: translateY(-1px);
}

/* 🏅 Civic Points Badge Styling */
.civicpoint {
    color: white;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--primary-color), #43A047);
    border-radius: 30px 0 0 30px;
    box-shadow: 4px 0 15px rgba(46, 125, 50, 0.3);
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.civicpointvalue {
    color: var(--primary-color);
    background: #fff;
    font-weight: 800;
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    border: 2px solid var(--primary-color);
    border-left: none;
    border-radius: 0 30px 30px 0;
    box-shadow: inset 2px 2px 5px rgba(0,0,0,0.05);
}

/* 🎠 Carousel Styling - Full Width & Immersive */
.carousel-item img {
    height: 500px; /* Increased height */
    object-fit: cover;
    filter: brightness(0.65) contrast(1.1);
    border-radius: 0 0 40px 40px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
}

.carousel-caption {
    bottom: 20%;
}

.carousel-caption h2 {
    font-weight: 800;
    font-size: 3.5rem;
    text-shadow: 0 4px 15px rgba(0,0,0,0.4);
    letter-spacing: -1px;
    margin-bottom: 1rem;
}

.carousel-caption p {
    font-size: 1.2rem;
    background: rgba(0, 0, 0, 0.4);
    display: inline-block;
    padding: 8px 20px;
    border-radius: 50px;
    backdrop-filter: blur(5px);
}

/* ✨ Glass Card Styling (The Enchanting Part) */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--glass-shadow);
    padding: 40px;
    max-width: 600px;
    margin: auto;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
    position: relative;
    overflow: hidden;
}

/* Adds a subtle shiny gradient overlay on hover */
.glass-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: 0.5s;
}

.glass-card:hover::before {
    left: 100%;
}

.glass-card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 20px 40px rgba(0,0,0,0.12);
    border-color: #fff;
}

/* 🚀 Enchanting Buttons */
.btn-enchanting {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    border: none;
    color: white;
    padding: 12px 35px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50px;
    box-shadow: 0 10px 20px rgba(46, 125, 50, 0.25);
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.btn-enchanting::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--primary-color) 100%);
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
}

.btn-enchanting:hover::after {
    opacity: 1;
}

.btn-enchanting:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(46, 125, 50, 0.4);
    color: white;
}

.btn-enchanting:active {
    transform: translateY(1px);
}

/* 📸 Image Preview Styling */
#preview {
    width: 100%;
    max-height: 350px;
    object-fit: cover;
    border-radius: 20px;
    display: none;
    margin-bottom: 25px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    border: 4px solid white;
}

/* ⏳ Loading & Result Styling */
#loading { 
    display: none; 
    color: var(--primary-color); 
    font-weight: 600; 
    margin-top: 15px;
}

#result { 
    display: none; 
    text-align: left; 
    background: #ffffff; 
    padding: 25px; 
    border-radius: 20px; 
    margin-top: 25px; 
    border-left: 6px solid var(--primary-color);
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    animation: slideUp 0.5s ease;
}

/* 🏆 Leaderboard Table Styling */
.table-responsive {
    background: white;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.02);
}

.table thead {
    background: linear-gradient(90deg, #f8f9fa, #e8f5e9);
}

.table thead th {
    font-weight: 700;
    color: var(--primary-color);
    border-bottom: none;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 0.85rem;
}

.table tbody tr {
    transition: background 0.2s;
}

.table tbody tr:hover {
    background-color: #f1f8e9; /* Light green hover */
}

/* 📍 Map Container */
#civicMap {
    border-radius: 24px;
    border: 4px solid white;
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

/* 🚪 Inputs styling */
.form-control.rounded-pill, .form-select.rounded-pill {
    background: #f8f9fa;
    border: 2px solid transparent;
    transition: all 0.3s;
    font-size: 1rem;
}

.form-control.rounded-pill:focus, .form-select.rounded-pill:focus {
    background: white;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

/* Section Visibility Helpers & Animations */
.section-view { display: none; }
.section-view.active { display: block; animation: fadeIn 0.6s cubic-bezier(0.22, 1, 0.36, 1); }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(30px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: #f1f1f1; 
}
::-webkit-scrollbar-thumb {
    background: #81C784; 
    border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
    background: #2E7D32; 
}

/* Mobile Tweaks */
@media (max-width: 768px) {
    .carousel-item img { height: 300px; }
    .carousel-caption h2 { font-size: 2rem; }
    .glass-card { padding: 25px; }
    .navbar-collapse {
        background: rgba(255,255,255,0.95);
        border-radius: 20px;
        padding: 20px;
        margin-top: 15px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    }
}