/*
 * v3.css
 * Core Styles — MuniQuillota Digital V.3 (Beta)
 * Based on Concejo Municipal Design System
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Outfit:wght@400;600;700&display=swap');

:root {
    --qta-blue: #004a99;
    --qta-blue-dark: #111c43;
    --qta-blue-light: #006ebf;
    --bg-light: #f8fafc;
    --white: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: rgba(0, 0, 0, 0.06);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
    --radius: 0;
}

/* Modo Oscuro - Variables */
[data-theme="dark"],
body.dark-mode {
    --bg-light: #0f172a;
    --white: #1e293b;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

body {
    background-color: var(--bg-light);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    margin: 0;
    line-height: 1.5;
    transition: background-color 0.3s, color 0.3s;
}

h1,
h2,
h3,
h4,
.outfit {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

/* ==========================================
   GLOBAL NAVBAR V3
   ========================================== */
.v3-navbar {
    background: var(--qta-blue-dark);
    background-image: linear-gradient(135deg, #111c43 0%, #1a2d6e 100%);
    padding: 0.5rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 1100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.v3-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
}

.v3-logo {
    height: 40px;
    width: auto;
}

.v3-module-info {
    display: flex;
    flex-direction: column;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    padding-left: 1rem;
    line-height: 1.2;
}

.v3-module-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.01em;
}

.v3-module-sub {
    font-size: 0.75rem;
    opacity: 0.7;
    font-weight: 400;
}

/* Mobile Toggle - Hidden by default, shown on mobile */
.v3-mobile-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    padding: 0.5rem;
    font-size: 1.25rem;
    cursor: pointer;
    border-radius: 4px;
    margin-right: 1rem;
}

/* App Switcher */
.v3-app-switcher {
    margin-left: 1.5rem;
}

.v3-switcher-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    padding: 0.4rem 0.8rem;
    border-radius: 2px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.v3-switcher-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* User Actions */
.v3-nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.v3-user-pill {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.08);
    padding: 0.4rem 0.6rem 0.4rem 0.4rem;
    border-radius: 2px;
    font-size: 0.85rem;
}

.v3-avatar {
    width: 30px;
    height: 30px;
    background: var(--qta-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
}

.v3-nav-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    cursor: pointer;
    transition: color 0.2s;
    text-decoration: none;
    padding: 0.5rem;
}

.v3-nav-btn:hover {
    color: #fff;
}

.v3-btn-exit:hover {
    color: #ff4d4d;
}

/* Dropdown Switcher Menu */
.v3-dropdown {
    position: relative;
}

.v3-dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    background: #fff;
    border-radius: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    min-width: 220px;
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.v3-dropdown.active .v3-dropdown-menu {
    display: flex;
}

.v3-dropdown-item {
    padding: 0.75rem 1.25rem;
    color: #1e293b;
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: background 0.2s;
}

.v3-dropdown-item:hover {
    background: #f1f5f9;
}

.v3-dropdown-item i {
    width: 20px;
    text-align: center;
}

/* Mobile Navigation Drawer */
.v3-mobile-nav {
    position: fixed;
    top: 60px; /* Header height */
    left: -100%;
    width: 100%;
    height: calc(100vh - 60px);
    background: #111c43;
    z-index: 1050;
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
    overflow-y: auto;
}

.v3-mobile-nav.active {
    left: 0;
}

.v3-mobile-nav-title {
    color: rgba(255,255,255,0.4);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 1.5rem 1.5rem 0.5rem;
}

.v3-mobile-nav-link {
    color: #fff;
    text-decoration: none;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 1rem;
    transition: background 0.2s;
}

.v3-mobile-nav-link:hover, 
.v3-mobile-nav-link.active {
    background: rgba(255,255,255,0.1);
}

.v3-mobile-nav-link i {
    width: 20px;
    text-align: center;
    opacity: 0.7;
}

/* Central Navigation Links */
.v3-nav-center {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    justify-content: center;
    margin: 0 1rem;
}

.v3-nav-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    border-radius: 0;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    font-weight: 500;
}

.v3-nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.v3-nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
    font-weight: 600;
}

/* Nav Dropdowns (Hover based for desktop) */
.v3-nav-dropdown {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.v3-nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    min-width: 220px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    z-index: 1200;
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: 0.5rem 0;
    margin-top: 5px; /* Subtle spacing */
}

/* Bridge to prevent menu from closing when moving mouse into it */
.v3-nav-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    height: 10px;
}

.v3-nav-dropdown:hover .v3-nav-dropdown-menu {
    display: flex;
}

.v3-nav-dropdown-item {
    padding: 0.6rem 1.25rem;
    color: #1e293b;
    text-decoration: none;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    transition: background 0.2s;
}

.v3-nav-dropdown-item:hover {
    background: #f1f5f9;
    color: var(--qta-blue);
}

.v3-nav-dropdown button.v3-nav-link {
    background: none;
    border: none;
    cursor: pointer;
}

@media (max-width: 768px) {
    .v3-nav-center {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .v3-navbar {
        padding: 0.75rem 1rem;
    }

    .v3-module-info,
    .v3-app-switcher {
        display: none !important;
    }

    .v3-mobile-toggle {
        display: block;
    }
}

/* Main Content Wrapper - Spacing */
.v3-main-content {
    padding-top: 2rem;
    padding-bottom: 4rem;
    min-height: calc(100vh - 100px);
}

@media (max-width: 768px) {
    .v3-main-content {
        padding-top: 1.5rem;
    }
}