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

:root {
    /* Muted Professional Color Palette */
    --primary-color: #C17A3A;        /* Muted Bronze/Copper */
    --secondary-color: #8B6332;      /* Dark Bronze */
    --success-color: #4A7C7C;        /* Muted Slate Teal */
    --danger-color: #8B4C4C;         /* Muted Burgundy */
    --warning-color: #9B8B4A;        /* Muted Gold/Olive */
    --dark-bg: #000000;              /* Pure Black */
    --card-bg: #0A0A0A;              /* Near Black */
    --text-primary: #E0E0E0;         /* Soft White */
    --text-secondary: #808080;       /* Medium Gray */
    --border-color: #1A1A1A;         /* Dark Gray */
    --accent-bar: #C17A3A;           /* Bronze accent */
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    line-height: 1.6;
    letter-spacing: 0.2px;
}

/* Navigation */
nav {
    background: var(--card-bg);
    border-bottom: 2px solid var(--primary-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 9999;
}

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

nav h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

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

/* Container */
.container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* Introduction Section */
.intro-section {
    background: var(--card-bg);
    border-left: 3px solid var(--primary-color);
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    line-height: 1.7;
}

.intro-section p {
    color: var(--text-secondary);
    font-size: 1rem;
    margin: 0;
    max-width: 900px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0;
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 400;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    letter-spacing: -0.5px;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: var(--success-color);
    border-radius: 50%;
    animation: pulse 2s infinite;
    margin-right: 0.5rem;
}

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

/* Threat Level Cards */
.threat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.threat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--border-color);
    border-radius: 0;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.2s ease;
}

.threat-card.benign {
    border-left-color: var(--success-color);
}

.threat-card.reconnaissance {
    border-left-color: var(--warning-color);
}

.threat-card.malicious {
    border-left-color: var(--danger-color);
}

.threat-value {
    font-size: 3rem;
    font-weight: 400;
    margin-bottom: 0.25rem;
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    letter-spacing: -0.5px;
}

.threat-card.benign .threat-value {
    color: var(--success-color);
}

.threat-card.reconnaissance .threat-value {
    color: var(--warning-color);
}

.threat-card.malicious .threat-value {
    color: var(--danger-color);
}

.threat-percent {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
}

.threat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Charts Grid */
.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.chart-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0;
    padding: 1.5rem;
}

.chart-card.full-width {
    grid-column: 1 / -1;
}

.chart-card h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

canvas {
    max-height: 300px;
}

/* Table */
.table-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.table-card h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.table-container {
    overflow-x: auto;
}

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

thead {
    background: var(--dark-bg);
}

th {
    text-align: left;
    padding: 1rem;
    font-weight: 400;
    color: var(--text-primary);
    border-bottom: 2px solid var(--primary-color);
}

td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

tbody tr:hover {
    background: rgba(37, 99, 235, 0.1);
}

.loading {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
}

/* About Page */
.about-content {
    max-width: 900px;
    margin: 0 auto;
}

.about-content h1 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--primary-color);
}

.about-content h2 {
    font-size: 1.75rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.about-content h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.about-content section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0;
    padding: 2rem;
    margin-bottom: 2rem;
}

.about-content p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.about-content ul {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.about-content li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.about-content strong {
    color: var(--primary-color);
}

.about-content a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s;
}

.about-content a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

