/* ==========================================================================
   MULTIS.ES - UNIFIED PREMIUM DESIGN SYSTEM (SLATE DARK THEME)
   ========================================================================== */

:root {
    /* Base configuration (Structural) */
    --nav-height: 64px;
    --search-height: 68px;
    --font-stack: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    /* Theme colors (Defaults to Dark Theme) */
    --primary: #4f46e5;
    --primary-light: #6366f1;
    --primary-dark: #3730a3;
    --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);
    
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --bg-header: #334155;
    --bg-input: #0f172a;
    --bg-hover: rgba(255, 255, 255, 0.05);
    --bg-hover-more: rgba(255, 255, 255, 0.1);
    --bg-hover-subtle: rgba(255, 255, 255, 0.02);
    --bg-subtle: rgba(255, 255, 255, 0.02);
    --bg-glass: rgba(30, 41, 59, 0.75);
    --bg-drawer: rgba(30, 41, 59, 0.95);
    --bg-overlay: rgba(15, 23, 42, 0.6);
    --bg-station: rgba(0, 0, 0, 0.1);
    --bg-detail: rgba(0, 0, 0, 0.15);
    --bg-collapse-summary: rgba(79, 70, 229, 0.1);
    --bg-line-filters: rgba(30, 41, 59, 0.4);
    
    --text-main: #f8fafc;
    --text-muted: #cbd5e1;
    --text-dark: #0f172a;
    --text-accent: #a5b4fc;
    --text-alias: #a0aec0;
    --text-on-primary: #ffffff;
    
    --border-color: #334155;
    --border-color-light: #475569;
    --border-subtle: rgba(255, 255, 255, 0.12);
    --border-line-filters: var(--border-color);
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.15);
    --danger-text: #fc8181;
    --danger-border: rgba(239, 68, 68, 0.3);
    --warning-bg: rgba(245, 158, 11, 0.15);
    --warning-border: rgba(245, 158, 11, 0.3);
    
    --badge-esc-bg: rgba(245, 158, 11, 0.15);
    --badge-esc-text: var(--warning);
    --badge-esc-border: rgba(245, 158, 11, 0.3);
    --badge-ibt-bg: rgba(59, 130, 246, 0.15);
    --badge-ibt-text: #60a5fa;
    --badge-ibt-border: rgba(59, 130, 246, 0.3);

    --logo-shadow: drop-shadow(0 0 8px rgba(255,255,255,0.1));
    
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
    --shadow-primary: 0 4px 15px rgba(79, 70, 229, 0.35);
    --shadow-primary-hover: 0 6px 20px rgba(79, 70, 229, 0.5);
    --shadow-brand: 0 0 15px rgba(79, 70, 229, 0.4);
    --shadow-brand-text: 0 0 10px rgba(79, 70, 229, 0.5);
    --shadow-input: inset 0 2px 4px rgba(0,0,0,0.1);
    --shadow-input-focus: 0 0 0 3px rgba(99, 102, 241, 0.2);
    --shadow-drawer: 4px 0 30px rgba(0,0,0,0.5);

    /* Navbar / Shortcut icon states */
    --border-icon-hover: rgba(99, 102, 241, 0.6);
    --bg-icon-hover: rgba(99, 102, 241, 0.15);
    --text-icon-hover: #a5b4fc;
    --shadow-icon-hover: 0 0 10px rgba(99, 102, 241, 0.3);
    
    --shadow-icon-active: 0 0 8px rgba(255, 255, 255, 0.15);

    /* Drawer Active styles */
    --border-drawer-active: none;
    --shadow-drawer-active: 0 4px 12px rgba(79, 70, 229, 0.25);
    --text-shadow-drawer-active: none;
    --font-weight-drawer-active: 600;

    /* Station Selected styles */
    --bg-station-selected: rgba(79, 70, 229, 0.1);
    --border-station-selected: rgba(79, 70, 229, 0.3);

    /* Filter buttons */
    --filter-btn-opacity-inactive: 0.5;
    --filter-btn-all-bg: rgba(255, 255, 255, 0.08);
    --filter-btn-all-text: var(--text-muted);
    --filter-btn-all-border: var(--border-color);

    /* Manufacturer Badges */
    --style-default-bg: rgba(79, 70, 229, 0.15);
    --style-default-text: #818cf8;
    --style-default-border: rgba(79, 70, 229, 0.3);
    --style-ft-bg: rgba(59, 130, 246, 0.15);
    --style-ft-text: #60a5fa;
    --style-ft-border: rgba(59, 130, 246, 0.3);
    --style-avante-bg: rgba(6, 182, 212, 0.15);
    --style-avante-text: #22d3ee;
    --style-avante-border: rgba(6, 182, 212, 0.3);
    --style-kone-bg: rgba(16, 185, 129, 0.15);
    --style-kone-text: #34d399;
    --style-kone-border: rgba(16, 185, 129, 0.3);

    /* Code block */
    --code-bg: rgba(0,0,0,0.2);
    --code-bg-active: rgba(0,0,0,0.4);
    --code-text: #a5b4fc;
    --code-shadow: 0 0 15px rgba(165, 180, 252, 0.4);

    /* Secondary button styling */
    --bg-btn-secondary: var(--bg-card);
    --text-btn-secondary: var(--text-main);
    --border-btn-secondary: var(--border-color);
    --bg-btn-secondary-hover: rgba(255, 255, 255, 0.05);

    /* PWA install banner */
    --bg-pwa-banner: rgba(30, 41, 59, 0.85);
    --border-pwa-banner: rgba(255, 255, 255, 0.12);
    --text-pwa-banner-title: #ffffff;
    --text-pwa-banner-desc: #cbd5e1;
    --bg-pwa-btn-close: rgba(255, 255, 255, 0.1);
    --text-pwa-btn-close: #ffffff;
    --bg-pwa-btn-close-hover: rgba(255, 255, 255, 0.2);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

