/* ==========================================================================
   SMART URL MITIGATION SYSTEM - ENTERPRISE CYBER SECURITY CSS SYSTEM
   Aesthetics: Glassmorphism, Dark Neon Glow, Modern Typography, Vibrant Accents
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
    /* Color Palette */
    --bg-dark: #090d16;
    --bg-card: rgba(15, 23, 42, 0.75);
    --bg-card-hover: rgba(30, 41, 59, 0.85);
    --border-light: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(59, 130, 246, 0.3);
    
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-glow: rgba(59, 130, 246, 0.4);
    
    --secondary: #8b5cf6;
    --secondary-hover: #7c3aed;
    
    --color-safe: #10b981;
    --color-safe-bg: rgba(16, 185, 129, 0.12);
    
    --color-danger: #ef4444;
    --color-danger-bg: rgba(239, 68, 68, 0.12);
    
    --color-warning: #f59e0b;
    --color-warning-bg: rgba(245, 158, 11, 0.12);

    --color-info: #06b6d4;
    --color-info-bg: rgba(6, 182, 212, 0.12);
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --shadow-glow: 0 0 25px rgba(59, 130, 246, 0.25);
    
    --gradient-primary: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    --gradient-danger: linear-gradient(135deg, #ef4444 0%, #f43f5e 100%);
    --gradient-dark: linear-gradient(180deg, #0f172a 0%, #090d16 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.12) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.12) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: 280px;
    background: rgba(11, 17, 32, 0.95);
    backdrop-filter: blur(16px);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid var(--border-light);
}

.brand-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: var(--shadow-glow);
}

.brand-text h1 {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #fff;
}

.brand-text p {
    font-size: 0.7rem;
    color: var(--primary);
    font-weight: 700;
    letter-spacing: 1px;
}

.sidebar-menu {
    flex: 1;
    padding: 20px 16px;
    overflow-y: auto;
}

.nav-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-dim);
    margin: 20px 12px 10px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    margin-bottom: 4px;
    cursor: pointer;
}

.nav-item svg {
    width: 20px;
    height: 20px;
    transition: transform 0.2s ease;
}

.nav-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(4px);
}

.nav-item.active {
    color: #fff;
    background: var(--gradient-primary);
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.35);
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-light);
}

/* Main Content Wrapper */
.main-wrapper {
    flex: 1;
    margin-left: 280px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Topbar Header */
.topbar {
    height: 76px;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(11, 17, 32, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 90;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

.page-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--color-safe-bg);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-safe);
}

.status-pulse {
    width: 8px;
    height: 8px;
    background: var(--color-safe);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--color-safe);
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 16px var(--color-safe); }
    100% { transform: scale(0.95); opacity: 0.8; }
}

.user-profile-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-light);
    cursor: pointer;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: #fff;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
}

.user-role {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Dynamic Views Body */
.content-body {
    padding: 32px;
    flex: 1;
}

/* Glass Panels & Cards */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glass);
    transition: all 0.3s ease;
}

.glass-panel-hover:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-glow);
    transform: translateY(-3px);
}

/* Grid Layout System */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }

/* Stat KPI Cards */
.stat-card {
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
    margin: 8px 0 4px;
}

.stat-trend {
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
}

.trend-up { color: var(--color-safe); }
.trend-down { color: var(--color-danger); }

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon.safe { background: var(--color-safe-bg); color: var(--color-safe); }
.stat-icon.danger { background: var(--color-danger-bg); color: var(--color-danger); }
.stat-icon.warning { background: var(--color-warning-bg); color: var(--color-warning); }

/* Custom Tables */
.table-container {
    overflow-x: auto;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.custom-table th {
    padding: 14px 18px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-dim);
    border-bottom: 1px solid var(--border-light);
}

.custom-table td {
    padding: 16px 18px;
    font-size: 0.88rem;
    color: var(--text-main);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.custom-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.url-cell {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--primary);
    max-width: 340px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Badges */
.badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-block;
}

.badge-safe { background: var(--color-safe-bg); color: var(--color-safe); border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-danger { background: var(--color-danger-bg); color: var(--color-danger); border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-warning { background: var(--color-warning-bg); color: var(--color-warning); border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-info { background: var(--color-info-bg); color: var(--color-info); border: 1px solid rgba(6, 182, 212, 0.3); }

/* Form Controls & Buttons */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    color: #fff;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 16px rgba(59, 130, 246, 0.3);
}

.btn {
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(59, 130, 246, 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-sm { padding: 6px 12px; font-size: 0.78rem; border-radius: var(--radius-sm); }
.btn-lg { padding: 14px 28px; font-size: 1rem; }

/* Scanner Hero Box */
.scanner-hero {
    padding: 40px;
    text-align: center;
    margin-bottom: 24px;
}

.scan-input-box {
    display: flex;
    gap: 12px;
    max-width: 800px;
    margin: 0 auto;
}

.scan-input {
    flex: 1;
    font-size: 1rem;
    padding: 16px 20px;
    background: rgba(15, 23, 42, 0.9);
}

.quick-samples {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 16px;
    flex-wrap: wrap;
}

.sample-chip {
    font-size: 0.75rem;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.sample-chip:hover {
    color: #fff;
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.15);
}

/* Scanning Radar & Loading */
.scan-loading-card {
    padding: 40px;
    text-align: center;
    display: none;
}

.radar-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(59, 130, 246, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.progress-bar-bg {
    width: 100%;
    max-width: 500px;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin: 16px auto;
    overflow: hidden;
}

.progress-bar-fill {
    width: 0%;
    height: 100%;
    background: var(--gradient-primary);
    transition: width 0.3s ease;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-glow);
    color: #fff;
    box-shadow: var(--shadow-glass);
    margin-top: 10px;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease;
}

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

/* Responsive Breakpoints */
@media (max-width: 1024px) {
    .sidebar { width: 80px; }
    .sidebar .brand-text, .sidebar .nav-item span, .sidebar .nav-section-title { display: none; }
    .main-wrapper { margin-left: 80px; }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
    .topbar { padding: 0 16px; }
    .content-body { padding: 16px; }
    .scan-input-box { flex-direction: column; }
}
