:root {
    --primary-color: #FF6B00;
    --secondary-color: #3F3D9E;
    --accent-color: #00cc99;
    --dark-color: #1a2b3c;
    --light-color: #f8f9fa;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --success-color: #28a745;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f2f5;
    color: #333;
    scroll-behavior: smooth;
}

.section-anchor {
    display: block;
    position: relative;
    top: -80px;
    visibility: hidden;
}

.navbar {
    background-color: var(--secondary-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 0.75rem 0;
}

.navbar-logo {
    height: 40px;
    width: auto;
}

.navbar-brand {
    font-size: 1.25rem;
    font-weight: 600;
}

.vision-text {
    color: var(--dark-color);
    font-weight: bold;
}

.drive-text {
    color: var(--primary-color);
    font-weight: bold;
}

.navbar-brand .vision-text,
.navbar-brand .drive-text {
    color: white;
}

.navbar-brand .drive-text {
    color: var(--primary-color);
}

footer .vision-text {
    color: white;
}

footer .drive-text {
    color: var(--primary-color);
}

.nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
    transition: color 0.3s ease;
    padding: 0.5rem 1rem !important;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color) !important;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: #e55f00;
    border-color: #e55f00;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 107, 0, 0.3);
}

.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 15px 20px;
    border-radius: 10px 10px 0 0 !important;
}

.card-header h5 {
    color: var(--secondary-color);
    font-weight: 600;
}

.card-header i {
    color: var(--primary-color);
    margin-right: 8px;
}

.main-card {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
}

.video-container {
    position: relative;
    width: 100%;
    height: 400px;
    background-color: #000;
    overflow: hidden;
}

.input-video {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1); /* Mirror video */
}

.output-canvas {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1); /* Mirror canvas to match video */
}

.overlay-alerts {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    width: auto;
    max-width: 60%;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.overlay-alerts .alert {
    display: none;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
    margin-bottom: 0;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    min-width: 200px;
}

.overlay-metrics {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 10px 15px;
    border-radius: 8px;
    color: white;
    display: flex;
    gap: 15px;
    z-index: 10;
}

.metric {
    display: flex;
    align-items: center;
    gap: 5px;
}

.metric .label {
    font-size: 14px;
    opacity: 0.8;
}

.metric .value {
    font-size: 16px;
    font-weight: bold;
    color: var(--primary-color);
}

.metric-card {
    background-color: #fff;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
    border-left: 4px solid var(--primary-color);
}

.metric-value {
    font-size: 18px;
    font-weight: bold;
    color: var(--secondary-color);
}

.progress {
    height: 8px;
    margin-top: 10px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    background-color: var(--primary-color) !important;
    transition: width 0.3s ease;
}

.event-log {
    height: 200px;
    overflow-y: auto;
    padding: 0;
}

.event-item {
    padding: 10px 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 14px;
}

.event-item:last-child {
    border-bottom: none;
}

.event-time {
    font-size: 12px;
    color: #6c757d;
    margin-right: 8px;
}

.event-warning {
    color: var(--warning-color);
}

.event-danger {
    color: var(--danger-color);
}

.event-success {
    color: var(--success-color);
}

.event-info {
    color: var(--primary-color);
}

.feature-card {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    height: 100%;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-top: 3px solid var(--primary-color);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.feature-card h5 {
    color: var(--secondary-color);
    font-weight: 600;
    margin-top: 10px;
}

.icon-container {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), #ff8533);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    box-shadow: 0 4px 8px rgba(255, 107, 0, 0.3);
}

.icon-container i {
    font-size: 24px;
}

footer {
    background-color: var(--secondary-color);
    color: white;
}

.footer-logo {
    height: 50px;
    width: auto;
}

.badge {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

.alert h5 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.alert p {
    margin-bottom: 0;
    font-size: 0.875rem;
}

/* Animations */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.drowsy-alert, .distracted-alert {
    animation: pulse 1s infinite;
}

/* Form styling */
.form-label {
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.form-select,
.form-range {
    border-color: #dee2e6;
}

.form-select:focus,
.form-range:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(255, 107, 0, 0.25);
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .navbar-logo {
        height: 32px;
    }
    
    .navbar-brand {
        font-size: 1rem;
    }
    
    .video-container {
        height: 300px;
    }
    
    .overlay-alerts .alert {
        font-size: 12px;
        padding: 6px 12px;
        min-width: 150px;
    }
    
    .overlay-alerts {
        max-width: 80%;
    }
    
    .overlay-metrics {
        flex-direction: column;
        gap: 5px;
    }
    
    .section-anchor {
        top: -60px;
    }
}

/* Scrollbar styling */
.event-log::-webkit-scrollbar {
    width: 6px;
}

.event-log::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.event-log::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.event-log::-webkit-scrollbar-thumb:hover {
    background: #e55f00;
}
