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

:root {
    --bg-primary: #09090b;
    --bg-secondary: #0f0f11;
    --bg-card: #151518;
    --bg-input: #18181b;
    --border-color: #27272a;
    --border-focus: #52525b;
    --text-primary: #f4f4f5;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    
    --primary-gradient: #2563eb;
    --hover-gradient: #1d4ed8;
    --accent-color: #10b981;
    --accent-gradient: #059669;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-glow: none;
    
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --transition-smooth: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Resetari globale si stiluri de baza */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Personalizare scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Tipografie */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.025em;
    margin-bottom: 0.5em;
}

p {
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
}

a {
    color: #6366f1;
    text-decoration: none;
    transition: var(--transition-smooth);
}
a:hover {
    color: #818cf8;
}

/* Antet (Header si Navigatie) */
header {
    background: rgba(12, 16, 31, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0.8rem 5%;
    transition: var(--transition-smooth);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-gradient {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.brand-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-weight: 600;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-links a {
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    transition: var(--transition-smooth);
    font-size: 0.95rem;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--text-primary);
    background: var(--bg-input);
}

.nav-login-btn {
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.03);
}

.nav-login-btn:hover {
    border-color: var(--border-focus);
    box-shadow: var(--shadow-glow);
}

/* Meniu hamburger pentru mobil */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 101;
}

.hamburger {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    position: relative;
    transition: var(--transition-smooth);
}

.hamburger::before, .hamburger::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition-smooth);
}

.hamburger::before { top: -8px; }
.hamburger::after { bottom: -8px; }

.nav-toggle.active .hamburger {
    background: transparent;
}
.nav-toggle.active .hamburger::before {
    transform: rotate(45deg);
    top: 0;
}
.nav-toggle.active .hamburger::after {
    transform: rotate(-45deg);
    bottom: 0;
}

/* Sectiune introducere (Home Page) */
.intro {
    text-align: center;
    max-width: 800px;
    margin: 80px auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.intro h1 {
    font-size: 3.2rem;
    font-weight: 800;
    line-height: 1.15;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.intro p {
    font-size: 1.25rem;
    max-width: 600px;
    margin-bottom: 2.5rem;
}

/* Layout general continut */
.content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 5%;
    flex: 1;
    width: 100%;
}

.content h1 {
    font-size: 2.2rem;
    margin-bottom: 2rem;
    position: relative;
    display: inline-block;
}


/* Butoane */
.btn {
    background: var(--primary-gradient);
    color: var(--text-primary);
    padding: 0.8rem 1.6rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
}

.btn:hover {
    background: var(--hover-gradient);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
    color: var(--text-primary);
}

.btn:active {
    transform: translateY(0);
}

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

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text-secondary);
    box-shadow: none;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
}

/* Filtre si Formulare */
.filters {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 1.75rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 2.5rem;
    position: relative;
    overflow: hidden;
}



#search-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-group select, .filter-group input {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.8rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-family: var(--font-sans);
    outline: none;
    transition: var(--transition-smooth);
    width: 100%;
}

.filter-group select:focus, .filter-group input:focus {
    border-color: var(--border-focus);
    box-shadow: var(--shadow-glow);
}

/* Sectiunea rezultate */
.results-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    min-height: 250px;
}

.results-table-wrapper {
    overflow-x: auto;
    margin-top: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.results-table th, .results-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
}

.results-table th {
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
}

.results-table tr {
    transition: var(--transition-smooth);
}

.results-table tr:last-child td {
    border-bottom: none;
}

.results-table tbody tr:hover {
    background-color: rgba(99, 102, 241, 0.04);
}

/* Grila dashboard statistici */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: var(--transition-smooth);
}

.stat-card:hover {
    border-color: var(--border-focus);
}

