:root {
    --bg-base: #0a0a0c;
    --bg-surface: rgba(22, 22, 28, 0.65);
    --bg-surface-solid: #15151c;
    --border-color: rgba(255, 255, 255, 0.06);
    --border-glow: rgba(225, 6, 0, 0.25);
    
    --primary: #e10600; /* F1 Red */
    --primary-hover: #ff221c;
    --primary-glow: rgba(225, 6, 0, 0.4);
    
    --accent-blue: #2563eb;
    --accent-green: #10b981;
    --accent-yellow: #f59e0b;
    
    --text-main: #f1f1f3;
    --text-muted: #8e8e9c;
    --text-highlight: #ffffff;
    
    --shadow-main: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-base);
    background-image: 
        radial-gradient(at 10% 20%, rgba(225, 6, 0, 0.08) 0px, transparent 50%),
        radial-gradient(at 90% 80%, rgba(37, 99, 235, 0.04) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    height: 100vh;
    overflow: hidden;
}

/* App Layout */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(10, 10, 12, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 10;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.f1-indicator {
    width: 4px;
    height: 24px;
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
    border-radius: 2px;
    transform: skewX(-15deg);
}

.logo-container h1 {
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 1.5rem;
    letter-spacing: 1px;
    color: var(--text-highlight);
}

.logo-container h1 span {
    color: var(--primary);
}

.status-panel {
    display: flex;
    gap: 1rem;
}

.status-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-green);
    position: relative;
}

.pulse-dot.active::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: inherit;
    border-radius: inherit;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* Workspace Grid */
.app-workspace {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 1.5rem;
    padding: 1.5rem;
    flex: 1;
    overflow: hidden;
    height: calc(100vh - 70px);
}

/* Glass Card Common */
.glass-card {
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-main);
    transition: var(--transition-smooth);
    overflow: hidden;
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.15);
}

.card-header h3 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    color: var(--text-highlight);
}

.card-body {
    padding: 1.25rem;
}

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

.icon {
    width: 20px;
    height: 20px;
    fill: var(--primary);
    filter: drop-shadow(0 0 4px var(--primary-glow));
}

.icon-small {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Sidebar Specific */
.sidebar-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
}

.sync-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 1rem;
}

.sync-status-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.6rem 0.8rem;
    border-radius: 6px;
    margin-bottom: 0.75rem;
    border: 1px solid var(--border-color);
}

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

.badge {
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.status-idle { background: rgba(255, 255, 255, 0.1); color: var(--text-main); }
.status-running { background: rgba(37, 99, 235, 0.2); color: #60a5fa; border: 1px solid rgba(37, 99, 235, 0.3); }
.status-success { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.status-failed { background: rgba(220, 38, 38, 0.2); color: #f87171; border: 1px solid rgba(220, 38, 38, 0.3); }

.sync-message {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    min-height: 1.2rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Document List */
.docs-card {
    flex: 1;
}

.doc-list-container {
    flex: 1;
    overflow-y: auto;
    max-height: 300px;
    min-height: 120px;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.2);
}

.doc-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition-smooth);
}

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

.doc-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.doc-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    max-width: 75%;
}

.doc-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-highlight);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doc-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.doc-status {
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.loading-placeholder {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Document Upload */
.upload-container {
    width: 100%;
}

.upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: var(--transition-smooth);
    background: rgba(255, 255, 255, 0.01);
}

.upload-label:hover {
    border-color: var(--primary);
    color: var(--text-highlight);
    background: rgba(225, 6, 0, 0.03);
}

.upload-status {
    font-size: 0.75rem;
    margin-top: 0.5rem;
    text-align: center;
    min-height: 1rem;
}

/* Main Panel Specific */
.main-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.15);
}

.chat-title-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-glow {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 8px 2px var(--primary-glow);
}

.chat-header h2 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-highlight);
}

