/* ==================== DASHBOARD STYLES ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --secondary: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --dark: #1e293b;
    --light: #f8fafc;
    --gray: #64748b;
    --sidebar-bg: #1e293b;
    --card-bg: white;
    --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--light);
    display: flex;
    min-height: 100vh;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
}

.logo {
    padding: 2rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-icon {
    font-size: 2rem;
}

.nav {
    flex: 1;
    padding: 2rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-left-color: var(--primary);
}

.nav-icon {
    font-size: 1.5rem;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-back {
    display: block;
    text-align: center;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

/* ==================== HEADER ==================== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.header h1 {
    font-size: 2rem;
    color: var(--dark);
}

.header-subtitle {
    color: var(--gray);
    margin-top: 0.3rem;
}

.header-right {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #dcfce7;
    color: #16a34a;
    border-radius: 20px;
    font-weight: 600;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #16a34a;
}

.status-dot.active {
    animation: pulse-dot 2s ease-in-out infinite;
}

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

.user-info {
    font-weight: 600;
}

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

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    display: flex;
    gap: 1rem;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.stat-icon.green { background: #dcfce7; }
.stat-icon.blue { background: #dbeafe; }
.stat-icon.orange { background: #fed7aa; }
.stat-icon.purple { background: #e9d5ff; }

.stat-info h3 {
    font-size: 2rem;
    font-weight: 900;
    color: var(--dark);
    margin-bottom: 0.3rem;
}

.stat-info p {
    color: var(--gray);
    font-size: 0.9rem;
}

.stat-change {
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
    margin-top: 0.3rem;
}

.stat-change.positive {
    color: var(--secondary);
}

/* ==================== CHARTS ==================== */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-card {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.chart-header h3 {
    font-size: 1.2rem;
    color: var(--dark);
}

.chart-filter {
    padding: 0.5rem 1rem;
    border: 2px solid var(--light);
    border-radius: 8px;
    background: white;
    font-weight: 600;
    cursor: pointer;
}

/* ==================== ALERTS ==================== */
.alerts-section,
.activity-section,
.threat-map-section {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    font-size: 1.3rem;
    color: var(--dark);
}

.btn-filter {
    padding: 0.5rem 1.5rem;
    background: var(--light);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-filter:hover {
    background: var(--primary);
    color: white;
}

.alerts-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.alert-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--light);
    border-radius: 10px;
    border-left: 4px solid;
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.alert-item.critical {
    border-left-color: var(--danger);
    background: #fee2e2;
}

.alert-item.warning {
    border-left-color: var(--warning);
    background: #fef3c7;
}

.alert-item.info {
    border-left-color: var(--info);
    background: #dbeafe;
}

.alert-item.success {
    border-left-color: var(--secondary);
    background: #dcfce7;
}

.alert-icon {
    font-size: 1.5rem;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.alert-description {
    font-size: 0.9rem;
    color: var(--gray);
}

.alert-time {
    font-size: 0.85rem;
    color: var(--gray);
    white-space: nowrap;
}

/* ==================== ACTIVITY FEED ==================== */
.activity-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--danger);
}

.pulse {
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    animation: pulse-animation 2s ease-in-out infinite;
}

@keyframes pulse-animation {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.5);
        opacity: 0.5;
    }
}

.activity-feed {
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--light);
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light);
    font-size: 1.2rem;
}

.activity-text {
    flex: 1;
}

.activity-title {
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.activity-description {
    font-size: 0.85rem;
    color: var(--gray);
}

.activity-time {
    font-size: 0.8rem;
    color: var(--gray);
}

/* ==================== THREAT MAP ==================== */
.threat-map {
    position: relative;
    height: 400px;
    background: linear-gradient(135deg, #667eea20 0%, #764ba220 100%);
    border-radius: 15px;
    overflow: hidden;
}

.threat-location {
    position: absolute;
    animation: threat-appear 1s ease-out;
}

@keyframes threat-appear {
    from {
        opacity: 0;
        transform: scale(0);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.threat-dot {
    width: 20px;
    height: 20px;
    background: var(--danger);
    border-radius: 50%;
    animation: threat-pulse 2s ease-in-out infinite;
    box-shadow: 0 0 0 0 var(--danger);
}

@keyframes threat-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    70% {
        box-shadow: 0 0 0 20px rgba(239, 68, 68, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

.threat-label {
    position: absolute;
    top: 25px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 70px;
    }

    .logo-text,
    .nav-item span:not(.nav-icon) {
        display: none;
    }

    .main-content {
        margin-left: 70px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}
