:root {
    --bg-dark: #0f111a;
    --bg-card: rgba(25, 28, 41, 0.6);
    --glass-border: rgba(255, 255, 255, 0.05);
    
    --accent-teal: #00f2fe;
    --accent-blue: #4facfe;
    --accent-green: #43e97b;
    --accent-gold: #f6d365;
    
    --text-primary: #ffffff;
    --text-secondary: #a0a5b8;
    
    --font-stack: 'Inter', sans-serif;
}

body.dark-theme {
    margin: 0;
    padding: 0;
    font-family: var(--font-stack);
    background-color: var(--bg-dark);
    /* Subtle background gradient geometry mock */
    background-image: radial-gradient(circle at 10% 20%, rgba(0, 242, 254, 0.05) 0%, transparent 40%),
                      radial-gradient(circle at 90% 80%, rgba(79, 172, 254, 0.1) 0%, transparent 40%);
    color: var(--text-primary);
    min-height: 100vh;
}

/* Dashboard Cockpit - Integrated Viewport Lock */
html.dashboard-active, 
body.dashboard-active {
    height: 100vh !important;
    overflow: hidden !important;
    position: fixed;
    width: 100%;
}

.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
}

/* Sidebar */
.layout-wrapper {
    width: 100%;
    position: relative;
}

/* Floating Bottom Nav */
.bottom-nav-container {
    position: fixed;
    bottom: 24px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    z-index: 1000;
    pointer-events: none;
}

.bottom-nav {
    pointer-events: auto;
    padding: 10px 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.bottom-nav .nav-list {
    display: flex;
    align-items: center;
    gap: 12px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-item {
    position: relative;
}

.nav-item a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1.2rem;
}

.nav-item a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-teal);
    transform: translateY(-5px);
}

.nav-item.active a {
    background: rgba(0, 242, 254, 0.15);
    color: var(--accent-teal);
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.2);
}

/* Sprint 12: Interactive Toggle States */
.nav-item {
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 1;
    transform: translateY(0) scale(1);
}

.bottom-nav.collapsed .nav-item:not(.nav-logo) {
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.8);
    width: 0;
    margin: 0;
    pointer-events: none;
}

.bottom-nav {
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    min-width: 80px; /* Logo width */
}

/* Tooltip Labels */
.nav-label {
    position: absolute;
    bottom: 130%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--bg-dark);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.nav-label::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--bg-dark);
}

.nav-item:hover .nav-label {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Centered Logo / Toggle Trigger */
.nav-logo {
    padding: 0 15px;
    cursor: pointer;
    z-index: 10;
}

.nav-logo img {
    height: 42px;
    width: auto;
    filter: drop-shadow(0 0 8px rgba(0, 242, 254, 0.3));
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Pulsing effect when collapsed */
.bottom-nav.collapsed .nav-logo img {
    animation: beacon-pulse 2s infinite;
    filter: drop-shadow(0 0 15px rgba(0, 242, 254, 0.6));
}

@keyframes beacon-pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 242, 254, 0.4); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 15px rgba(0, 242, 254, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 242, 254, 0); }
}

.nav-logo:hover img {
    transform: scale(1.1) rotate(5deg);
}

/* Main Content */
.main-content {
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    padding: 32px 40px 80px 40px; /* Reduced for interactive nav */
}

body.dashboard-active .main-content {
    height: 100vh;
    padding-bottom: 24px; /* Tighter padding for locked view */
    overflow: hidden;
}

.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.top-nav h1 {
    font-size: 2.2rem;
    margin: 0;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(135deg, var(--accent-teal), var(--accent-blue));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
    text-transform: uppercase;
    filter: drop-shadow(0 2px 10px rgba(0, 242, 254, 0.3));
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-bar {
    padding: 10px 20px;
    border-radius: 20px;
    color: white;
    outline: none;
    border: 1px solid var(--glass-border);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-info strong {
    display: block;
    font-size: 0.9rem;
}

.user-info small {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.logout-btn {
    color: #ff4d4d;
    text-decoration: none;
    font-size: 0.9rem;
}

/* Dashboard Cockpit (Modern Unified View) */
.dashboard-cockpit {
    display: flex;
    flex-direction: column;
    gap: 8px; /* Slightly tighter for viewport lock */
    flex: 1;
    overflow: hidden;
}

.cockpit-top-strip {
    display: flex;
    gap: 20px;
    margin-bottom: 4px;
}

.cockpit-main-deck {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 20px;
    height: calc(100vh - 220px); /* Expanded for larger forensic view */
}

.deck-left {
    height: 100%;
}

.deck-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100%;
    overflow: hidden;
}

.side-panel-section {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: 250px;
}

.side-panel-section:last-child {
    flex: 1;
    min-height: 0; /* Allow the section to shrink and show scrollbars */
}

.section-title {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-primary);
}

/* Metric Cards - Horizontal Cockpit Style */
.metrics-grid {
    display: flex;
    gap: 16px;
    flex: 1;
}

.metric-card {
    flex: 1;
    padding: 12px 16px;
    border-radius: 12px;
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-5px);
}

