/* F1 Analysis Web App - Custom Styles */

/* CSS Variables for consistent theming */
:root {
    --f1-red: #e10600;
    --f1-dark: #15151e;
    --f1-light: #ffffff;
    --f1-grey: #38383f;
    --f1-blue: #0090d0;
    --f1-green: #00d2be;
    --f1-orange: #ff8700;
    --f1-purple: #6f1ab6;
    
    /* Team Colors */
    --redbull: #1e41ff;
    --mercedes: #00d2be;
    --ferrari: #dc143c;
    --mclaren: #ff8700;
    --aston-martin: #006f62;
    --alpine: #0090ff;
    --williams: #005aff;
    --alphatauri: #2b4562;
    --alfa-romeo: #900000;
    --haas: #ffffff;
    
    /* Text contrast improvements */
    --text-muted: rgba(255, 255, 255, 0.75);
    --text-secondary: rgba(255, 255, 255, 0.8);
    --text-light: rgba(255, 255, 255, 0.9);
}

/* Base Styling - Improved Readability */
body {
    background: linear-gradient(135deg, #1a1a2e, #16213e, #1a1a2e);
    background-attachment: fixed;
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #ffffff;
}

/* Text Contrast Improvements */
.text-muted {
    color: rgba(255, 255, 255, 0.75) !important;
}

.text-secondary {
    color: rgba(255, 255, 255, 0.8) !important;
}

small, .small {
    color: rgba(255, 255, 255, 0.85);
}

.badge {
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Header Styling */
.navbar {
    background: rgba(21, 21, 30, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid var(--f1-red);
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.navbar-brand .f1-icon {
    color: var(--f1-red);
    margin-right: 0.5rem;
}

/* Card Enhancements */
.card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    color: #ffffff;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.12);
}

.card-header {
    background: rgba(255, 255, 255, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-weight: 600;
}

/* Metric Cards */
.metric-card {
    text-align: center;
    transition: all 0.3s ease;
    border-radius: 15px;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.metric-card:hover {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.1);
}

/* Feature Icons */
.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(45deg, var(--f1-red), #ff4757);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(45deg, #b8051c, var(--f1-red));
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(225, 6, 0, 0.4);
}

.btn-success {
    background: linear-gradient(45deg, var(--f1-green), #1dd1a1);
}

.btn-success:hover {
    background: linear-gradient(45deg, #00a699, var(--f1-green));
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 210, 190, 0.4);
}

.btn-info {
    background: linear-gradient(45deg, var(--f1-blue), #3742fa);
}

.btn-warning {
    background: linear-gradient(45deg, var(--f1-orange), #ffa502);
}

/* Form Controls - Improved Contrast */
.form-control, .form-select {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    border-radius: 8px;
}

.form-control:focus, .form-select:focus {
    background: rgba(255, 255, 255, 0.25);
    border-color: var(--f1-red);
    box-shadow: 0 0 0 0.2rem rgba(225, 6, 0, 0.25);
    color: #ffffff;
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.8);
}

.form-select option {
    background: #2a2a3e;
    color: #ffffff;
}

/* Status Indicators */
.status-indicator .badge {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

/* Progress Bars */
.progress {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    transition: all 0.3s ease;
}

/* Alert Enhancements */
.alert {
    border: none;
    border-radius: 12px;
    border-left: 4px solid;
}

.alert-success {
    background: rgba(0, 210, 190, 0.1);
    border-left-color: var(--f1-green);
    color: #ffffff;
}

.alert-danger {
    background: rgba(225, 6, 0, 0.1);
    border-left-color: var(--f1-red);
    color: #ffffff;
}

.alert-warning {
    background: rgba(255, 135, 0, 0.1);
    border-left-color: var(--f1-orange);
    color: #ffffff;
}

.alert-info {
    background: rgba(0, 144, 208, 0.1);
    border-left-color: var(--f1-blue);
    color: #ffffff;
}

/* Chart Container */
.chart-container {
    min-height: 300px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1rem;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)), 
                url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 400"><defs><pattern id="f1-pattern" x="0" y="0" width="40" height="40" patternUnits="userSpaceOnUse"><rect width="40" height="40" fill="%23000"/><rect x="20" y="20" width="20" height="20" fill="%23111"/></pattern></defs><rect width="100%" height="100%" fill="url(%23f1-pattern)"/></svg>');
    background-size: cover;
    background-position: center;
    color: white;
    padding: 4rem 0;
    text-align: center;
}

/* Live Feed */
.live-feed {
    max-height: 400px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 1rem;
}

.feed-item {
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.feed-item:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-left-color: var(--f1-red);
}

/* Timeline */
.timeline-item {
    position: relative;
    padding-left: 2rem;
    border-left: 2px solid rgba(255, 255, 255, 0.2);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 0.5rem;
    width: 10px;
    height: 10px;
    background: var(--f1-red);
    border-radius: 50%;
}

.timeline-item:last-child {
    border-left-color: transparent;
}

/* Rankings */
.ranking-item {
    transition: all 0.3s ease;
}

.ranking-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--f1-red) !important;
}

/* Tables */
.table-dark {
    --bs-table-bg: rgba(255, 255, 255, 0.05);
}

.table-dark tbody tr:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Animations */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(225, 6, 0, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(225, 6, 0, 0.8), 0 0 30px rgba(225, 6, 0, 0.6);
    }
}

.pulse-glow {
    animation: pulse-glow 2s infinite;
}

@keyframes slide-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in-up {
    animation: slide-in-up 0.6s ease-out;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 0;
    }
    
    .metric-card {
        margin-bottom: 1rem;
    }
    
    .feature-icon {
        font-size: 2rem;
    }
    
    .display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
        font-size: calc(1rem + 2vw);
    }
}