body {
    font-family: var(--font-stack);
    background-color: var(--bg-body);
    color: var(--text-main);
    margin: 0;
    padding-bottom: 90px;
    line-height: 1.5;
}

/* ==========================================================================
   GLASSMORPHIC NAVIGATION
   ========================================================================== */
.nav-bar {
    background: var(--bg-glass);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    height: var(--nav-height);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.nav-container {
    max-width: 800px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
}

.nav-brand {
    font-size: 24px;
    font-weight: 800;
    text-decoration: none;
    color: var(--text-main);
    background: var(--primary-gradient);
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    box-shadow: var(--shadow-brand);
}

.nav-links {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-grow: 1;
    justify-content: center;
    margin: 0 15px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-link i {
    font-size: 14px;
}

.nav-link:hover {
    color: var(--text-main);
    background: var(--bg-hover);
}

.nav-link.active {
    color: var(--text-on-primary);
    background: var(--primary-gradient);
    box-shadow: var(--shadow-primary);
}

.nav-logout {
    color: var(--danger);
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    text-decoration: none;
    flex-shrink: 0; /* Prevents squishing and keeps it perfectly square */
}

.nav-logout:hover {
    background: var(--danger);
    color: var(--text-on-primary);
}

@media (max-width: 600px) {
    .nav-link span {
        display: none; /* Icon-only on small mobiles for clean view */
    }
    .nav-link {
        padding: 10px;
    }
}

/* ==========================================================================
   LAYOUT STRUCTURE
   ========================================================================== */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 15px;
}

.project-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
}

.header-logo {
    height: 38px;
    width: auto;
    filter: var(--logo-shadow);
}

/* ==========================================================================
   LOGIN SCREEN
   ========================================================================== */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: var(--bg-body);
}

.login-card {
    padding: 40px 30px;
    border-radius: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
}

.login-header-custom {
    text-align: center;
    margin-bottom: 30px;
}

.login-main-image {
    max-width: 260px;
    height: auto;
    border-radius: 12px;
    margin-bottom: 20px;
}

.login-brand-logo {
    font-size: 48px;
    font-weight: 900;
    color: var(--text-on-primary);
    text-shadow: var(--shadow-brand-text);
    margin-bottom: 10px;
}

.login-text-por {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.login-logo-ugt {
    height: 18px;
    width: auto;
    opacity: 0.8;
}

.login-title {
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 25px;
    color: var(--text-main);
}

.input-with-icon {
    position: relative;
}

.input-with-icon i,
.input-with-icon iconify-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.input-with-icon input {
    padding-left: 40px !important;
}

/* ==========================================================================
   FORMS & INPUTS
   ========================================================================== */
.form-group {
    margin-bottom: 22px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-wrapper {
    position: sticky;
    top: var(--nav-height);
    z-index: 900;
    background-color: var(--bg-body);
    height: var(--search-height);
    padding: 12px 0;
}

.search-input {
    width: 100%;
    height: 46px;
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-main);
    font-size: 15px;
    outline: none;
    font-family: inherit;
    box-shadow: var(--shadow-input);
}

.search-input:focus {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-input-focus), var(--shadow-input);
}

