/*--------------------------------------------------------------
# DASHBOARD REDESIGN
--------------------------------------------------------------*/
.dashboard-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 10px;
    margin-top: 10px;
}

.dashboard-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.dashboard-card {
    background-color: rgba(10, 10, 10, 0.6);
    border: 1px solid rgba(var(--main-color-rgb), 0.3);
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(5px);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.dashboard-card:hover {
    border-color: var(--main-color);
    box-shadow: 0 0 15px rgba(var(--main-color-rgb), 0.2);
}

.stat-card-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.stat-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    background-color: rgba(var(--main-color-rgb), 0.1);
    color: var(--main-color);
    font-size: 1.5rem;
    border: 1px solid rgba(var(--main-color-rgb), 0.2);
}

.stat-value {
    font-size: 1.75rem;
    font-weight: bold;
    color: #fff;
    margin-top: 0.5rem;
    font-family: 'Terminus', monospace;
    text-shadow: 0 0 5px rgba(var(--main-color-rgb), 0.5);
}

.stat-label {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    margin-bottom: 5px;
    display: block;
}

.stat-change {
    display: flex;
    align-items: center;
    font-size: 0.75rem;
    margin-top: 0.8rem;
    gap: 0.25rem;
    color: rgba(255, 255, 255, 0.5);
}

.stat-change.up {
    color: #2dc26b;
}

.stat-change.down {
    color: #e53e3e;
}

.dashboard-charts-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 1024px) {
    .dashboard-charts-row {
        grid-template-columns: 1fr;
    }
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(var(--main-color-rgb), 0.1);
    padding-bottom: 10px;
}

.chart-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--main-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.map-card {
    height: 500px;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.map-card .chart-header {
    padding: 10px 15px;
    margin-bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(var(--main-color-rgb), 0.2);
}

#visitor-map {
    flex-grow: 1;
    width: 100%;
    min-height: 400px;
    z-index: 1;
}

.chart-container-wrapper {
    position: relative;
    height: 300px;
    width: 100%;
}

/* ============ LIVE INDICATOR ============ */
.dashboard-refresh-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Terminus', monospace;
    font-size: 0.85rem;
    color: #2dc26b;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Pulsing dot — large */
.pulse-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: #2dc26b;
    border-radius: 50%;
    animation: pulse-glow 2s infinite;
}

/* Pulsing dot — small (for stat cards) */
.pulse-dot-sm {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #2dc26b;
    border-radius: 50%;
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 0 0 rgba(45, 194, 107, 0.7);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(45, 194, 107, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(45, 194, 107, 0);
    }
}

/* ============ MAP LEGEND ============ */
.map-legend {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.8rem;
    font-family: 'Terminus', monospace;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    color: rgba(255, 255, 255, 0.7);
}

.legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.legend-organic {
    background: #2dc26b;
    box-shadow: 0 0 6px rgba(45, 194, 107, 0.5);
}

.legend-bot {
    background: #e53e3e;
    box-shadow: 0 0 6px rgba(229, 62, 62, 0.5);
}

/* ============ RECENT VISITORS TABLE ============ */
.dashboard-table-container {
    overflow-x: auto;
    max-height: 500px;
    overflow-y: auto;
}

.dashboard-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Terminus', monospace;
    font-size: 0.8rem;
}

.dashboard-table thead th {
    text-align: left;
    padding: 10px 8px;
    color: var(--main-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.7rem;
    border-bottom: 1px solid rgba(var(--main-color-rgb), 0.3);
    white-space: nowrap;
    position: sticky;
    top: 0;
    background: rgba(10, 10, 10, 0.95);
    z-index: 2;
}

.dashboard-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.15s ease;
}

.dashboard-table tbody tr:hover {
    background: rgba(var(--main-color-rgb), 0.05);
}

.dashboard-table tbody td {
    padding: 8px;
    color: rgba(255, 255, 255, 0.8);
    white-space: nowrap;
}

.dashboard-table tbody tr.visitor-bot {
    opacity: 0.6;
}

.dashboard-table tbody tr.visitor-bot td:first-child::before {
    content: '🤖 ';
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
    .dashboard-stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .dashboard-charts-row {
        grid-template-columns: 1fr;
    }
    
    .map-card {
        height: 350px;
    }

    .map-legend {
        gap: 10px;
        font-size: 0.7rem;
    }
    
    .dashboard-table {
        font-size: 0.7rem;
    }

    .dashboard-table thead th,
    .dashboard-table tbody td {
        padding: 6px 4px;
    }
}

@media (max-width: 480px) {
    .dashboard-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-value {
        font-size: 1.4rem;
    }
}

/* ============ THREAT INTEL & EXPERIMENTAL ============ */
.threat-title {
    color: #e53e3e !important;
    animation: flash-red 3s infinite;
}

@keyframes flash-red {
    0%, 100% { opacity: 1; text-shadow: 0 0 8px rgba(229, 62, 62, 0.8); }
    50% { opacity: 0.7; text-shadow: none; }
}

.grid-3-cols {
    display: grid;
    gap: 1.5rem;
}

@media (max-width: 1200px) {
    .grid-3-cols { grid-template-columns: 1fr 1fr !important; }
}
@media (max-width: 768px) {
    .grid-3-cols { grid-template-columns: 1fr !important; }
}

/* ============ MATRIX LIVE LOGS ============ */
.matrix-card {
    border-color: rgba(45, 194, 107, 0.4);
}

.matrix-header {
    margin-bottom: 0.5rem;
    border-bottom-color: rgba(45, 194, 107, 0.2);
}

.matrix-header .chart-title {
    color: #2dc26b;
    text-shadow: 0 0 5px rgba(45, 194, 107, 0.5);
}

.live-blinker {
    color: #2dc26b;
    font-weight: bold;
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

.matrix-log-container {
    height: 300px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(45, 194, 107, 0.2);
    padding: 10px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.matrix-line {
    margin-bottom: 4px;
    line-height: 1.4;
    word-break: break-all;
    animation: type-in 0.2s ease-out forwards;
    opacity: 0;
    transform: translateY(10px);
}

@keyframes type-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.matrix-time { color: rgba(255, 255, 255, 0.5); margin-right: 8px; }
.matrix-ip { color: #4299e1; margin-right: 8px; }
.matrix-method { color: #ed8936; margin-right: 8px; font-weight: bold; }
.matrix-path { color: #a0aec0; margin-right: 8px; }
.matrix-status.s200 { color: #2dc26b; font-weight: bold; }
.matrix-status.s300 { color: #fbbf24; font-weight: bold; }
.matrix-status.s400 { color: #e53e3e; font-weight: bold; }
.matrix-ms { color: rgba(255, 255, 255, 0.4); margin-left: 8px; font-size: 0.75rem; }

/* Dashboard custom scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(var(--main-color-rgb), 0.3);
    border-radius: 3px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--main-color-rgb), 0.6);
}