.chart-placeholder {
    min-height: 260px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

/* Liste statistici si bare de progres */
.stats-list {
    list-style: none;
    margin-top: 1.5rem;
}

.stats-list li {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.stats-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.stats-list li:first-child {
    padding-top: 0;
}

.stat-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.progress-bar-bg {
    background: var(--bg-input);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    background: var(--primary-gradient);
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s cubic-bezier(0.1, 0.8, 0.25, 1);
}

.badge {
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
}

.badge.pos {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-color);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge.neg {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger-color);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.summary {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.5rem;
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.summary p {
    margin: 0;
}

/* Pagina login administrator */
.admin-form {
    max-width: 480px;
    margin: 60px auto;
}

.form-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.form-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.form-group input {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.8rem 1rem;
    border-radius: var(--radius-md);
    font-size: 1rem;
    outline: none;
    transition: var(--transition-smooth);
}

.form-group input:focus {
    border-color: var(--border-focus);
    box-shadow: var(--shadow-glow);
}

.error-msg {
    color: var(--danger-color);
    margin-top: 1rem;
    font-size: 0.9rem;
    background: rgba(239, 68, 68, 0.1);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--danger-color);
}

/* Subsol pagina (Footer) */
footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 4rem 5% 2rem;
    margin-top: auto;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 4rem;
    margin-bottom: 3rem;
}

.footer-brand p {
    margin-top: 1rem;
    font-size: 0.95rem;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-links h4, .footer-meta h4 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
}

.footer-links a {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.footer-links a:hover {
    color: var(--text-primary);
    padding-left: 4px;
}

.footer-meta p {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Puncte de control responsive (Media Queries) */
@media (max-width: 992px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
    .intro h1 {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }

    .nav-links {
        position: fixed;
        top: 73px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 73px);
        background: var(--bg-secondary);
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding-top: 3rem;
        gap: 2rem;
        transition: var(--transition-smooth);
        border-top: 1px solid var(--border-color);
    }

    .nav-links.active {
        left: 0;
    }

    #search-form {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Ajustari tema intunecata pentru Leaflet */
.leaflet-popup-content-wrapper, .leaflet-popup-tip {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow-lg) !important;
}

.leaflet-popup-content h4 {
    margin-bottom: 4px !important;
}

.leaflet-container a.leaflet-popup-close-button {
    color: var(--text-secondary) !important;
    padding: 8px 10px 0 0 !important;
}

.leaflet-container a.leaflet-popup-close-button:hover {
    color: var(--text-primary) !important;
}

.leaflet-bar {
    border: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow-md) !important;
}

.leaflet-bar a {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border-bottom: 1px solid var(--border-color) !important;
    transition: var(--transition-smooth);
}

.leaflet-bar a:hover {
    background-color: var(--bg-input) !important;
    color: var(--text-primary) !important;
}

.leaflet-bar a.leaflet-disabled {
    background-color: var(--bg-primary) !important;
    color: var(--text-muted) !important;
}

/* Helper classes pentru simplificarea codului HTML */
.hidden {
    display: none !important;
}

.mb-2 {
    margin-bottom: 2rem !important;
}

.mt-2 {
    margin-top: 2rem !important;
}

.mt-1 {
    margin-top: 1rem !important;
}

.mt-1-5 {
    margin-top: 1.5rem !important;
}

.w-100 {
    width: 100% !important;
}

.btn-group {
    display: flex;
    gap: 0.5rem;
}

.btn-danger {
    background: var(--danger-color);
}

.btn-danger:hover {
    background: #dc2626;
}

.warning-msg {
    margin-bottom: 1rem;
    border-left-color: var(--warning-color);
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
    width: 100%;
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0;
}

.form-group-row {
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.5rem !important;
    margin-top: 1rem !important;
}

.form-group-row input {
    width: auto !important;
    cursor: pointer;
}

.form-group-row label {
    cursor: pointer;
    text-transform: none !important;
}

.chart-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.chart-card-header h2 {
    margin-bottom: 0 !important;
}

.chart-body {
    min-height: 350px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.map-view {
    height: 500px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    position: relative;
    background: var(--bg-primary);
}

.map-placeholder-text {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
}

.stats-grid-single {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
}

.terminal-output {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    font-family: monospace;
    font-size: 0.9rem;
    max-height: 400px;
    overflow-y: auto;
    color: #10b981;
    white-space: pre-wrap;
    word-break: break-all;
}

.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.pagination-container span {
    font-size: 0.95rem;
    color: var(--text-secondary);
}


