/* PCB PayloadTotal - Dark Cybersecurity Theme */

:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --bg-hover: #30363d;
    --border: #30363d;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --accent: #b388ff;
    --accent-hover: #ce9cff;
    --accent-dim: rgba(179, 136, 255, 0.15);
    --danger: #f85149;
    --warning: #d29922;
    --info: #58a6ff;
    --success: #3fb950;
    --font-mono: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', 'Consolas', monospace;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    --sidebar-width: 240px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

::-webkit-scrollbar-corner {
    background: var(--bg-primary);
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--bg-tertiary) var(--bg-primary);
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    height: 100vh;
    position: fixed;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-brand {
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.sidebar-brand h1 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--accent);
}

.sidebar-brand h1 a {
    color: inherit;
    text-decoration: none;
}

.sidebar-brand h1 a:hover {
    opacity: 0.8;
}

.sidebar-brand .subtitle {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.sidebar-nav {
    padding: 12px 0;
    flex: 1;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--text-secondary);
    font-size: 14px;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.sidebar-nav a.active {
    color: var(--accent);
    background: var(--accent-dim);
    border-left-color: var(--accent);
}

.sidebar-nav .nav-icon {
    width: 18px;
    text-align: center;
    font-size: 15px;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
}

/* Main content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 32px 40px;
    min-height: 100vh;
}

.page-header {
    margin-bottom: 28px;
}

.page-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
}

.page-header p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
}

.stat-card .stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.stat-card .stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--accent);
    font-family: var(--font-mono);
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 24px;
}

.data-table th {
    background: var(--bg-tertiary);
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 10px 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
}

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

.data-table tr:hover td {
    background: var(--bg-tertiary);
}

.tech-id {
    font-family: var(--font-mono);
    color: var(--accent);
    font-weight: 600;
    font-size: 13px;
}

/* Panel */
.panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 24px;
}

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

.panel-header h3 {
    font-size: 15px;
    font-weight: 600;
}

.panel-body {
    padding: 20px;
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-sans);
    transition: border-color 0.15s;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-control::placeholder {
    color: var(--text-muted);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--font-sans);
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

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

.btn-primary {
    background: var(--accent);
    color: var(--bg-primary);
    border-color: var(--accent);
    font-weight: 600;
}

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Detection badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-detected {
    background: rgba(63, 185, 80, 0.15);
    color: var(--success);
    border: 1px solid var(--success);
}

.badge-missed {
    background: rgba(248, 81, 73, 0.15);
    color: var(--danger);
    border: 1px solid var(--danger);
}

/* FAQ accordion */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.faq-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.faq-question {
    padding: 16px 20px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.15s;
}

.faq-question:hover {
    background: var(--bg-tertiary);
}

.faq-question::after {
    content: '+';
    font-size: 18px;
    color: var(--accent);
    transition: transform 0.2s;
}

.faq-item.active .faq-question::after {
    content: '\2212';
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 20px;
}

.faq-item.active .faq-answer {
    max-height: 500px;
    padding: 16px 20px 16px 20px;
}

.faq-answer p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 14px;
    z-index: 1000;
    animation: slideIn 0.3s ease;
    max-width: 400px;
}

.notification.success {
    background: rgba(63, 185, 80, 0.15);
    border: 1px solid var(--success);
    color: var(--success);
}

.notification.error {
    background: rgba(248, 81, 73, 0.15);
    border: 1px solid var(--danger);
    color: var(--danger);
}

.notification.info {
    background: rgba(88, 166, 255, 0.15);
    border: 1px solid var(--info);
    color: var(--info);
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

.loading-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px;
    color: var(--text-secondary);
}

/* Status indicators */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-dot.online { background: var(--success); }
.status-dot.offline { background: var(--danger); }
.status-dot.building { background: var(--warning); animation: pulse 1s infinite; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Policy tags */
.policy-tag {
    display: inline-block;
    padding: 2px 8px;
    margin: 2px 4px 2px 0;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--accent-dim);
    color: var(--accent);
    border: 1px solid var(--accent);
}

/* Sanctioned badges */
.badge-sanctionned {
    background: rgba(63, 185, 80, 0.15);
    color: var(--success);
    border: 1px solid var(--success);
}

.badge-not-sanctionned {
    background: rgba(110, 118, 129, 0.15);
    color: var(--text-muted);
    border: 1px solid var(--text-muted);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state p {
    font-size: 14px;
    margin-top: 8px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }
    .sidebar-brand h1,
    .sidebar-brand .subtitle,
    .sidebar-nav .nav-label {
        display: none;
    }
    .sidebar-nav a {
        justify-content: center;
        padding: 12px;
    }
    .sidebar-footer {
        display: none;
    }
    .main-content {
        margin-left: 60px;
        padding: 20px;
    }
}