.metric-card i {
    font-size: 1.2rem;
    color: var(--accent-teal);
    width: 40px;
    height: 40px;
    background: rgba(0, 242, 254, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.metric-content {
    display: flex;
    flex-direction: column;
}

.metric-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.metric-detail {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
    z-index: 1;
}

/* Boxed User Profile like mockup */
.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,0.05);
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
}

/* Data Table */
.data-container {
    padding: 24px;
    border-radius: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0; /* Critical for inner scrolling */
    overflow: hidden;
}

.table-scroll {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
}

/* Custom scrollbar for better appearance */
.table-scroll::-webkit-scrollbar {
    width: 6px;
}
.table-scroll::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
}

.data-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.data-header-actions button {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    margin-left: 8px;
    cursor:pointer;
}

.data-header-actions .btn-primary {
    background: var(--accent-teal);
    color: #000;
    border: none;
    font-weight: 600;
}

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

.table th, .table td {
    padding: 16px 8px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.table th {
    color: var(--text-secondary);
    font-weight: 400;
    font-size: 0.85rem;
}

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

/* Status Badges */
.status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    display: inline-block;
    border: 1px solid transparent;
}

.status-progress {
    color: var(--accent-green);
    border-color: rgba(67, 233, 123, 0.3);
    background: rgba(67, 233, 123, 0.1);
    box-shadow: 0 0 10px rgba(67, 233, 123, 0.2);
    animation: pulse 2s infinite;
}

.status-scheduled {
    color: var(--accent-gold);
    border-color: rgba(246, 211, 101, 0.3);
    background: rgba(246, 211, 101, 0.1);
}

.status-done {
    color: var(--accent-blue);
    border-color: rgba(79, 172, 254, 0.3);
    background: rgba(79, 172, 254, 0.1);
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(67, 233, 123, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(67, 233, 123, 0); }
    100% { box-shadow: 0 0 0 0 rgba(67, 233, 123, 0); }
}

/* Login Page Styles */
.login-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.login-box {
    width: 400px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-box input {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--glass-border);
    padding: 12px 16px;
    color: white;
    border-radius: 8px;
    outline: none;
}

.login-box .btn-login {
    background: var(--accent-teal);
    color: black;
    font-weight: bold;
    border: none;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
}

.error-alert {
    background: rgba(255, 0, 0, 0.1);
    color: #ff4d4d;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(255,0,0,0.3);
}

/* Modals */
.modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0,0,0,0.6); 
    backdrop-filter: blur(5px);
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--bg-dark);
    padding: 30px;
    width: 100%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 16px;
    margin-bottom: 8px;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.4rem;
}

.close-btn {
    color: var(--text-secondary);
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
    line-height: 1;
}

.close-btn:hover {
    color: white;
}

/* --- Sprint 11: Location Playback Panel --- */
.playback-panel {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    z-index: 1000;
    display: none;
    align-items: center;
    gap: 20px;
    padding: 15px 25px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.playback-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.playback-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--accent-teal);
    color: black;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.playback-btn:hover { transform: scale(1.1); box-shadow: 0 0 15px rgba(0, 242, 254, 0.4); }

.playback-timeline {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
}

.playback-timeline::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--accent-teal);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.5);
}

.playback-meta {
    display: flex;
    flex-direction: column;
    min-width: 150px;
}

.playback-tech-name { color: #f8fafc; font-weight: 800; font-size: 0.9rem; }
.playback-time { color: var(--accent-blue); font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; font-weight: 600; }

.speed-badge {
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: #94a3b8;
    font-size: 0.7rem;
    font-weight: 800;
    cursor: pointer;
}

.speed-badge.active { background: var(--accent-teal); color: black; border-color: transparent; }

/* Pulse effect for playback marker */
@keyframes markerPulse {
    0% { transform: scale(0.8); opacity: 0.8; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0.8); opacity: 0.8; }
}

.playback-marker-icon {
    background: var(--accent-teal);
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    animation: markerPulse 1s infinite;
}