/* ==========================================================================
   LISTS & ACCORDIONS (PREMIUM LOOK)
   ========================================================================== */
.list-group {
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    margin-bottom: 25px;
    overflow: visible; /* Allowed visible globally so sticky headers work on all directory/code/error lists */
}

/* Clean border-radius clipping for sticky headers and items when parent overflow is visible */
.list-group > .category-group:first-child > .list-header,
.list-group > .list-item:first-child,
.list-group > a.list-item:first-child {
    border-top-left-radius: 11px;
    border-top-right-radius: 11px;
}

.list-group > .category-group:last-child > .list-item:last-child,
.list-group > .list-item:last-child,
.list-group > a.list-item:last-child {
    border-bottom-left-radius: 11px;
    border-bottom-right-radius: 11px;
}

.list-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
    color: inherit;
    justify-content: space-between;
}

.list-item:last-child {
    border-bottom: none;
}

.list-item:hover {
    background: var(--bg-hover-subtle);
    transform: translateX(4px);
}

.list-header {
    background-color: var(--bg-header);
    color: var(--text-main);
    padding: 12px 20px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: calc(var(--nav-height) + var(--search-height));
    z-index: 800;
}

.item-code {
    padding: 6px 10px;
    border-radius: 6px;
    font-weight: 700;
    font-family: monospace;
    font-size: 14px;
    margin-right: 15px;
    min-width: 55px;
    text-align: center;
}

.item-text {
    flex-grow: 1;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
}

.item-text iconify-icon, .item-text i {
    width: 1.4rem;
    height: 1.4rem;
    font-size: 1.4rem;
    margin-right: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transform: translateY(1.5px);
}

/* Manufacturer Styles */
.style-default { background-color: var(--style-default-bg); color: var(--style-default-text); border: 1px solid var(--style-default-border); }
.style-ft { background-color: var(--style-ft-bg); color: var(--style-ft-text); border: 1px solid var(--style-ft-border); }
.style-avante { background-color: var(--style-avante-bg); color: var(--style-avante-text); border: 1px solid var(--style-avante-border); }
.style-kone { background-color: var(--style-kone-bg); color: var(--style-kone-text); border: 1px solid var(--style-kone-border); }

/* Details/Accordions */
details {
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-card);
}

details:last-of-type {
    border-bottom: none;
}

