/* =====================================================
   WEBTRUSTAI - DARK HACKER THEME
   Professional Cybersecurity Dashboard
   ===================================================== */

:root {
    --primary: #0066cc;
    --primary-light: #00aaff;
    --primary-dark: #0052a3;
    --danger: #ff3333;
    --success: #00cc66;
    --warning: #ffaa00;
    --dark-bg: #0a0e1a;
    --dark-surface: #1a1f36;
    --dark-surface-light: #151a2e;
    --border: #2a2f45;
    --text-primary: #f5f7fa;
    --text-secondary: #c5cae1;
    --text-muted: #8b92a9;
    --code-font: 'Courier New', 'Monaco', 'Menlo', monospace;
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: linear-gradient(135deg, #0a0e1a 0%, #0f1419 50%, #0a0e1a 100%);
    color: var(--text-secondary);
    font-family: var(--font-family);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
}

/* ===== HEADER ===== */
.header {
    background: linear-gradient(90deg, #1a1f36 0%, #151a2e 50%, #1a1f36 100%);
    border-bottom: 2px solid var(--primary);
    box-shadow: 0 4px 20px rgba(0, 102, 204, 0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1600px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex: 1;
}

.toggle-sidebar {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

.page-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--code-font);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}

/* ===== SIDEBAR ===== */
.main-container {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: calc(100vh - 70px);
    gap: 0;
}

.sidebar {
    background: linear-gradient(180deg, #1a1f36 0%, #151a2e 100%);
    border-right: 2px solid var(--border);
    padding: 1.5rem 0;
    overflow-y: auto;
    position: sticky;
    top: 70px;
    height: calc(100vh - 70px);
}

.sidebar-header {
    padding: 0 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--primary);
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 700;
    font-family: var(--code-font);
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 300ms ease;
    padding: 0.75rem;
    border-radius: 6px;
}

.logo:hover {
    color: var(--primary-light);
    background-color: rgba(0, 102, 204, 0.1);
    box-shadow: 0 0 15px rgba(0, 102, 204, 0.3);
}

.logo i {
    font-size: 1.4rem;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: all 200ms ease;
    border-left: 3px solid transparent;
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: linear-gradient(180deg, var(--primary), var(--primary-light));
    transform: scaleY(0);
    transition: transform 200ms ease;
}

.nav-item:hover {
    color: var(--primary-light);
    background-color: rgba(0, 102, 204, 0.08);
    border-left-color: var(--primary);
}

.nav-item:hover::before {
    transform: scaleY(1);
}

.nav-item.active {
    color: var(--primary);
    background-color: rgba(0, 102, 204, 0.15);
    border-left-color: var(--primary);
    font-weight: 700;
}

.nav-item i {
    min-width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

.sidebar-footer {
    position: absolute;
    bottom: 1.5rem;
    left: 1.5rem;
    right: 1.5rem;
}

.settings-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background-color: rgba(0, 102, 204, 0.1);
    border: 1px solid var(--primary);
    border-radius: 6px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 200ms ease;
}

.settings-link:hover {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 0 20px rgba(0, 102, 204, 0.4);
}

/* ===== CONTENT ===== */
.content {
    padding: 2rem;
    overflow-y: auto;
    background: linear-gradient(135deg, #0f1419 0%, #0a0e1a 100%);
}

.content::-webkit-scrollbar {
    width: 8px;
}

.content::-webkit-scrollbar-track {
    background: transparent;
}

.content::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.content::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* ===== CARDS & GRIDS ===== */
.stat-card,
.metric-card,
.chart-card,
.data-table,
.bot-card,
.ip-item,
.spam-item,
.threat-item,
.threat-card {
    background: linear-gradient(135deg, #1a1f36 0%, #151a2e 100%);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stat-card::before,
.metric-card::before,
.chart-card::before,
.data-table::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light), transparent);
    opacity: 0;
    transition: opacity 200ms ease;
}

.stat-card:hover::before,
.metric-card:hover::before,
.chart-card:hover::before,
.data-table:hover::before {
    opacity: 1;
}

.stat-card:hover,
.metric-card:hover,
.chart-card:hover,
.data-table:hover {
    border-color: var(--primary);
    box-shadow: 0 8px 32px rgba(0, 102, 204, 0.2),
                inset 0 0 20px rgba(0, 102, 204, 0.05);
    transform: translateY(-4px);
}

/* ===== GRIDS ===== */
.stats-container,
.stats-row,
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.charts-container,
.charts-grid,
.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.websites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 700;
    font-family: var(--code-font);
    letter-spacing: 0.5px;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }

code, pre {
    font-family: var(--code-font);
    background-color: #0f1419;
    color: var(--primary-light);
}

code {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

pre {
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    border-left: 3px solid var(--primary);
}

/* ===== BUTTONS ===== */
.btn,
button,
.action-btn,
.filter-btn,
.view-all-btn {
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 200ms ease;
    font-family: var(--code-font);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.85rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    padding: 0.75rem 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 102, 204, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 102, 204, 0.4);
}

.btn-secondary {
    background-color: #2a2f45;
    color: var(--text-secondary);
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background-color: #353a52;
    border-color: var(--primary);
    color: var(--primary);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

.btn-block {
    width: 100%;
    display: block;
}

/* ===== BADGES & TAGS ===== */
.badge,
.status-badge,
.threat-badge,
.spam-type-badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary { background: rgba(0, 102, 204, 0.2); color: var(--primary); }
.badge-danger { background: rgba(255, 51, 51, 0.2); color: var(--danger); }
.badge-success { background: rgba(0, 204, 102, 0.2); color: var(--success); }
.badge-warning { background: rgba(255, 170, 0, 0.2); color: var(--warning); }

.status-badge.critical,
.threat-badge.critical {
    background: rgba(255, 51, 51, 0.2);
    color: var(--danger);
    border-left: 2px solid var(--danger);
}

.status-badge.high,
.threat-badge.high {
    background: rgba(255, 170, 0, 0.2);
    color: var(--warning);
    border-left: 2px solid var(--warning);
}

.status-badge.medium,
.threat-badge.medium {
    background: rgba(0, 170, 255, 0.2);
    color: var(--primary-light);
    border-left: 2px solid var(--primary-light);
}

.status-badge.low,
.threat-badge.low {
    background: rgba(0, 204, 102, 0.2);
    color: var(--success);
    border-left: 2px solid var(--success);
}

/* ===== ALERTS ===== */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 500;
    border-left: 4px solid;
    animation: slideInDown 300ms ease;
}

.alert-danger {
    background: rgba(255, 51, 51, 0.1);
    border-left-color: var(--danger);
    color: var(--danger);
}

.alert-success {
    background: rgba(0, 204, 102, 0.1);
    border-left-color: var(--success);
    color: var(--success);
}

.alert-warning {
    background: rgba(255, 170, 0, 0.1);
    border-left-color: var(--warning);
    color: var(--warning);
}

.alert-info {
    background: rgba(0, 102, 204, 0.1);
    border-left-color: var(--primary);
    color: var(--primary-light);
}

/* ===== TABLES ===== */
table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: rgba(0, 102, 204, 0.08);
}