.chat-settings {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.chat-settings select {
    background: #181822;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    font-family: var(--font-body);
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.message {
    display: flex;
    gap: 1rem;
    max-width: 85%;
    animation: slideIn 0.3s ease-out forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-ai {
    align-self: flex-start;
}

.message-user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    font-family: var(--font-heading);
    flex-shrink: 0;
}

.message-ai .avatar {
    background: linear-gradient(135deg, var(--primary), #a80400);
    color: var(--text-highlight);
    box-shadow: 0 0 8px var(--primary-glow);
}

.message-user .avatar {
    background: linear-gradient(135deg, #374151, #1f2937);
    color: var(--text-highlight);
}

.message-content {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 12px;
    border-top-left-radius: 0;
    font-size: 0.92rem;
    line-height: 1.5;
    color: var(--text-main);
}

.message-user .message-content {
    background: rgba(225, 6, 0, 0.05);
    border-color: rgba(225, 6, 0, 0.15);
    border-top-left-radius: 12px;
    border-top-right-radius: 0;
}

.message-content p {
    margin-bottom: 0.75rem;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.sample-questions {
    list-style: none;
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sample-questions li {
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: var(--transition-smooth);
    color: var(--text-muted);
}

.sample-questions li:hover {
    color: var(--text-highlight);
    background: rgba(225, 6, 0, 0.08);
    border-color: rgba(225, 6, 0, 0.3);
    transform: translateX(4px);
}

/* Citations / Sources list */
.sources-container {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--border-color);
}

.sources-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: var(--primary);
    cursor: pointer;
    font-weight: 600;
    user-select: none;
    transition: var(--transition-smooth);
}

.sources-toggle:hover {
    opacity: 0.8;
}

.sources-toggle svg {
    width: 12px;
    height: 12px;
    fill: currentColor;
    transition: transform 0.2s ease;
}

.sources-toggle.open svg {
    transform: rotate(90deg);
}

.sources-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.source-card {
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.6rem 0.8rem;
    font-size: 0.8rem;
}

.source-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.3rem;
    font-weight: 600;
}

.source-name {
    color: var(--text-highlight);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.source-score {
    color: var(--accent-green);
    font-size: 0.72rem;
}

.source-text {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.75rem;
    line-height: 1.4;
    white-space: pre-line;
}

/* Chat Input Bar */
.chat-input-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.15);
}

.chat-input-container textarea {
    flex: 1;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.9rem;
    resize: none;
    outline: none;
    max-height: 100px;
    transition: var(--transition-smooth);
}

.chat-input-container textarea:focus {
    border-color: rgba(225, 6, 0, 0.5);
    box-shadow: 0 0 10px rgba(225, 6, 0, 0.15);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: var(--transition-smooth);
    user-select: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--text-highlight);
    box-shadow: 0 4px 12px rgba(225, 6, 0, 0.2);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 16px rgba(225, 6, 0, 0.4);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-full {
    width: 100%;
}

.btn-round {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    padding: 0;
    flex-shrink: 0;
}

.icon-send {
    width: 18px;
    height: 18px;
    fill: currentColor;
    margin-left: 2px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(4px);
    transition: opacity 0.3s ease;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    width: 80%;
    max-width: 800px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
}

.modal-header h3 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-highlight);
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-close:hover {
    color: var(--primary);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    background: #0f0f15;
}

.modal-body pre {
    white-space: pre-wrap;
    word-break: break-all;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    color: #e5e7eb;
}

/* Table styling inside chat responses */
.message-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75rem 0;
    font-size: 0.82rem;
}

.message-content th, .message-content td {
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.6rem;
    text-align: left;
}

.message-content th {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-highlight);
    font-weight: 600;
}

.message-content tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.01);
}

/* Spinner */
.spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.hidden {
    display: none !important;
}

/* Bouncing Dots Loading */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 1.25rem;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    animation: bounce 1.2s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounce {
    0%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-6px); }
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-glow);
}

/* ----------------------------------------------------
   Dashboard Tabs Styling
   ---------------------------------------------------- */
.dashboard-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: rgba(0, 0, 0, 0.25);
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-btn:hover {
    color: var(--text-highlight);
    background: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
    color: var(--text-highlight);
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(225, 6, 0, 0.25);
}

.tab-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.tab-content.hidden {
    display: none !important;
}

/* Tab Header Description */
.tab-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.15);
}

.tab-header.flex-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tab-header h2 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-highlight);
    margin-bottom: 0.25rem;
}

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

/* ----------------------------------------------------
   Predictor Tab Styling
   ---------------------------------------------------- */
.predictions-container {
    display: grid;
    grid-template-columns: 350px 1fr;
    flex: 1;
    overflow: hidden;
}

.predictions-sidebar {
    border-right: 1px solid var(--border-color);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.1);
}

.prediction-card {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

.prediction-card h3 {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-highlight);
    margin-bottom: 0.75rem;
    border-left: 3px solid var(--primary);
    padding-left: 0.5rem;
}

/* Upcoming GP countdown */
.upcoming-gp-card {
    text-align: center;
    background: linear-gradient(135deg, rgba(225, 6, 0, 0.05) 0%, rgba(0, 0, 0, 0.3) 100%);
    border-color: rgba(225, 6, 0, 0.2);
}

.upcoming-gp-card h3 {
    border: none;
    padding-left: 0;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    color: var(--primary);
}