summary {
    padding: 16px 20px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

summary::-webkit-details-marker {
    display: none;
}

summary::after {
    content: '\25BC';
    font-size: 10px;
    color: var(--text-muted);
    transition: transform 0.2s;
}

details[open] summary::after {
    transform: rotate(180deg);
}

.detalle-escalera {
    padding: 20px;
    background: var(--bg-detail);
    border-top: 1px solid var(--border-color);
    font-size: 14px;
}

/* Collapsible form card */
.form-collapse {
    margin-bottom: 25px;
    background: var(--bg-card);
    border-radius: 12px;
    border: 2px dashed var(--primary) !important;
    overflow: hidden;
}

.form-collapse summary {
    background: var(--bg-collapse-summary);
    color: var(--primary-light);
    padding: 16px;
    font-weight: 700;
    font-size: 15px;
    justify-content: center;
    gap: 8px;
}

.form-collapse summary::after {
    display: none;
}

.form-tarjeta {
    padding: 24px;
}

.form-tarjeta h2 {
    color: var(--primary-light);
    text-align: center;
    font-size: 20px;
    margin-top: 0;
    margin-bottom: 20px;
    font-weight: 700;
    text-transform: uppercase;
}

.form-tarjeta label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    display: block;
    margin-top: 12px;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.foto-actual {
    max-width: 100%;
    max-height: 250px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

/* ==========================================================================
   BADGES & CHIPS
   ========================================================================== */
.station-badges {
    display: flex;
    gap: 6px;
}

.badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-esc {
    background: var(--badge-esc-bg);
    color: var(--badge-esc-text);
    border: 1px solid var(--badge-esc-border);
}

.badge-ibt {
    background: var(--badge-ibt-bg);
    color: var(--badge-ibt-text);
    border: 1px solid var(--badge-ibt-border);
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
}

.btn-primary {
    background: var(--primary-gradient);
    color: var(--text-on-primary);
    box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
    box-shadow: var(--shadow-primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-btn-secondary-hover);
}

.btn-warning {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid var(--warning-border);
}

.btn-warning:hover {
    background: var(--warning);
    color: var(--bg-body);
}

/* ==========================================================================
   METRO DIRECTORY (TABS & GRID)
   ========================================================================== */
.directory-tabs-container {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 6px;
    border: 1px solid var(--border-color);
}

.directory-tabs {
    display: flex;
    gap: 4px;
}

.directory-tab-btn {
    flex: 1;
    text-align: center;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    padding: 10px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.directory-tab-btn:hover {
    color: var(--text-main);
    background: var(--bg-hover);
}

.directory-tab-btn.active {
    background: var(--primary-gradient);
    color: var(--text-on-primary);
}

.directory-tab-btn iconify-icon, .directory-tab-btn i {
    width: 1.25rem;
    height: 1.25rem;
    font-size: 1.25rem;
    transform: translateY(1px);
}

@media (max-width: 600px) {
    .directory-tab-btn {
        flex-direction: column;
        gap: 2px;
        font-size: 11px;
        padding: 8px 4px;
    }
    .directory-tab-btn iconify-icon, .directory-tab-btn i {
        width: 1.15rem;
        height: 1.15rem;
        font-size: 1.15rem;
        transform: none;
    }
    .grid-container {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 8px !important;
    }
    .linea-card {
        font-size: 20px !important;
        border-radius: 8px !important;
    }
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 14px;
}

.linea-card {
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-weight: 800;
    font-size: 32px;
    border: 2px solid;
    box-shadow: var(--shadow-md);
}

.linea-card:hover {
    transform: scale(1.08);
}

/* ==========================================================================
   METRO LINE LAYOUT
   ========================================================================== */
.linea-layout {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 20px;
    margin-top: 15px;
}

@media (max-width: 768px) {
    .linea-layout {
        grid-template-columns: 1fr;
    }
}

.estaciones-column {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 15px;
    height: fit-content;
}

.order-toggle-container {
    margin-bottom: 12px;
    text-align: right;
}

.order-toggle {
    color: var(--primary-light);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.estaciones-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}

.estaciones-list::before {
    content: '';
    position: absolute;
    top: 25px;
    bottom: 25px;
    left: 20px;
    width: 10px;
    box-sizing: border-box;
    border-left: 2px solid var(--line-border-color, #ffffff);
    border-right: 2px solid var(--line-border-color, #ffffff);
    background-color: var(--line-color);
    z-index: 1;
}

.estacion-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 8px;
    background: var(--bg-station);
    cursor: pointer;
    border: 1px solid transparent;
    position: relative;
}

.estacion-item:hover {
    background: var(--bg-hover-subtle);
}

.estacion-item.selected {
    background: var(--bg-station-selected);
    border-color: var(--border-station-selected);
}

/* Override details elements with .estacion-item class to behave as block dropdowns */
details.estacion-item {
    display: block;
    padding: 0;
}

details.estacion-item:hover {
    background: var(--bg-station);
}

details.estacion-item summary:hover {
    background: var(--bg-hover-subtle);
}

.estacion-marker {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 3px solid var(--line-border-color, #ffffff);
    background-color: var(--line-color);
    margin-right: 12px;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
    box-shadow: 0 0 6px rgba(0,0,0,0.3);
}

.estacion-nombre {
    font-weight: 600;
    font-size: 14px;
    flex-grow: 1;
}

.estacion-lineas {
    display: flex;
    gap: 4px;
}

.linea-indicator {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    text-align: center;
    line-height: 1;
}

/* Contacts Layout */
.contactos-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contactos-list {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 20px;
}

.contacto-item {
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.contacto-item:last-child {
    border-bottom: none;
}

.contacto-nombre {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 8px;
    color: var(--text-main);
}

.contacto-item a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-light);
    text-decoration: none;
    margin-bottom: 6px;
    font-size: 14px;
    width: fit-content;
}

.contacto-item a:hover {
    text-decoration: underline;
}

.contacto-item a i {
    color: var(--text-muted);
}

.btn-ver-estacion {
    background: var(--primary-gradient);
    color: var(--text-on-primary) !important;
    text-align: center;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    display: block !important;
    text-decoration: none !important;
    box-shadow: var(--shadow-primary);
}

.btn-ver-estacion:hover {
    box-shadow: var(--shadow-primary-hover);
}

/* ==========================================================================
   GENERADOR (WIZARD STEPS)
   ========================================================================== */
.step {
    display: none;
}

.step.active {
    display: block;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-container {
    background: var(--bg-card);
    padding: 24px;
    border-radius: 16px;
    text-align: center;
    border: 2px dashed var(--primary);
    box-shadow: var(--shadow-md);
    margin: 20px 0;
}

.final-code {
    display: inline-block;
    font-family: monospace;
    font-size: 44px;
    font-weight: 800;
    color: var(--code-text);
    text-shadow: var(--code-shadow);
    margin: 15px 0;
    letter-spacing: 2px;
    cursor: pointer;
    padding: 12px;
    border-radius: 10px;
    background: var(--code-bg);
    border: 1px solid var(--border-color);
}

.final-code:active {
    transform: scale(0.96);
    background: var(--code-bg-active);
}

.summary-item {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    padding: 10px 0;
    font-size: 14px;
}

.summary-label {
    color: var(--text-muted);
}

.summary-val {
    font-weight: 600;
    color: var(--text-main);
    text-align: right;
}

.alert-error {
    background-color: var(--danger-bg);
    color: var(--danger-text);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: bold;
    font-size: 14px;
    border: 1px solid var(--danger-border);
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.controls-inline {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

/* Component alias style and mobile hide rule */
.component-alias {
    font-size: 0.85em;
    font-style: italic;
    color: var(--text-alias);
    margin-top: 2px;
}

@media (max-width: 768px) {
    .component-alias {
        display: none !important;
    }
}

/* Style for Iconify SVGs to make them sleek, readable, and premium */
svg.iconify, .iconify, iconify-icon {
    display: inline-block;
    width: 1.15em;
    height: 1.15em;
    vertical-align: -0.2em; /* pulled down slightly for general inline texts */
    color: currentColor;
}

/* Specific adjustments for navbar and buttons */
.nav-link svg.iconify, .nav-link .iconify, .nav-link iconify-icon {
    width: 2.1rem;
    height: 2.1rem;
    font-size: 2.1rem; /* Forces the internal SVG (1em) to scale to 100% of the box */
    margin: 0;
    vertical-align: middle;
    /* Circular border & background */
    padding: 4px;
    border-radius: 50%;
    border: 1.5px solid var(--border-subtle);
    background: var(--bg-subtle);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: content-box;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(1px);
}

.nav-link:hover svg.iconify, .nav-link:hover .iconify, .nav-link:hover iconify-icon {
    border-color: var(--border-icon-hover);
    background: var(--bg-icon-hover);
    color: var(--text-icon-hover);
    transform: translateY(1px) scale(1.1);
    box-shadow: var(--shadow-icon-hover);
}

.nav-link.active svg.iconify, .nav-link.active .iconify, .nav-link.active iconify-icon {
    border-color: var(--border-icon-active);
    background: var(--bg-icon-active);
    color: var(--text-icon-active);
    box-shadow: var(--shadow-icon-active);
}

.btn svg.iconify, .btn .iconify, .btn iconify-icon {
    width: 1.1rem;
    height: 1.1rem;
    font-size: 1.1rem;
    margin: 0;
    vertical-align: middle;
    transform: translateY(1.5px);
}

.line-header-banner svg.iconify, .line-header-banner .iconify, .line-header-banner iconify-icon {
    width: 1.8rem;
    height: 1.8rem;
    font-size: 1.8rem;
    margin: 0;
    vertical-align: middle;
    transform: translateY(1.5px);
}

.nav-logout iconify-icon {
    width: 1.4rem;
    height: 1.4rem;
    font-size: 1.4rem; /* Scales the SVG inside shadow DOM */
    transition: transform 0.2s ease;
}

.nav-logout:hover iconify-icon {
    transform: scale(1.15);
}



/* ==========================================================================
   PWA INSTALL BANNER
   ========================================================================== */
.pwa-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(120px);
    width: calc(100% - 30px);
    max-width: 500px;
    background: var(--bg-pwa-banner);
    border: 1px solid var(--border-pwa-banner);
    border-radius: 16px;
    padding: 15px;
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.pwa-banner.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.pwa-banner-title {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-pwa-banner-title);
}

.pwa-banner-desc {
    font-size: 11px;
    color: var(--text-pwa-banner-desc);
}

.pwa-btn-close {
    background: var(--bg-pwa-btn-close);
    border: none;
    color: var(--text-pwa-btn-close);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.pwa-btn-close:hover {
    background: var(--bg-pwa-btn-close-hover);
}

.pwa-btn-install {
    background: var(--primary-gradient);
    border: none;
    color: var(--text-on-primary);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-primary);
    transition: transform 0.2s, box-shadow 0.2s;
}

.pwa-btn-install:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-primary-hover);
}



/* ==========================================================================
   HAMBURGER MENU DRAWER & CENTER SHORTCUTS
   ========================================================================= */
.nav-menu-btn {
    color: var(--text-muted);
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-menu-btn:hover {
    color: var(--text-main);
    background: var(--bg-hover-more);
}

.nav-menu-btn iconify-icon {
    width: 1.4rem;
    height: 1.4rem;
    font-size: 1.4rem;
}

/* Shortcuts container */
.nav-shortcuts {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
}

.nav-shortcut {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--border-subtle);
    background: var(--bg-subtle);
    flex-shrink: 0;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-shortcut iconify-icon {
    width: 1.4rem;
    height: 1.4rem;
    font-size: 1.4rem;
}

.nav-shortcut:hover {
    border-color: var(--border-icon-hover);
    background: var(--bg-icon-hover);
    color: var(--text-icon-hover);
    transform: scale(1.05);
    box-shadow: var(--shadow-icon-hover);
}

.nav-shortcut.active {
    border-color: transparent;
    background: var(--primary-gradient);
    color: var(--text-on-primary);
    box-shadow: var(--shadow-icon-active);
}

/* Drawer Navigation Styles */
.menu-drawer {
    position: fixed;
    top: 0;
    left: -280px; /* Hidden offscreen by default */
    width: 280px;
    height: 100vh;
    background: var(--bg-drawer);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    z-index: 10000;
    box-shadow: var(--shadow-drawer);
    border-right: 1px solid var(--border-color);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.menu-drawer.open {
    transform: translateX(280px); /* Slide in */
}

.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-overlay);
    backdrop-filter: blur(2px);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.drawer-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.drawer-header {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}

.drawer-logo {
    height: 32px;
    width: auto;
}

.drawer-close-btn {
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.drawer-close-btn:hover {
    background: var(--bg-hover-more);
}

.drawer-content {
    padding: 20px;
    overflow-y: auto;
    flex-grow: 1;
}

.drawer-section {
    margin-bottom: 25px;
}

.drawer-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--primary-light);
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.drawer-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    border-radius: 8px;
    margin-bottom: 6px;
    transition: all 0.2s ease;
}

.drawer-link iconify-icon {
    font-size: 1.3rem;
    width: 1.3rem;
    height: 1.3rem;
}

.drawer-link:hover {
    color: var(--text-main);
    background: var(--bg-hover);
}

.drawer-link.active {
    color: var(--text-on-primary);
    background: var(--primary-gradient);
    border-left: var(--border-drawer-active);
    box-shadow: var(--shadow-drawer-active);
    text-shadow: var(--text-shadow-drawer-active);
    font-weight: var(--font-weight-drawer-active, 600);
}

/* ==========================================================================
   LINE FILTER BUTTONS
   ========================================================================== */
.line-filters {
    background: var(--bg-line-filters);
    border: 1px solid var(--border-line-filters);
}

.filter-btn {
    border: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    height: 34px;
}

.filter-btn-all {
    padding: 0 12px;
}

.filter-btn-all:not(.active) {
    background: var(--filter-btn-all-bg);
    color: var(--filter-btn-all-text);
    border: 1px solid var(--filter-btn-all-border);
}

.filter-btn-all.active {
    background: var(--primary-gradient);
    color: var(--text-on-primary);
    border: 1px solid transparent;
}

.filter-btn[data-line]:not([data-line="all"]) {
    width: 34px;
    padding: 0;
}

.filter-btn:not(.active) {
    opacity: var(--filter-btn-opacity-inactive);
}

.filter-btn.active {
    opacity: 1;
    transform: scale(1.05);
    box-shadow: var(--shadow-primary);
}


