/**
 * style.css - Styles complets pour Encrime Tracking Panel
 * Version: 2.0
 * Compatible avec panel_user.php et panel_admin.php
 */

/* ==================== RESET & BASE ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0a0c12;
    color: #e0e0e0;
    overflow-x: hidden;
    line-height: 1.5;
}

/* ==================== TYPOGRAPHIE ==================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: -0.02em;
}

h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }

a {
    color: #00f0a0;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #00d48a;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100%;
    background: #0e1118;
    border-right: 1px solid #1e2535;
    padding: 30px 20px;
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: #1a2230;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #2a3448;
    border-radius: 4px;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 40px;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Logo variation pour user vs admin */
.sidebar .logo { color: #00f0a0; }
.sidebar .logo.admin { color: #ff6b6b; }

.logo span {
    font-size: 12px;
    padding: 2px 10px;
    border-radius: 20px;
    font-weight: 500;
}

.logo span.user { background: rgba(0, 240, 160, 0.1); color: #00f0a0; }
.logo span.admin { background: rgba(255, 107, 107, 0.1); color: #ff6b6b; }

/* User badge */
.user-badge {
    background: #1a2230;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 30px;
    border: 1px solid #2a3448;
    transition: all 0.2s;
}

.user-badge:hover {
    border-color: #00f0a0;
}

.user-badge .name {
    font-weight: 700;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-badge .id {
    font-size: 12px;
    color: #6c7a91;
    margin-top: 8px;
}

.license-status {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #2a3448;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.license-status.active { color: #00f0a0; }
.license-status.expired { color: #ff6b6b; }
.license-status.warning { color: #ffe66d; }

/* Navigation */
nav {
    margin: 20px 0;
}

nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #8b94a8;
    text-decoration: none;
    border-radius: 12px;
    margin-bottom: 6px;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
}

nav a:hover {
    background: #1a2230;
    color: #00f0a0;
    transform: translateX(4px);
}

nav a.active {
    background: #1a2230;
    color: #00f0a0;
    border-left: 3px solid #00f0a0;
}

/* Admin nav variation */
body.admin-mode nav a.active {
    border-left-color: #ff6b6b;
    color: #ff6b6b;
}

/* Logout button */
.logout-btn {
    margin-top: auto;
    padding-top: 30px;
    border-top: 1px solid #1e2535;
}

.logout-btn a {
    color: #ff6b6b;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logout-btn a:hover {
    color: #ff8888;
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    margin-left: 280px;
    padding: 30px 40px;
    min-height: 100vh;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.date {
    color: #6c7a91;
    font-size: 13px;
    background: #0e1118;
    padding: 8px 18px;
    border-radius: 30px;
    border: 1px solid #1e2535;
    font-family: monospace;
}
/* ==================== STATS CARDS ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: #0e1118;
    border: 1px solid #1e2535;
    border-radius: 20px;
    padding: 20px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: #00f0a0;
}

.stat-card.admin-hover:hover {
    border-color: #ff6b6b;
}

.stat-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.stat-value {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}

.stat-label {
    color: #6c7a91;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-trend {
    font-size: 11px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #1e2535;
}

.stat-trend.up { color: #00f0a0; }
.stat-trend.down { color: #ff6b6b; }

/* ==================== CHARTS ==================== */
.charts-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.chart-card {
    background: #0e1118;
    border: 1px solid #1e2535;
    border-radius: 20px;
    padding: 20px;
    transition: all 0.2s;
}

.chart-card:hover {
    border-color: #2a3448;
}

.chart-card h3 {
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 600;
    color: #8b94a8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

canvas {
    max-height: 280px;
    width: 100%;
}

/* ==================== TABLES ==================== */
.table-card {
    background: #0e1118;
    border: 1px solid #1e2535;
    border-radius: 20px;
    padding: 20px;
    overflow-x: auto;
    margin-bottom: 30px;
}

.table-card h3 {
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 600;
    color: #8b94a8;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.table-card h3.admin-title {
    color: #ff6b6b;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    padding: 14px 8px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #00f0a0;
    border-bottom: 1px solid #2a3448;
}

.admin-table th {
    color: #ff6b6b;
}

td {
    padding: 12px 8px;
    font-size: 13px;
    border-bottom: 1px solid #1e2535;
}

tr:hover td {
    background: rgba(26, 34, 48, 0.5);
}

/* ==================== BADGES ==================== */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-success {
    background: rgba(0, 240, 160, 0.12);
    color: #00f0a0;
}

.badge-danger {
    background: rgba(255, 107, 107, 0.12);
    color: #ff6b6b;
}

.badge-warning {
    background: rgba(255, 230, 109, 0.12);
    color: #ffe66d;
}

.badge-info {
    background: rgba(78, 205, 196, 0.12);
    color: #4ecdc4;
}

.badge-purple {
    background: rgba(155, 89, 182, 0.12);
    color: #9b59b6;
}

/* ==================== FORMULAIRES ==================== */
.form-card {
    background: #0e1118;
    border: 1px solid #1e2535;
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 30px;
}

.form-card h3 {
    color: #00f0a0;
    margin-bottom: 20px;
    font-size: 16px;
}

.form-card.admin h3 {
    color: #ff6b6b;
}

.form-group {
    margin-bottom: 18px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 500;
    color: #8b94a8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input, select, textarea {
    width: 100%;
    padding: 12px 16px;
    background: #1a2230;
    border: 1px solid #2a3448;
    border-radius: 12px;
    color: #e0e0e0;
    font-family: inherit;
    font-size: 14px;
    transition: all 0.2s;
}

input:focus, select:focus, textarea:focus {
outline: none;
    border-color: #00f0a0;
    box-shadow: 0 0 0 3px rgba(0, 240, 160, 0.1);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

button {
    background: #00f0a0;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    color: #0a0c12;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

button:hover {
    background: #00d48a;
    transform: scale(1.02);
}

button.danger {
    background: #ff6b6b;
    color: white;
}

button.danger:hover {
    background: #ff5252;
}

/* ==================== ALERTS ==================== */
.alert-success {
    background: rgba(0, 240, 160, 0.08);
    border: 1px solid #00f0a0;
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 20px;
    color: #00f0a0;
    font-size: 13px;
}

.alert-error {
    background: rgba(255, 107, 107, 0.08);
    border: 1px solid #ff6b6b;
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 20px;
    color: #ff6b6b;
    font-size: 13px;
}

.alert-warning {
    background: rgba(255, 230, 109, 0.08);
    border: 1px solid #ffe66d;
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 20px;
    color: #ffe66d;
    font-size: 13px;
}

/* ==================== ADMIN SPECIFIC ==================== */
.admin-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.admin-stat {
    background: linear-gradient(135deg, #1a2230 0%, #0e1118 100%);
    border-radius: 16px;
    padding: 16px;
    text-align: center;
    transition: all 0.2s;
}

.admin-stat:hover {
    transform: translateY(-2px);
    border: 1px solid #ff6b6b;
}

.admin-stat-value {
    font-size: 24px;
    font-weight: 800;
    color: #ff6b6b;
    margin-bottom: 5px;
}

.admin-stat-label {
    font-size: 11px;
    color: #6c7a91;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==================== FOOTER ==================== */
footer {
    text-align: center;
    padding: 25px;
    color: #4a5570;
    font-size: 11px;
    border-top: 1px solid #1e2535;
    margin-top: 40px;
}

footer a {
    color: #6c7a91;
}

footer a:hover {
    color: #00f0a0;
}

/* ==================== RESPONSIVE ==================== */
.menu-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    background: #00f0a0;
    border: none;
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

@media (max-width: 992px) {
    .charts-row {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        gap: 15px;
    }
    
    .stat-value {
        font-size: 24px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 20px 15px;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    header h1 {
        font-size: 20px;
    }
    
    .date {
        font-size: 11px;
    }
    
    .table-card {
        padding: 12px;
    }
    
    th, td {
        padding: 8px 4px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .main-content {
        padding: 15px;
    }
    
    .stat-card {
        padding: 14px;
    }
    
    .stat-value {
        font-size: 22px;
    }
}

/* ==================== UTILITAIRES ==================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }

.flex { display: flex; }
.
flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; justify-content: center; align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

code {
    background: #1a2230;
    padding: 2px 6px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #00f0a0;
}

.hidden { display: none; }

/* ==================== ANIMATIONS ==================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.stat-card, .chart-card, .table-card, .form-card {
    animation: fadeIn 0.3s ease-out;
}

/* ==================== LOADER ==================== */
.loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #1e2535;
    border-top-color: #00f0a0;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}