.gp-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--text-highlight);
    margin: 0.25rem 0;
}

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

.gp-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.countdown-timer {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

.time-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.4rem 0.6rem;
    min-width: 55px;
}

.time-block span {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-highlight);
}

.time-block label {
    font-size: 0.6rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 0.1rem;
}

/* Win probability progress bar lists */
.prob-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-top: 0.5rem;
}

.prob-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.prob-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
}

.prob-driver {
    font-weight: 600;
    color: var(--text-highlight);
}

.prob-team {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: normal;
}

.prob-percent {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--primary);
}

.prob-bar-bg {
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
}

.prob-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #a80400 0%, var(--primary) 100%);
    border-radius: 3px;
    width: 0%;
    transition: width 1s ease-out;
}

/* Championship toggle header */
.card-header-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    border-left: 3px solid var(--primary);
    padding-left: 0.5rem;
}

.card-header-toggle h3 {
    border: none;
    padding-left: 0;
    margin-bottom: 0;
}

.odds-toggle {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 2px;
}

.toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    border-radius: 3px;
    font-family: var(--font-body);
    transition: var(--transition-smooth);
}

.toggle-btn.active {
    background: var(--primary);
    color: var(--text-highlight);
}

/* AI Report Panel */
.prediction-report-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.05);
}

.panel-header-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.1);
}

.panel-header-action h3 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-highlight);
    font-size: 1.05rem;
}

.report-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-main);
}

.report-placeholder {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: var(--text-muted);
    text-align: center;
    padding: 2rem;
}

/* Markdown styling inside report */
.markdown-body h1, .markdown-body h2, .markdown-body h3 {
    font-family: var(--font-heading);
    color: var(--text-highlight);
    margin-top: 1.25rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.markdown-body h1 {
    font-size: 1.35rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.4rem;
}

.markdown-body h2 {
    font-size: 1.15rem;
    color: var(--primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.25rem;
}

.markdown-body h3 {
    font-size: 1rem;
}

.markdown-body p {
    margin-bottom: 0.75rem;
}

.markdown-body ul {
    margin-bottom: 0.75rem;
    padding-left: 1.5rem;
}

.markdown-body li {
    margin-bottom: 0.25rem;
}

.markdown-body strong {
    color: var(--text-highlight);
}

/* ----------------------------------------------------
   Standings & Charts Tab Styling
   ---------------------------------------------------- */
.subtab-btn {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
    cursor: pointer;
    border-radius: 4px;
    transition: var(--transition-smooth);
}

.subtab-btn:hover {
    color: var(--text-highlight);
    background: rgba(255, 255, 255, 0.03);
}

.subtab-btn.active {
    background: rgba(225, 6, 0, 0.08);
    border-color: var(--primary);
    color: var(--text-highlight);
}

.analytics-container {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.analytics-subview {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.analytics-subview.hidden {
    display: none !important;
}

.analytics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    flex: 1;
}

.table-card {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.chart-card {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
}

.chart-card h3 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-highlight);
    margin-bottom: 1rem;
    border-left: 3px solid var(--primary);
    padding-left: 0.5rem;
}

.chart-wrapper {
    flex: 1;
    min-height: 250px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Beautiful F1 styled table */
.f1-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    text-align: left;
}

.f1-table th {
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.f1-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--text-main);
    font-family: var(--font-body);
}

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

/* Highlight Podium positions */
.f1-table tbody tr:nth-child(1) td:first-child {
    font-weight: 900;
    color: #ffd700; /* Gold */
}

.f1-table tbody tr:nth-child(2) td:first-child {
    font-weight: 900;
    color: #c0c0c0; /* Silver */
}

.f1-table tbody tr:nth-child(3) td:first-child {
    font-weight: 900;
    color: #cd7f32; /* Bronze */
}

/* ----------------------------------------------------
   Recent F1 News Tab Styling
   ---------------------------------------------------- */
.news-feed-container {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.news-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
    margin-top: 1.25rem;
}

.news-card {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: var(--transition-smooth);
}

.news-card:hover {
    transform: translateY(-2px);
    border-color: rgba(225, 6, 0, 0.3);
    background: rgba(255, 255, 255, 0.025);
    box-shadow: 0 8px 12px rgba(225, 6, 0, 0.05);
}

.news-title {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-highlight);
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.news-meta {
    font-size: 0.7rem;
    color: var(--primary);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.news-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 1.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-link-btn {
    align-self: flex-start;
    color: var(--text-highlight);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.news-link-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--text-highlight);
}

.docs-link:hover {
    color: var(--text-highlight) !important;
    border-color: var(--primary) !important;
    background: rgba(225, 6, 0, 0.05);
}


