/* Design System — TC677b, 2026-04-13 */
/* @import eliminat — design_system.css linkat explicit în index.html */

:root {
    /* Brand Colors — TopoTanc MapDesign */
    --brand-red: #bb272d;       /* roșu brand TopoTanc */
    --brand-navy: #3d52c4;
    --brand-blue: #457B9D;
    --brand-cyan: #A8DADC;
    --brand-white: #F1FAEE;

    /* Functional Colors — updated to Design System */
    --primary: var(--blue);
    --primary-alt: #2a6bb5;
    --success: var(--green);
    --warning: var(--orange);
    --error: var(--red);

    /* Layout Colors — Design System palette */
    --bg-dark: var(--bg-body);
    --surface-dark: var(--bg-card);
    --border-dark: var(--border);
    --text-main: var(--text-primary);
    --text-muted: var(--text-secondary);

    /* Glassmorphism Tokens */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-blur: blur(12px);
}

body {
    font-family: 'Jost', 'Inter', sans-serif;
    background-color: var(--bg-body) !important;  /* override Tailwind bg-background-dark */
    color: var(--text-primary) !important;         /* override Tailwind text-slate-100 */
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ==================== VIEW TRANSITIONS ==================== */

.view {
    display: none;
    animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.view.active {
    display: block;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== LOADING STATES ==================== */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(17, 22, 33, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(36, 99, 235, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    margin-top: 16px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Skeleton Loaders */
.skeleton {
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.05) 0%,
            rgba(255, 255, 255, 0.1) 50%,
            rgba(255, 255, 255, 0.05) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-card {
    height: 120px;
    margin-bottom: 16px;
}

/* ==================== BUTTON ANIMATIONS ==================== */

button,
.btn {
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

button:hover,
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

button:active,
.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Ripple Effect */
button::before,
.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button:active::before,
.btn:active::before {
    width: 300px;
    height: 300px;
}

/* ==================== CARD ANIMATIONS ==================== */

.card-hover {
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-hover:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}

/* ==================== MOBILE RESPONSIVENESS ==================== */

@media (max-width: 768px) {

    /* Sidebar becomes bottom navigation */
    .sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: auto !important;
        width: 100% !important;
        flex-direction: row !important;
        padding: 8px !important;
        z-index: 1000;
    }

    .sidebar .nav-btn-desktop {
        flex-direction: row;
        padding: 8px 12px;
        font-size: 12px;
    }

    .sidebar .nav-btn-desktop .material-symbols-outlined {
        font-size: 20px;
        margin-right: 4px;
    }

    /* Main content padding for bottom nav */
    .main-content {
        padding-bottom: 80px !important;
    }

    /* Hide desktop-only elements */
    .desktop-only {
        display: none !important;
    }

    /* Stack grid columns */
    .grid {
        grid-template-columns: 1fr !important;
    }

    /* Full width cards */
    .card,
    .bg-surface-dark {
        width: 100% !important;
    }

    /* Smaller text on mobile */
    h1 {
        font-size: 24px !important;
    }

    h2 {
        font-size: 20px !important;
    }

    h3 {
        font-size: 18px !important;
    }

    /* Touch-friendly buttons */
    button,
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
}

@media (max-width: 480px) {

    /* Extra small screens */
    .view {
        padding: 12px !important;
    }

    /* Smaller spacing */
    .space-y-6>*+* {
        margin-top: 12px !important;
    }

    /* Compact tables */
    table {
        font-size: 12px;
    }

    td,
    th {
        padding: 8px 4px !important;
    }
}

/* ==================== TOAST ANIMATIONS ==================== */

.toast-enter {
    animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-exit {
    animation: slideOutRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ==================== MODAL ANIMATIONS ==================== */

.modal-backdrop {
    animation: fadeIn 0.2s ease;
}

.modal-content {
    animation: scaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* ==================== PROGRESS INDICATORS ==================== */

.progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--brand-cyan));
    transition: width 0.3s ease;
    animation: shimmer 2s infinite;
}

/* ==================== SMOOTH SCROLLING ==================== */

html {
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border-dark);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* ==================== FOCUS STATES (Accessibility) ==================== */

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ==================== NITRO GLASSMORPHISM ==================== */

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.glass-navigation {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-border);
}

/* ==================== GLOBAL PROGRESS BAR ==================== */

#global-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--brand-red), var(--brand-cyan));
    z-index: 9999;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px var(--brand-red);
}

/* ==================== PERFORMANCE OPTIMIZATIONS ==================== */

.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

/* GPU Acceleration */
.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
}