.tech-stack {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.tech-item {
    background: var(--dark-bg);
    padding: 1rem;
    border-radius: 6px;
}

.btn-link {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 400;
    transition: background 0.3s;
}

.btn-link:hover {
    background: var(--secondary-color);
    text-decoration: none;
}

/* Footer */
footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
    margin-top: 4rem;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .chart-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    nav h1 {
        font-size: 1.2rem;
    }
    
    .nav-links {
        gap: 1rem;
    }
    
    table {
        font-size: 0.875rem;
    }
    
    th, td {
        padding: 0.5rem;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.modal.active {
    display: block;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    max-width: 900px;
    max-height: 85vh;
    margin: 5vh auto;
    background: var(--card-bg);
    border-radius: 12px;
    border: 2px solid var(--border-color);
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--dark-bg);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem 2rem;
    overflow-y: auto;
    flex: 1;
}

.modal-loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.request-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.request-card {
    background: var(--dark-bg);
    border: 1px solid var(--border-color);
    border-radius: 0;
    padding: 1.25rem;
    transition: all 0.2s;
}

.request-card:hover {
    border-color: var(--primary-color);
    transform: translateX(4px);
}

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

.request-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.request-time {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.request-ip {
    font-family: 'Courier New', monospace;
    color: var(--primary-color);
    font-weight: 400;
}

.threat-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 0;
    font-size: 0.85rem;
    font-weight: 400;
    text-transform: uppercase;
}

.threat-badge.benign {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success-color);
}

.threat-badge.reconnaissance {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning-color);
}

.threat-badge.malicious {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger-color);
}

.request-section {
    margin-bottom: 1rem;
}

.request-section:last-child {
    margin-bottom: 0;
}

.request-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.4rem;
    font-weight: 400;
}

.request-value {
    font-family: 'Courier New', monospace;
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.3);
    padding: 0.75rem;
    border-radius: 0;
    font-size: 0.9rem;
    word-break: break-all;
    line-height: 1.5;
}

.classification-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.classification-item {
    display: flex;
    align-items: start;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.classification-item::before {
    content: "•";
    color: var(--primary-color);
    font-weight: normal;
    font-size: 1.2rem;
}

.score-display {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    background: rgba(37, 99, 235, 0.2);
    border-radius: 0;
    color: var(--primary-color);
    font-weight: 400;
    font-size: 0.9rem;
}

/* Make threat cards clickable */
.threat-card {
    cursor: pointer;
    transition: all 0.2s ease;
}

.threat-card:hover {
    transform: translateX(2px);
    border-left-width: 6px;
    background: #111111;
}

.threat-card:active {
    transform: translateX(0);
}

/* Make charts clickable */
.chart-card canvas {
    cursor: pointer;
}

.chart-card canvas:hover {
    opacity: 0.9;
}

/* IP Info Button */
.ipinfo-btn {
    margin-left: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0;
    font-size: 0.8rem;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ipinfo-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-1px);
}

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

.ipinfo-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* IP Info Container */
.ipinfo-container {
    margin-top: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid var(--primary-color);
    border-radius: 6px;
}

.ipinfo-content {
    font-size: 0.9rem;
}

.ipinfo-header {
    font-weight: 400;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.ipinfo-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ipinfo-item {
    color: var(--text-primary);
    line-height: 1.5;
}

.ipinfo-label {
    color: var(--text-secondary);
    font-weight: 400;
    margin-right: 0.5rem;
}

.ipinfo-error {
    color: var(--danger-color);
    text-align: center;
    padding: 0.5rem;
}

/* Attack Map */
#attack-map {
    height: 500px;
    width: 100%;
    border-radius: 0;
    overflow: hidden;
}

.leaflet-popup-content {
    color: #1e293b;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.leaflet-popup-content strong {
    color: #2563eb;
    font-size: 1.1em;
}

/* Timeline Controls */
.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.chart-header h2 {
    margin: 0;
}

.timeline-controls {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.timeline-btn {
    padding: 0.5rem 1rem;
    background: var(--card-bg);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}

.timeline-btn:hover {
    background: rgba(37, 99, 235, 0.1);
    border-color: var(--primary-color);
    color: var(--text-primary);
}

.timeline-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Responsive modal */
@media (max-width: 768px) {
    .modal-content {
        max-width: 95%;
        margin: 2vh auto;
        max-height: 95vh;
    }
    
    .modal-header, .modal-body {
        padding: 1rem;
    }
    
    .request-card {
        padding: 1rem;
    }
    
    .request-header {
        flex-direction: column;
        align-items: start;
        gap: 0.5rem;
    }
}