th {
    padding: 1rem 1.5rem;
    text-align: left;
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
    font-family: var(--code-font);
}

td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

tbody tr {
    transition: all 200ms ease;
}

tbody tr:hover {
    background: rgba(0, 102, 204, 0.08);
    border-left: 3px solid var(--primary);
}

tbody tr:last-child td {
    border-bottom: none;
}

/* ===== FORMS ===== */
.input-group,
.form-group {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

label {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="number"],
textarea,
select {
    padding: 0.75rem 1rem;
    background: #0f1419;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-family: var(--code-font);
    font-size: 0.95rem;
    transition: all 200ms ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="url"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1),
                inset 0 0 10px rgba(0, 102, 204, 0.05);
    background: linear-gradient(135deg, #0f1419 0%, rgba(0, 102, 204, 0.02) 100%);
}

/* ===== ANIMATIONS ===== */
@keyframes slideInDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 10px rgba(0, 102, 204, 0.3); }
    50% { box-shadow: 0 0 20px rgba(0, 102, 204, 0.6); }
}

.glow {
    animation: glow 2s ease-in-out infinite;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .charts-container,
    .charts-grid,
    .chart-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .main-container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        left: -260px;
        top: 70px;
        width: 260px;
        height: calc(100vh - 70px);
        z-index: 200;
        transition: left 300ms ease;
        box-shadow: 2px 0 20px rgba(0, 0, 0, 0.5);
    }

    .sidebar.active {
        left: 0;
    }

    .toggle-sidebar {
        display: block;
    }

    .header-content {
        padding: 1rem 1.5rem;
        gap: 1rem;
    }

    .page-title {
        font-size: 1.3rem;
    }

    .header-right {
        gap: 1rem;
    }

    .stats-container,
    .stats-row,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .charts-container,
    .charts-grid,
    .chart-grid {
        grid-template-columns: 1fr;
    }

    .content {
        padding: 1.5rem;
    }

    table {
        font-size: 0.85rem;
    }

    th, td {
        padding: 0.75rem 0.5rem;
    }

    .bot-card,
    .ip-item,
    .threat-item {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-title {
        font-size: 1.1rem;
    }

    .content {
        padding: 1rem;
    }
}

/* ===== UTILITY CLASSES ===== */
.text-primary { color: var(--primary); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--text-muted); }

.bg-dark { background: var(--dark-bg); }
.bg-surface { background: var(--dark-surface); }

.m-0 { margin: 0; }
.m-1 { margin: 0.5rem; }
.m-2 { margin: 1rem; }

.p-0 { padding: 0; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

.text-center { text-align: center; }
.text-right { text-align: right; }

.d-flex { display: flex; }
.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.cursor-pointer { cursor: pointer; }

.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }

.rounded { border-radius: 6px; }
.rounded-lg { border-radius: 12px; }

.border { border: 1px solid var(--border); }
.border-t { border-top: 1px solid var(--border); }
.border-b { border-bottom: 1px solid var(--border); }