/* Team-specific styling */
.team-redbull { border-left: 4px solid var(--redbull); }
.team-mercedes { border-left: 4px solid var(--mercedes); }
.team-ferrari { border-left: 4px solid var(--ferrari); }
.team-mclaren { border-left: 4px solid var(--mclaren); }
.team-aston-martin { border-left: 4px solid var(--aston-martin); }
.team-alpine { border-left: 4px solid var(--alpine); }
.team-williams { border-left: 4px solid var(--williams); }
.team-alphatauri { border-left: 4px solid var(--alphatauri); }
.team-alfa-romeo { border-left: 4px solid var(--alfa-romeo); }
.team-haas { border-left: 4px solid var(--haas); }

/* Loading States */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--f1-red);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #b8051c;
}

/* Focus states for accessibility */
.btn:focus, .form-control:focus, .form-select:focus {
    outline: 2px solid var(--f1-red);
    outline-offset: 2px;
}

/* Performance optimizations */
.card, .btn, .metric-card {
    will-change: transform;
}

/* Print styles */
@media print {
    .navbar, .btn, .live-feed {
        display: none !important;
    }
    
    .card {
        background: white !important;
        color: black !important;
        border: 1px solid #000 !important;
    }
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
    :root {
        --text-muted: rgba(255, 255, 255, 0.8);
        --text-secondary: rgba(255, 255, 255, 0.85);
        --text-light: rgba(255, 255, 255, 0.95);
    }
}

/* Text contrast improvements */
.text-muted {
    color: var(--text-muted) !important;
}

.text-secondary {
    color: var(--text-secondary) !important;
}

small, .small {
    color: var(--text-light);
}

.badge {
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Table improvements for contrast */
.table-dark th, .table-dark td {
    border-color: rgba(255, 255, 255, 0.2);
}

.table-dark {
    --bs-table-bg: rgba(255, 255, 255, 0.05);
}

/* Link improvements */
a {
    color: #64b5f6;
}

a:hover {
    color: #90caf9;
    text-decoration: underline;
}

/* Status indicators */
.text-success {
    color: #81c784 !important;
}

.text-warning {
    color: #ffb74d !important;
}

.text-danger {
    color: #e57373 !important;
}
@media (prefers-color-scheme: dark) {
    body {
        color: #ffffff;
    }
}