/* 
   SMARTSHEET MODERN PPM | Branding System
   Design: Flexible, Collaborative, Scaling
*/

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

:root {
    --primary: #3B5B7E; /* Firmitas Dark Blue */
    --primary-glow: rgba(59, 91, 126, 0.15);
    --secondary: #5C8E9A; /* Firmitas Teal */
    --danger: #ef4444;
    --accent: #7C3AED; /* Firmitas Accent Purple */
    --bg-dark: #F8FAFC; /* Firmitas Light Grey */
    --bg-surface: #ffffff;
    --glass: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(59, 91, 126, 0.08);
    --text-main: #2C3539; /* Firmitas Dark Text */
    --text-muted: #64748B; /* Firmitas Muted Text */
    --shadow-nexus: 0 10px 40px rgba(59, 91, 126, 0.08);
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(circle at 50% 50%, rgba(37, 99, 235, 0.03) 0%, transparent 50%),
        linear-gradient(rgba(15, 23, 42, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 23, 42, 0.03) 1px, transparent 1px);
    background-size: 100% 100%, 40px 40px, 40px 40px;
    color: var(--text-main);
    font-family: var(--font-body);
    height: 100vh;
    overflow: hidden;
    display: flex;
}

/* Sidebar Navigation */
.sidebar {
    width: 280px;
    background: var(--bg-surface);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    padding: 30px 15px;
    z-index: 100;
}

.brand {
    padding: 0 15px 40px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.brand h2 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.5px;
    font-size: 1.4rem;
}

.brand span { color: var(--primary); }

.nav-links { flex: 1; list-style: none; }
.nav-item {
    padding: 14px 18px;
    margin-bottom: 6px;
    border-radius: 12px;
    cursor: pointer;
    transition: 0.25s;
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9rem;
}

@media (max-width: 1024px) {
    .nav-item { padding: 18px 22px; margin-bottom: 10px; font-size: 1rem; }
}

.nav-item i { width: 20px; text-align: center; }
.nav-item:hover, .nav-item.active {
    background: rgba(15, 23, 42, 0.05);
    color: var(--text-main);
}
/* Glassmorphism Depth System */
.stat-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 24px;
    padding: 25px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
}

.stat-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 45px rgba(31, 38, 135, 0.12);
    background: rgba(255, 255, 255, 0.9);
    z-index: 10;
}

.stat-card .secondary-data {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    margin-top: 0;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.stat-card:hover .secondary-data {
    max-height: 100px;
    opacity: 1;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--glass-border);
}

/* Automotive Safety Standard Conventions */
.status-pill {
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-functional { 
    background: rgba(34, 197, 94, 0.15); 
    color: #15803d; 
    border: 1px solid rgba(34, 197, 94, 0.3);
} /* Green */

.status-warning { 
    background: rgba(245, 158, 11, 0.15); 
    color: #b45309; 
    border: 1px solid rgba(245, 158, 11, 0.3);
} /* Amber */

.status-violation { 
    background: rgba(239, 68, 68, 0.15); 
    color: #b91c1c; 
    border: 1px solid rgba(239, 68, 68, 0.3);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.2);
} /* Red */

.status-violation i { animation: blink 1s infinite; }

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* Main Content Area */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.header {
    height: 80px;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--glass-border);
}

.alert-ticker {
    display: flex;
    align-items: center;
    gap: 20px;
    background: rgba(239, 68, 68, 0.08);
    padding: 8px 15px;
    border-radius: 100px;
    border: 1px solid rgba(239, 68, 68, 0.2);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--danger);
    cursor: pointer;
}

.alert-dot {
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--danger);
    animation: pulse 1.5s infinite;
}

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

.content-area {
    flex: 1;
    padding: 30px 40px;
    overflow-y: auto;
}

/* Dashboard Cards */
.nexus-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 25px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.stat-card h4 {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-bottom: 15px;
}

.stat-card .value {
    font-size: 2rem;
    font-weight: 700;
    font-family: var(--font-heading);
}

.stat-card .trend {
    font-size: 0.75rem;
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}

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

/* Early Warning Feed */
.warning-feed {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 25px;
}

.warning-item {
    display: flex;
    gap: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    margin-bottom: 12px;
    border-left: 3px solid var(--primary);
    transition: 0.2s;
}

.warning-item:hover { transform: translateX(5px); background: rgba(255, 255, 255, 0.04); }

.warning-item.critical { border-left-color: var(--danger); }

.warn-icon {
    width: 40px;
    height: 40px;
    background: rgba(245, 158, 11, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.1rem;
}

.critical .warn-icon { background: rgba(239, 68, 68, 0.1); color: var(--danger); }

.warn-info h5 { font-size: 0.95rem; margin-bottom: 4px; }
.warn-info p { font-size: 0.75rem; color: var(--text-muted); line-height: 1.4; }

/* Buttons */
.btn {
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    border: none;
    transition: 0.25s;
    font-family: var(--font-heading);
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-nexus { background: var(--primary); color: #fff; }
.btn-nexus:hover { background: #00d67f; box-shadow: 0 0 25px var(--primary-glow); }

.btn.active {
    background: rgba(0, 242, 255, 0.08);
    color: var(--primary);
    border: 1px solid rgba(0, 242, 255, 0.2);
}

/* Hidden View View Logic */
.view-section { display: none; }
.view-section.active { display: block; animation: fadeIn 0.4s ease-out; }

/* Radar Visualization */
.radar-container {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    border: 2px solid var(--glass-border);
    position: relative;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.05) 0%, transparent 70%);
    overflow: hidden;
}

.radar-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.circle-1 { width: 100px; height: 100px; }
.circle-2 { width: 200px; height: 200px; }
.circle-3 { width: 280px; height: 280px; }

.radar-sweep {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150px;
    height: 150px;
    background: conic-gradient(from 0deg, var(--primary-glow) 0%, transparent 20%);
    transform-origin: top left;
    animation: sweep 4s linear infinite;
    z-index: 1;
}

@keyframes sweep {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.radar-blip {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--danger);
    border-radius: 50%;
    box-shadow: 0 0 15px var(--danger);
    z-index: 2;
    animation: blink 2s infinite;
}

.blip-1 { top: 30%; left: 60%; background: var(--danger); }
.blip-2 { top: 60%; left: 30%; background: var(--primary); box-shadow: 0 0 15px var(--primary); }
.blip-3 { top: 45%; left: 45%; background: var(--secondary); box-shadow: 0 0 15px var(--secondary); }

@keyframes blink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.2); }
}

/* Executive Traffic Light */
.traffic-light {
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: #1e293b;
    padding: 20px;
    border-radius: 50px;
    border: 4px solid var(--glass-border);
    width: 80px;
}

.light {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    transition: 0.5s;
    position: relative;
}

.light.red.active { background: var(--danger); box-shadow: 0 0 30px var(--danger); }
.light.amber.active { background: var(--primary); box-shadow: 0 0 30px var(--primary); }
.light.green.active { background: var(--secondary); box-shadow: 0 0 30px var(--secondary); }

.light.active::after {
    content: '';
    position: absolute;
    inset: -5px;
    border: 2px solid white;
    border-radius: 50%;
    opacity: 0.4;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
/* Mobile Responsiveness */
@media (max-width: 1024px) {
    .sidebar {
        position: fixed;
        left: -280px;
        height: 100vh;
        transition: 0.3s;
    }
    .sidebar.active {
        left: 0;
    }
    .main-wrapper {
        margin-left: 0;
    }
    .header {
        padding: 0 20px;
    }
    .content-area {
        padding: 20px;
    }
    .dashboard-header .btn-nexus {
        width: 100%;
        margin-left: 0 !important;
    }
    
    /* Mobile Toggle Button */
    .mobile-toggle {
        display: flex;
        position: fixed;
        bottom: 25px;
        right: 25px;
        z-index: 2500;
        background: var(--primary);
        color: white;
        width: 60px;
        height: 60px;
        border-radius: 50%;
        border: none;
        box-shadow: 0 10px 30px rgba(59, 91, 126, 0.4);
        cursor: pointer;
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
        transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }
    .mobile-toggle:active { transform: scale(0.9); }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        backdrop-filter: blur(4px);
        z-index: 99;
    }
    .sidebar-overlay.active { display: block; }
}

@media (max-width: 768px) {
    .nexus-grid {
        grid-template-columns: 1fr;
    }
    .dashboard-grid {
        grid-template-columns: 1fr !important;
    }
    .section-header h1 {
        font-size: 1.8rem;
    }
}
