﻿/* ===== RACING API - GFB STYLED THEMES ===== */
/* Inspired by the beautiful crypto trading app design */

/* ===== ROOT VARIABLES - DARK THEME (DEFAULT) ===== */
:root {
    /* Dark Theme Colors */
    --bg-primary: #0a1628;
    --bg-secondary: #1a2332;
    --bg-card: #1e2938;
    --text-primary: #ffffff;
    --text-secondary: #b8c5d6;

    /* Accent Colors - Those beautiful buttons you love! */
    --cyan-bright: #00d4ff;
    --cyan-hover: #00bfff;
    --purple-bright: #d946ef;
    --purple-hover: #c026d3;
    --lime-green: #7dd956;
    --lime-hover: #6ee7b7;
    --yellow-accent: #fbbf24;

    /* Semantic Colors */
    --primary-color: #0a1628;
    --secondary-color: var(--cyan-bright);
    --success-color: var(--lime-green);
    --warning-color: var(--yellow-accent);
    --danger-color: #ef4444;
    --info-color: var(--cyan-bright);

    /* Border & Shadow */
    --border-color: rgba(0, 212, 255, 0.2);
    --shadow-color: rgba(0, 0, 0, 0.3);
}

/* ===== LIGHT THEME VARIABLES ===== */
[data-theme="light"] {
    /* Light Theme Colors - Enhanced contrast */
    --bg-primary: #f1f5f9;
    --bg-secondary: #e2e8f0;
    --bg-card: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #64748b;

    /* Vibrant button colors - slightly adjusted for light mode */
    --cyan-bright: #0891b2;
    --cyan-hover: #0e7490;
    --purple-bright: #9333ea;
    --purple-hover: #7e22ce;
    --lime-green: #16a34a;
    --lime-hover: #15803d;
    --yellow-accent: #f59e0b;

    /* Semantic Colors */
    --primary-color: #ffffff;
    --secondary-color: var(--cyan-bright);
    --success-color: var(--lime-green);
    --warning-color: #d97706;
    --danger-color: #dc2626;
    --info-color: var(--cyan-bright);

    /* Border & Shadow - better definition */
    --border-color: #cbd5e1;
    --shadow-color: rgba(0, 0, 0, 0.15);
}

/* ===== BODY & LAYOUT ===== */
body {
    background: var(--bg-primary);
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-primary);
    position: relative;
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Starry Background Effect - Dark Theme Only */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(4px 4px at 20px 30px, rgba(255, 255, 255, 0.5), rgba(0, 0, 0, 0)),
        radial-gradient(4px 4px at 60px 70px, rgba(255, 255, 255, 0.4), rgba(0, 0, 0, 0)),
        radial-gradient(3px 3px at 50px 50px, rgba(255, 255, 255, 0.6), rgba(0, 0, 0, 0)),
        radial-gradient(3px 3px at 130px 80px, rgba(255, 255, 255, 0.5), rgba(0, 0, 0, 0)),
        radial-gradient(4px 4px at 90px 10px, rgba(255, 255, 255, 0.45), rgba(0, 0, 0, 0));
    background-size: 200px 200px;
    background-position: 0 0, 40px 60px, 130px 270px, 70px 100px, 150px 50px;
    animation: sparkle 20s linear infinite;
    pointer-events: none;
    z-index: 0;
    opacity: 1;
    transition: opacity 0.3s ease;
}

[data-theme="light"] body::before {
    opacity: 0;
}

@keyframes sparkle {
    from { background-position: 0 0, 40px 60px, 130px 270px, 70px 100px, 150px 50px; }
    to { background-position: -200px -200px, -160px -140px, -70px 70px, -130px -100px, -50px -150px; }
}

.main-container {
    background: var(--bg-card);
    border-radius: 15px;
    box-shadow: 0 10px 30px var(--shadow-color);
    margin: 2rem auto;
    padding: 2rem;
    min-height: calc(100vh - 200px);
    position: relative;
    z-index: 1;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

/* ===== NAVBAR STYLES ===== */
.navbar {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%) !important;
    box-shadow: 0 4px 20px var(--shadow-color);
    border: none;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    z-index: 100;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--text-primary) !important;
    transition: all 0.3s ease;
    padding: 0 !important;
}

.navbar-brand img {
    height: 60px;
    width: auto;
}

.navbar-brand:hover {
    color: var(--cyan-bright) !important;
}

.navbar .container {
    max-width: 100% !important;
}

/* Main content container - wider for better use of space */
body > .container {
    max-width: 1400px !important;
}

.navbar-nav .nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.75rem 1rem !important;
    border-radius: 8px;
    margin: 0 8px;
    position: relative;
}

.navbar-nav .nav-link:hover {
    color: var(--cyan-bright) !important;
    background-color: rgba(0, 212, 255, 0.1);
    transform: translateY(-1px);
}

.navbar-nav .nav-link.active {
    color: var(--cyan-bright) !important;
    background-color: rgba(0, 212, 255, 0.15);
}

/* ===== JOCKEY SILK IMAGE STYLES ===== */
.jockey-silk {
    width: 48px;
    height: 48px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    object-fit: contain;
    background-color: var(--bg-secondary);
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.jockey-silk:hover {
    transform: scale(1.1);
    border-color: var(--cyan-bright);
    z-index: 10;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 212, 255, 0.3);
}

/* Fallback styling when image fails to load */
.jockey-silk[style*="display: none"] + .jockey-silk-placeholder::before {
    content: "🏇";
    display: inline-block;
    width: 48px;
    height: 48px;
    line-height: 48px;
    text-align: center;
    background-color: var(--bg-secondary);
    border-radius: 4px;
    font-size: 20px;
}

/* ===== POSITION STYLING ===== */
.position-1 {
    background-color: rgba(255, 215, 0, 0.1) !important;
    border-left: 4px solid #ffd700;
}

.position-2 {
    background-color: rgba(192, 192, 192, 0.1) !important;
    border-left: 4px solid #c0c0c0;
}

.position-3 {
    background-color: rgba(205, 127, 50, 0.1) !important;
    border-left: 4px solid #cd7f32;
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 768px) {
    .jockey-silk {
        width: 32px;
        height: 32px;
    }

    .jockey-silk[style*="display: none"] + .jockey-silk-placeholder::before {
        width: 32px;
        height: 32px;
        line-height: 32px;
        font-size: 16px;
    }

    .table-responsive td {
        font-size: 0.8rem;
    }

    .d-flex.align-items-center {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
}

/* Enhanced hover effect */
.table-hover tbody tr:hover .jockey-silk {
    border-color: var(--cyan-bright);
    box-shadow: 0 2px 4px rgba(0, 212, 255, 0.3);
}



/* Navigation button styling for logout */
.navbar-nav .btn-link {
    color: rgba(255,255,255,0.9) !important;
    text-decoration: none;
    padding: 0.75rem 1rem !important;
    border-radius: 5px;
    margin: 0 2px;
    transition: all 0.3s ease;
}

    .navbar-nav .btn-link:hover {
        color: white !important;
        background-color: rgba(255,255,255,0.1);
        transform: translateY(-1px);
    }

/* Navbar toggler custom styling */
.navbar-toggler {
    border: 2px solid rgba(255,255,255,0.3);
    padding: 0.4rem 0.6rem;
}

    .navbar-toggler:focus {
        box-shadow: 0 0 0 0.2rem rgba(255,255,255,0.25);
    }

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Cache indicator for nav items */
.nav-link.cached::after {
    content: '';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 6px;
    height: 6px;
    background: #27ae60;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(39, 174, 96, 0.3);
    animation: cache-pulse 2s infinite;
}

@keyframes cache-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(39, 174, 96, 0.7);
    }

    70% {
        box-shadow: 0 0 0 4px rgba(39, 174, 96, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(39, 174, 96, 0);
    }
}

/* Cache status badge styles */
.cache-status-badge {
    transition: all 0.3s ease;
    font-weight: 500;
}

    .cache-status-badge.bg-success {
        background: linear-gradient(135deg, #27ae60, #58d68d) !important;
        animation: cache-glow 3s ease-in-out;
    }

@keyframes cache-glow {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* ===== CARDS ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 4px 15px var(--shadow-color);
    transition: all 0.3s ease;
    overflow: hidden;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--shadow-color);
    border-color: var(--cyan-bright);
}

.card-header {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%) !important;
    color: var(--text-primary);
    border: none;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Unified card header styling - all cards use same dark gradient */
.card-header.bg-success,
.card-header.bg-warning,
.card-header.bg-info,
.card-header.bg-primary {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%) !important;
    border-bottom: 2px solid var(--cyan-bright) !important;
    color: var(--text-primary) !important;
}

/* Ensure text in card headers is visible */
.card-header.bg-success .text-white,
.card-header.bg-warning .text-white,
.card-header.bg-warning .text-dark,
.card-header.bg-info .text-white,
.card-header.bg-primary .text-white,
.card-header h5,
.card-header h2 {
    color: var(--text-primary) !important;
}

.card-header h5 {
    font-size: 1rem;
    margin: 0;
}

.card-header h6 {
    font-size: 0.85rem;
    margin: 0;
    color: var(--text-secondary);
}

.card-body {
    background: var(--bg-card);
    color: var(--text-primary);
}

/* ===== BUTTONS - Those Beautiful Colors You Love! ===== */
.btn {
    border-radius: 8px;
    font-weight: 600;
    padding: 0.65rem 1.4rem;
    transition: all 0.25s ease;
    border: none;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    font-size: 0.875rem;
    line-height: 1.5;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px var(--shadow-color);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px var(--shadow-color);
}

/* Cyan/Light Blue Button - Like "View Today's Tips" */
.btn-primary {
    background: linear-gradient(135deg, var(--cyan-bright) 0%, var(--cyan-hover) 100%);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.4);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--cyan-hover) 0%, var(--cyan-bright) 100%);
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.6);
}

/* Lime Green Button - Like "Buy Course" buttons */
.btn-success {
    background: linear-gradient(135deg, var(--lime-green) 0%, var(--lime-hover) 100%);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(125, 217, 86, 0.4);
}

.btn-success:hover {
    background: linear-gradient(135deg, var(--lime-hover) 0%, var(--lime-green) 100%);
    box-shadow: 0 8px 25px rgba(125, 217, 86, 0.6);
}

/* Yellow/Gold Button - Like "Members Only" badge */
.btn-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #f59e0b 100%);
    color: #0a1628;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.4);
}

.btn-warning:hover {
    background: linear-gradient(135deg, #f59e0b 0%, var(--warning-color) 100%);
    box-shadow: 0 8px 25px rgba(251, 191, 36, 0.6);
    color: #0a1628;
}

/* Purple/Magenta Button - Like "SELL" button gradient */
.btn-info {
    background: linear-gradient(135deg, var(--purple-bright) 0%, var(--purple-hover) 100%);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(217, 70, 239, 0.4);
}

.btn-info:hover {
    background: linear-gradient(135deg, var(--purple-hover) 0%, var(--purple-bright) 100%);
    box-shadow: 0 8px 25px rgba(217, 70, 239, 0.6);
}

/* Danger Button */
.btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, var(--danger-color) 100%);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.6);
}

/* Secondary/Outline Button */
.btn-secondary {
    background: transparent;
    border: 2px solid var(--cyan-bright);
    color: var(--cyan-bright);
}

.btn-secondary:hover {
    background: var(--cyan-bright);
    color: #ffffff;
}

/* Outline buttons - override Bootstrap defaults to use cyan theme */
.btn-outline-secondary,
.btn-outline-warning,
.btn-outline-info {
    background: transparent !important;
    border: 2px solid var(--cyan-bright) !important;
    color: var(--cyan-bright) !important;
    font-weight: 600 !important;
}

.btn-outline-secondary:hover,
.btn-outline-warning:hover,
.btn-outline-info:hover {
    background: var(--cyan-bright) !important;
    color: #ffffff !important;
    border-color: var(--cyan-bright) !important;
}

/* Keep outline-success green for upgrade buttons */
.btn-outline-success {
    background: transparent !important;
    border: 2px solid var(--lime-green) !important;
    color: var(--lime-green) !important;
    font-weight: 600 !important;
}

.btn-outline-success:hover {
    background: var(--lime-green) !important;
    color: #ffffff !important;
    border-color: var(--lime-green) !important;
}

/* Link buttons - style like text links */
.btn-link {
    color: var(--cyan-bright) !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
}

.btn-link:hover {
    color: var(--cyan-hover) !important;
    text-decoration: underline !important;
}

/* ===== TABLES ===== */
.table {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 12px var(--shadow-color);
    background: var(--bg-card) !important;
    color: var(--text-primary);
    border: 1px solid var(--border-color) !important;
    margin-bottom: 1.5rem;
}

.table thead th {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%) !important;
    color: var(--text-primary) !important;
    border: none !important;
    border-bottom: 2px solid var(--cyan-bright) !important;
    font-weight: 600;
    padding: 0.875rem 0.75rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.table tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-card) !important;
}

.table tbody tr:hover {
    background-color: rgba(0, 212, 255, 0.05) !important;
    transform: scale(1.005);
}

.table tbody td {
    padding: 0.75rem;
    vertical-align: middle;
    border-color: var(--border-color);
    font-size: 0.875rem;
    color: var(--text-primary);
    background: transparent !important;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 212, 255, 0.02) !important;
}

/* Force table responsive wrapper to also be dark */
.table-responsive {
    background: var(--bg-card) !important;
}

/* ===== ALERTS ===== */
.alert {
    border: none;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 10px var(--shadow-color);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert i {
    flex-shrink: 0;
}

.alert-success {
    background: linear-gradient(135deg, rgba(125, 217, 86, 0.15), rgba(110, 231, 183, 0.15));
    border-left: 4px solid var(--lime-green);
}

.alert-warning {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(245, 158, 11, 0.15));
    border-left: 4px solid var(--yellow-accent);
}

.alert-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(220, 38, 38, 0.15));
    border-left: 4px solid var(--danger-color);
}

.alert-info {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.15), rgba(0, 191, 255, 0.15));
    border-left: 4px solid var(--cyan-bright);
}

/* ===== STATS CARDS ===== */
.stats-card {
    text-align: center;
    padding: 1.25rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

    .stats-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    }

.stats-number {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stats-label {
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

/* ===== PAGE TITLES ===== */
.page-title {
    color: var(--text-primary);
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-align: center;
    position: relative;
    font-size: 1.25rem;
}

.page-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, var(--cyan-bright), var(--purple-bright));
    border-radius: 2px;
}

.page-title i {
    font-size: 1rem;
    color: var(--cyan-bright);
}

/* ===== TEXT COLOR FIXES ===== */
.text-muted {
    color: var(--text-secondary) !important;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
}

p {
    color: var(--text-primary);
}

/* ===== WINNER BADGES & POSITIONS ===== */
.winner-badge {
    background: linear-gradient(135deg, #f1c40f, #f39c12);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-weight: 600;
    font-size: 0.875rem;
}

.position-1 {
    background-color: rgba(241, 196, 15, 0.1) !important;
}

.position-2 {
    background-color: rgba(149, 165, 166, 0.1) !important;
}

.position-3 {
    background-color: rgba(205, 133, 63, 0.1) !important;
}

/* Position 1 (1st place) badges - vibrant lime green matching GFB image */
.badge.bg-warning.text-dark.fw-bold {
    background: #80DA57 !important;
    color: #000 !important;
    font-weight: 700 !important;
    box-shadow: 0 2px 8px rgba(128, 218, 87, 0.5) !important;
}

/* "Won" badge in Beaten By column - same vibrant lime green matching GFB image */
.badge.bg-success {
    background: #80DA57 !important;
    color: #000 !important;
    font-weight: 700 !important;
    box-shadow: 0 2px 8px rgba(128, 218, 87, 0.5) !important;
}

/* Ensure "Won" text is visible in black on green background */
.badge.bg-success:contains("Won") {
    color: #000 !important;
}

/* ===== LOADING & ANIMATIONS ===== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== FOOTER ===== */
.footer {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    color: var(--text-primary);
    padding: 2rem 0;
    margin-top: 3rem;
    border-top: 1px solid var(--border-color);
    position: relative;
    z-index: 10;
}

.footer-links a {
    transition: all 0.3s ease;
    font-weight: 500;
    color: var(--text-secondary) !important;
}

.footer-links a:hover {
    color: var(--cyan-bright) !important;
    transform: translateY(-1px);
}

.text-white-50 {
    color: var(--text-secondary) !important;
}

/* ===== INDEX PAGE SPECIFIC STYLES ===== */
.hero-section {
    background: transparent;
    min-height: 200px; /* Reduced from 400px */
    display: flex;
    align-items: center;
    border-bottom: 2px solid var(--border-color);
    position: relative;
    z-index: 1;
}

.bg-gradient-primary {
    background: transparent !important;
}

.feature-icon {
    margin-bottom: 1rem;
}

.stat-number h2 {
    font-weight: bold;
    font-size: 2.5rem;
}

/* Hover effect for navigation cards */
.hover-card {
    transition: all 0.3s ease;
}

    .hover-card:hover {
        transform: translateY(-8px);
        box-shadow: 0 12px 25px rgba(0,0,0,0.15) !important;
    }

        .hover-card:hover .btn {
            transform: scale(1.05);
        }

    .hover-card .btn {
        transition: all 0.2s ease;
    }

/* Icon sizing for feature cards */
.feature-icon .fa-3x {
    font-size: 3rem !important;
}

/* Ensure consistent card heights */
.card.h-100 {
    height: 100% !important;
}

/* Advertising Section Styles */
.bg-gradient-ad {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.ad-placeholder {
    background: rgba(255, 255, 255, 0.1);
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 2rem 1rem;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* ===== RESPONSIVE OVERRIDES ===== */
/* Specific header size overrides */
h1.page-title {
    font-size: 1.25rem !important;
}

.card-header h5 {
    font-size: 1rem !important;
}

.card-header h6 {
    font-size: 0.85rem !important;
}

/* Make stats cards smaller on race detail pages */
.stats-card .stats-number {
    font-size: 1.5rem !important;
}

.stats-card .stats-label {
    font-size: 0.65rem !important;
}

/* ===== ENHANCED MOBILE RESPONSIVENESS ===== */
/* Tablet and small desktop improvements */
@media (max-width: 992px) {
    .main-container {
        padding: 1.5rem;
        margin: 1.5rem auto;
    }

    .card-body {
        padding: 1.25rem;
    }

    /* Better button sizing on tablets */
    .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.85rem;
    }

    /* Race time cards adjust */
    .race-time-card {
        padding: 7px 14px !important;
        font-size: 0.8rem !important;
    }
}

/* Mobile phone landscape and portrait */
@media (max-width: 768px) {
    .main-container {
        padding: 1rem;
        margin: 1rem;
        min-height: calc(100vh - 180px);
    }

    /* Better table readability */
    .table {
        font-size: 0.8rem;
    }

    .table thead th {
        padding: 0.6rem 0.4rem;
        font-size: 0.75rem;
    }

    .table tbody td {
        padding: 0.6rem 0.4rem;
    }

    /* Optimize heading sizes */
    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.35rem;
    }

    h3, h4 {
        font-size: 1.2rem;
    }

    /* Better card spacing */
    .card {
        margin-bottom: 1rem;
    }

    /* Navbar brand adjustment */
    .navbar-brand {
        font-size: 1.2rem;
    }

    /* Race time cards */
    .race-time-card {
        padding: 6px 12px !important;
        font-size: 0.75rem !important;
        margin: 0 4px 4px 0 !important;
    }

    /* Stats cards */
    .stats-card {
        padding: 1rem;
    }

    .stats-number {
        font-size: 1.4rem !important;
    }

    .stats-label {
        font-size: 0.7rem !important;
    }

    /* Better horizontal scrolling */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }
}

/* Small mobile devices */
@media (max-width: 576px) {
    body {
        font-size: 0.875rem;
    }

    .main-container {
        padding: 0.75rem;
        margin: 0.5rem;
        border-radius: 12px;
    }

    .card {
        border-radius: 12px;
        margin-bottom: 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    .card-header {
        padding: 0.75rem;
        font-size: 0.85rem;
    }

    /* Compact buttons */
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }

    /* Better hero section */
    .hero-section {
        min-height: 140px;
        padding: 1rem 0 !important;
    }

    /* Single column prediction cards */
    .prediction-card.race-time-card {
        width: 100% !important;
        min-width: unset;
    }

    /* Footer compact */
    .footer {
        padding: 1rem 0;
        font-size: 0.8rem;
    }

    .footer .container-fluid {
        padding: 0 1rem;
    }

    /* Modal adjustments */
    .modal-dialog {
        margin: 0.5rem;
    }

    .modal-content {
        border-radius: 12px;
    }

    /* Badge sizing */
    .badge {
        padding: 0.35rem 0.6rem !important;
        font-size: 0.7rem !important;
    }

    /* Smaller theme toggle */
    .theme-toggle {
        width: 50px;
        height: 50px;
        bottom: 15px;
        right: 15px;
        font-size: 1.1rem;
    }

    /* Optimize table font size */
    .table {
        font-size: 0.75rem;
    }

    .table thead th,
    .table tbody td {
        padding: 0.4rem 0.25rem;
        font-size: 0.7rem;
    }

    /* Course name column wrapping */
    .course-name {
        font-size: 0.85rem !important;
        width: auto;
    }

    /* Compact race time cards */
    .race-time-card {
        padding: 5px 10px !important;
        font-size: 0.7rem !important;
    }
}

/* Force dropdown to work properly on desktop only */
@media (min-width: 992px) {
    .navbar-nav .dropdown:hover .dropdown-menu {
        display: block;
    }
}

.navbar-nav .dropdown .dropdown-menu {
    margin-top: 0;
}

/* Ensure dropdown toggle works on click as well as hover */
.navbar-nav .dropdown-toggle {
    cursor: pointer !important;
}

    .navbar-nav .dropdown-toggle:focus {
        outline: none;
        box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
    }

/* Make sure dropdown menu appears above other content */
.navbar-nav .dropdown-menu {
    z-index: 1050 !important;
    border: 1px solid rgba(0,0,0,.15);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Fix active state without breaking dropdown */
.navbar-nav .dropdown-toggle.active {
    background-color: rgba(255,255,255,0.1) !important;
    border-radius: 0.375rem;
}

/* Ensure proper spacing */
.dropdown-item {
    padding: 0.5rem 1rem;
}

.dropdown-header {
    padding: 0.5rem 1rem;
    margin-bottom: 0;
    font-size: 0.875rem;
    color: #6c757d;
}

/* Mobile dropdown fixes */
@media (max-width: 991.98px) {
    .navbar-nav .dropdown-menu {
        position: static !important;
        transform: none !important;
        border: none;
        box-shadow: none;
        background-color: var(--bg-secondary);
        padding-left: 1rem;
    }

    /* Remove hover effect on mobile - rely on Bootstrap's click/tap behavior */
    .navbar-nav .dropdown:hover .dropdown-menu {
        display: none;
    }

    /* But allow the dropdown to show when Bootstrap adds the 'show' class */
    .navbar-nav .dropdown-menu.show {
        display: block !important;
    }
}

/* ===== THEME TOGGLE BUTTON ===== */
.theme-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cyan-bright) 0%, var(--purple-bright) 100%);
    border: 3px solid var(--border-color);
    box-shadow: 0 6px 20px var(--shadow-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1000;
    color: #ffffff;
    font-size: 1.5rem;
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 8px 30px rgba(0, 212, 255, 0.6);
}

.theme-toggle:active {
    transform: scale(0.95);
}

/* Theme toggle icon animation */
.theme-toggle i {
    transition: transform 0.3s ease;
}

.theme-toggle:hover i {
    transform: rotate(180deg);
}

/* Adjust for mobile */
@media (max-width: 768px) {
    .theme-toggle {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
        font-size: 1.2rem;
    }
}

/* ===== MODAL THEMING ===== */
.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
}

.modal-footer {
    border-top: 1px solid var(--border-color);
}

.modal-body {
    color: var(--text-primary);
}

/* ===== FORM CONTROLS ===== */
.form-control,
.form-select {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    transition: all 0.3s ease;
    border-radius: 8px;
    padding: 0.65rem 1rem;
}

.form-control:focus,
.form-select:focus {
    background: var(--bg-card);
    border-color: var(--cyan-bright);
    color: var(--text-primary);
    box-shadow: 0 0 0 0.15rem rgba(0, 212, 255, 0.2);
    outline: none;
}

.form-label {
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* Add focus styles for accessibility */
a:focus,
button:focus,
.btn:focus {
    outline: 2px solid var(--cyan-bright);
    outline-offset: 2px;
}

a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
.btn:focus:not(:focus-visible) {
    outline: none;
}

/* ===== UNIVERSAL BADGE STYLING - ALL BADGES SITE-WIDE ===== */
/* Every single badge gets the cyan glow treatment like the race time badge */
/* EXCEPT position-3-badge which gets gray styling */
.badge:not(.position-3-badge),
span.badge:not(.position-3-badge),
div.badge:not(.position-3-badge),
.badge.bg-primary:not(.position-3-badge),
.badge.bg-secondary:not(.position-3-badge),
.badge.bg-success:not(.position-3-badge),
.badge.bg-danger:not(.position-3-badge),
.badge.bg-warning:not(.position-3-badge),
.badge.bg-info:not(.position-3-badge),
.badge.bg-light:not(.position-3-badge),
.badge.bg-dark:not(.position-3-badge),
.badge.bg-white:not(.position-3-badge),
.badge.bg-light.text-dark:not(.position-3-badge),
span.badge.bg-light.text-dark:not(.position-3-badge),
.card-header .badge:not(.position-3-badge),
.card-header .badge.bg-light:not(.position-3-badge),
.card-header .badge.bg-light.text-dark:not(.position-3-badge),
.card-body .badge:not(.position-3-badge),
tbody .badge:not(.position-3-badge),
tbody .badge.bg-light:not(.position-3-badge),
thead .badge:not(.position-3-badge) {
    background: linear-gradient(135deg, var(--cyan-bright) 0%, var(--cyan-hover) 100%) !important;
    color: #000 !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.4) !important;
    padding: 0.5rem 0.75rem !important;
    border-radius: 8px !important;
    letter-spacing: 0.3px !important;
    border: none !important;
}

/* Ensure all content inside ANY badge is black - EXCEPT position-3-badge */
.badge:not(.position-3-badge) *,
.badge:not(.position-3-badge) strong,
.badge:not(.position-3-badge) small {
    color: #000 !important;
}

/* ===== WINNER/SUCCESS BADGE OVERRIDES ===== */
/* Override universal badge styling for specific winner badges */
/* These must come AFTER the universal badge styling to take precedence */

/* Position 1 (1st place) badges - vibrant lime green matching GFB image */
tbody .badge.bg-warning.text-dark.fw-bold,
.badge.bg-warning.text-dark.fw-bold {
    background: #80DA57 !important;
    color: #000 !important;
    font-weight: 700 !important;
    box-shadow: 0 2px 8px rgba(128, 218, 87, 0.5) !important;
}

/* "Won" badge in Beaten By column - same vibrant lime green matching GFB image */
tbody .badge.bg-success,
.table .badge.bg-success {
    background: #80DA57 !important;
    color: #000 !important;
    font-weight: 700 !important;
    box-shadow: 0 2px 8px rgba(128, 218, 87, 0.5) !important;
}

/* Position 2 (2nd place) badges - purple gradient matching admin dashboard Import Range button with glow */
tbody .badge.bg-secondary.text-white,
.table .badge.bg-secondary.text-white {
    background: linear-gradient(135deg, var(--purple-bright) 0%, var(--purple-hover) 100%) !important;
    color: #000 !important;
    font-weight: 700 !important;
    box-shadow: 0 2px 8px rgba(217, 70, 239, 0.5) !important;
}

/* Purple badges for payout tags (Win, Place, Exacta, etc.), Non-Runners, and race time square on RaceResultDetail and RaceCardDetail */
.card-header .badge.bg-info.text-dark,
.card-header .bg-info.text-dark,
.card-header .badge.bg-danger,
.card-header div .badge.bg-danger,
.bg-info.text-dark[style*="width: 80px"] {
    background: linear-gradient(135deg, var(--purple-bright) 0%, var(--purple-hover) 100%) !important;
    color: #000 !important;
    font-weight: 700 !important;
    box-shadow: 0 2px 8px rgba(217, 70, 239, 0.5) !important;
}

/* Position 3 (3rd place) badges - ORANGE color like buy buttons */
/* MUST have higher specificity than universal badge styling */
tbody tr td span.badge.bg-light.text-dark.position-3-badge,
tbody tr td .badge.bg-light.text-dark.position-3-badge,
tbody .badge.bg-light.position-3-badge,
span.badge.bg-light.position-3-badge,
.badge.bg-light.position-3-badge,
tbody tr td span.position-3-badge,
tbody tr td .position-3-badge,
span.badge.position-3-badge,
.badge.position-3-badge {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%) !important;
    color: #0a1628 !important;
    font-weight: 700 !important;
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.5) !important;
    padding: 0.5rem 0.75rem !important;
    border-radius: 8px !important;
}

/* ===== DROPDOWN MENU ===== */
.dropdown-menu {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 25px var(--shadow-color);
}

.dropdown-item {
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background-color: rgba(0, 212, 255, 0.1);
    color: var(--cyan-bright);
}

.dropdown-header {
    color: var(--text-secondary);
}

.dropdown-divider {
    border-color: var(--border-color);
}

/* ===== RACE CARDS & RACE RESULTS STYLING (GFB Style) ===== */
/* Matching the beautiful design from the reference image */

/* Container styling */
.at-a-glance-container {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px !important;
    overflow: hidden;
}

/* Tab styling - TODAY/TOMORROW buttons */
.tab-container {
    display: flex;
    border-bottom: 2px solid var(--cyan-bright) !important;
    overflow-x: auto;
    background: var(--bg-secondary) !important;
}

.date-tab {
    padding: 12px 24px !important;
    cursor: pointer;
    border: none !important;
    background: transparent !important;
    color: var(--text-secondary) !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease !important;
    border-radius: 0 !important;
}

.date-tab.active {
    background: var(--cyan-bright) !important;
    color: #ffffff !important;
}

.date-tab:hover {
    background: rgba(0, 212, 255, 0.1) !important;
    color: var(--cyan-bright) !important;
}

.date-tab.active:hover {
    background: var(--cyan-hover) !important;
    color: #ffffff !important;
}

/* Course row styling */
.course-row {
    border-bottom: 1px solid var(--border-color) !important;
    padding: 15px 20px !important;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
}

.course-row:hover {
    background-color: rgba(0, 212, 255, 0.05) !important;
}

.course-name {
    font-weight: 700 !important;
    font-size: 18px !important;
    color: var(--text-primary) !important;
    width: 220px;
    display: inline-block;
    vertical-align: top;
}

.flag-icon {
    width: 28px !important;
    height: auto !important;
    margin-right: 8px !important;
    vertical-align: middle;
    border-radius: 3px;
}

/* Region code badge */
.region-code {
    display: inline-block;
    margin-left: 8px;
    padding: 4px 10px !important;
    background: rgba(108, 117, 125, 0.3) !important;
    border-radius: 4px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    color: var(--text-secondary) !important;
}

/* Race time buttons - Those beautiful blue buttons! */
.race-time-card {
    display: inline-block;
    padding: 8px 16px !important;
    margin: 0 6px 6px 0 !important;
    border-radius: 6px !important;
    font-weight: 700 !important;
    font-size: 13px !important;
    cursor: pointer;
    text-decoration: none !important;
    transition: all 0.2s ease;
    color: white !important;
    border: none;
}

/* Available races - Bright blue like the reference */
.race-time-card.available {
    background: linear-gradient(135deg, var(--cyan-bright) 0%, var(--cyan-hover) 100%) !important;
    box-shadow: 0 2px 8px rgba(0, 212, 255, 0.3);
}

.race-time-card.available:hover {
    background: linear-gradient(135deg, var(--cyan-hover) 0%, var(--cyan-bright) 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.5) !important;
}

/* Past races - Grey */
.race-time-card.past {
    background: #6c757d !important;
    cursor: pointer;
}

.race-time-card.past:hover {
    background: #5c636a !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.4) !important;
}

/* Purchased races - Add checkmark */
.race-time-card.purchased::after {
    content: "✓";
    margin-left: 4px;
}

/* Abandoned races */
.race-time-card.abandoned {
    background: var(--danger-color) !important;
    cursor: default;
    opacity: 0.85;
}

.race-time-card.abandoned:hover {
    background: #dc2626 !important;
    transform: none;
    box-shadow: none;
}

.abandoned-badge {
    font-size: 8px;
    font-weight: 700;
    display: block;
    margin-top: 1px;
    letter-spacing: 0.3px;
}

/* Purchase course button - Green like the reference! */
.purchase-course-btn {
    display: inline-block;
    padding: 8px 18px !important;
    margin: 0 4px 4px 0;
    border-radius: 6px !important;
    font-weight: 700 !important;
    font-size: 13px !important;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    color: white !important;
    background: linear-gradient(135deg, var(--lime-green) 0%, var(--lime-hover) 100%) !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(125, 217, 86, 0.3);
}

.purchase-course-btn:hover {
    background: linear-gradient(135deg, var(--lime-hover) 0%, var(--lime-green) 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(125, 217, 86, 0.5) !important;
}

.purchase-course-btn.disabled,
.purchase-course-btn:disabled {
    background: #6c757d !important;
    cursor: not-allowed !important;
    opacity: 0.5;
    box-shadow: none;
}

.purchase-course-btn.disabled:hover,
.purchase-course-btn:disabled:hover {
    background: #6c757d !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Purchase day container */
.purchase-day-container {
    padding: 20px;
    text-align: center;
    border-top: 2px solid var(--border-color) !important;
    background: var(--bg-secondary) !important;
}

.purchase-day-btn {
    padding: 12px 36px !important;
    font-weight: 700 !important;
    font-size: 15px !important;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    color: white !important;
    background: linear-gradient(135deg, var(--lime-green) 0%, var(--lime-hover) 100%) !important;
    border: none !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(125, 217, 86, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.purchase-day-btn:hover {
    background: linear-gradient(135deg, var(--lime-hover) 0%, var(--lime-green) 100%) !important;
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(125, 217, 86, 0.5) !important;
}

.purchase-day-btn.disabled,
.purchase-day-btn:disabled {
    background: #6c757d !important;
    cursor: not-allowed !important;
    opacity: 0.5;
    box-shadow: none;
}

.purchase-day-btn.disabled:hover,
.purchase-day-btn:disabled:hover {
    background: #6c757d !important;
    transform: none !important;
    box-shadow: none !important;
}

/* No races message */
.no-races-message {
    padding: 60px 40px !important;
    text-align: center;
    color: var(--text-secondary) !important;
    background: var(--bg-card);
}

.no-races-message i {
    color: var(--text-secondary) !important;
}

.no-races-message p {
    color: var(--text-secondary) !important;
}

/* ===== DROPDOWN & MEMBERS MENU FIXES ===== */
/* Fix visibility for disabled/locked members dropdown items */
.dropdown-item.disabled {
    color: var(--text-secondary) !important;
    opacity: 0.6;
    cursor: not-allowed !important;
    pointer-events: auto !important;
    background-color: transparent !important;
}

.dropdown-item.disabled:hover {
    background-color: rgba(108, 117, 125, 0.1) !important;
    color: var(--text-secondary) !important;
}

/* Members locked state - improve visibility */
.members-locked {
    opacity: 0.8 !important;
    cursor: help !important;
}

.members-locked:hover {
    opacity: 1 !important;
}

/* Ensure all nav link text is visible */
.navbar-nav .nav-link,
.navbar-nav .dropdown-toggle,
.navbar-nav .btn-link {
    color: var(--text-secondary) !important;
}

.navbar-nav .nav-link:hover,
.navbar-nav .dropdown-toggle:hover {
    color: var(--cyan-bright) !important;
}

/* Button close styling for alerts in dark mode */
.btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.7;
}

[data-theme="light"] .btn-close {
    filter: none;
}

.btn-close:hover {
    opacity: 1;
}

/* ===== MY PREDICTIONS PAGE STYLING ===== */
/* Beautiful themed prediction cards */

/* Prediction card base styling */
.prediction-card.race-time-card {
    display: inline-block !important;
    padding: 12px 14px !important;
    margin: 0 6px 6px 0 !important;
    border-radius: 8px !important;
    cursor: pointer;
    text-decoration: none !important;
    transition: all 0.3s ease;
    background: var(--bg-card) !important;
    border: 2px solid var(--border-color) !important;
    vertical-align: top;
    width: calc(20% - 5px);
    min-width: 160px;
    box-shadow: 0 2px 8px var(--shadow-color);
}

.prediction-card.race-time-card:hover {
    border-color: var(--cyan-bright) !important;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px var(--shadow-color) !important;
    text-decoration: none !important;
}

/* Claude/POCheck prediction cards - Blue theme */
.prediction-card.race-time-card.claude-card,
.prediction-card.race-time-card.pocheck-card {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.15) 0%, rgba(0, 191, 255, 0.1) 100%) !important;
    border: 2px solid rgba(0, 212, 255, 0.4) !important;
}

.prediction-card.race-time-card.claude-card:hover,
.prediction-card.race-time-card.pocheck-card:hover {
    border-color: var(--cyan-bright) !important;
    box-shadow: 0 6px 16px rgba(0, 212, 255, 0.4) !important;
}

/* Amalgamated prediction cards - Purple/Gold theme */
.prediction-card.race-time-card.amalgamated-card {
    background: linear-gradient(135deg, rgba(217, 70, 239, 0.15) 0%, rgba(251, 191, 36, 0.1) 100%) !important;
    border: 2px solid rgba(217, 70, 239, 0.4) !important;
}

.prediction-card.race-time-card.amalgamated-card:hover {
    border-color: var(--purple-bright) !important;
    box-shadow: 0 6px 16px rgba(217, 70, 239, 0.4) !important;
}

/* Race time label inside cards */
.race-time-label {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: var(--cyan-bright) !important;
    margin-bottom: 8px !important;
    padding-bottom: 6px !important;
    border-bottom: 1px solid var(--border-color) !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.race-time-label.past {
    color: var(--text-secondary) !important;
}

/* Pick rows - horse names and positions */
.pick-row {
    font-size: 12px !important;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary) !important;
}

/* Win probability */
.win-prob {
    font-size: 10px !important;
    color: var(--lime-green) !important;
    font-weight: 700 !important;
    margin-left: 4px;
}

/* Pick badges - 1st, 2nd, 3rd - Matching race result position badges */
.pick-badge {
    display: inline-block;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    font-size: 9px !important;
    font-weight: 700 !important;
    margin-right: 6px;
    min-width: 28px;
    text-align: center;
    flex-shrink: 0;
}

.pick-badge.first {
    background: #80DA57 !important;
    color: #000 !important;
    box-shadow: 0 2px 8px rgba(128, 218, 87, 0.5) !important;
    text-shadow: none;
}

.pick-badge.second {
    background: linear-gradient(135deg, var(--purple-bright) 0%, var(--purple-hover) 100%) !important;
    color: #000 !important;
    box-shadow: 0 2px 8px rgba(217, 70, 239, 0.5) !important;
    text-shadow: none;
}

.pick-badge.third {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%) !important;
    color: #0a1628 !important;
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.5) !important;
    text-shadow: none;
}

/* Status badges - Complete, Upcoming, Abandoned */
.status-badge {
    display: inline-block !important;
    padding: 3px 8px !important;
    border-radius: 4px !important;
    font-size: 9px !important;
    font-weight: 700 !important;
    margin-left: auto;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-badge.result-complete {
    background: var(--lime-green) !important;
    color: #000 !important;
}

.status-badge.result-upcoming {
    background: var(--cyan-bright) !important;
    color: #000 !important;
}

.status-badge.result-abandoned {
    background: var(--danger-color) !important;
    color: white !important;
}

/* Winner glow effect - Green border for winning predictions */
.winner-glow {
    border: 2px solid var(--lime-green) !important;
    box-shadow: 0 0 20px rgba(125, 217, 86, 0.6) !important;
    animation: winnerPulse 2s ease-in-out infinite;
}

.winner-glow:hover {
    box-shadow: 0 6px 25px rgba(125, 217, 86, 0.8) !important;
}

@keyframes winnerPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(125, 217, 86, 0.6);
    }
    50% {
        box-shadow: 0 0 30px rgba(125, 217, 86, 0.9);
    }
}

/* Medal animations and styling */
.medal {
    font-size: 14px !important;
    margin-left: 4px;
    display: inline-block;
    animation: medalPulse 0.6s ease;
}

@keyframes medalPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

/* Hide win probability when result is in */
.has-result .win-prob {
    display: none;
}

/* Link styling within prediction cards */
.prediction-card.race-time-card a,
.no-races-message a {
    color: var(--cyan-bright) !important;
    text-decoration: none;
}

.prediction-card.race-time-card a:hover,
.no-races-message a:hover {
    color: var(--cyan-hover) !important;
    text-decoration: underline;
}

/* Responsive adjustments for prediction cards */
@media (max-width: 992px) {
    .prediction-card.race-time-card {
        width: calc(33.333% - 5px);
    }
}

@media (max-width: 768px) {
    .prediction-card.race-time-card {
        width: calc(50% - 5px);
        min-width: 140px;
    }
}

@media (max-width: 576px) {
    .prediction-card.race-time-card {
        width: 100%;
    }
}

/* ===== RACE CARD DETAIL PAGE STYLING ===== */
/* Beautiful race information header and runner tables */

/* Card header with race info - Dark theme - applies to RaceCardDetail, RaceResultDetail, and all detail pages */
.card-header.bg-primary,
.card-header.bg-success {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%) !important;
    border-bottom: 2px solid var(--cyan-bright) !important;
}

/* Race time square in header - Cyan theme */
.bg-warning.text-dark {
    background: linear-gradient(135deg, var(--cyan-bright) 0%, var(--cyan-hover) 100%) !important;
    color: #000 !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.4);
}

/* Standardize ALL badges in race header to cyan theme */
.card-header .badge {
    background: linear-gradient(135deg, var(--cyan-bright) 0%, var(--cyan-hover) 100%) !important;
    color: #000 !important;
    font-weight: 600 !important;
    border: none !important;
}

/* Override ALL specific badge color classes in card headers */
.card-header .badge.bg-warning,
.card-header .badge.bg-light,
.card-header .badge.bg-success,
.card-header .badge.bg-danger,
.card-header .badge.bg-secondary,
.card-header .badge.bg-info,
.card-header .badge.bg-dark,
.card-header .badge.bg-primary {
    background: linear-gradient(135deg, var(--cyan-bright) 0%, var(--cyan-hover) 100%) !important;
    color: #000 !important;
}

/* Race card body - Must be themed */
.card-body {
    background: var(--bg-card) !important;
}

/* Nested cards within card body */
.card-body .card {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
}

.card-body .card-body {
    background: var(--bg-card) !important;
}

/* Table headers in race detail pages - solid color like card header */
.card-body .table thead th {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border-bottom: 2px solid var(--cyan-bright) !important;
}

/* Previous runs - these are anchor links not badges */
/* Force black text for previous run links - override cyan link color */
tbody td a.text-decoration-none[style*="background-color"] {
    color: #000 !important;
}

/* Previous runs badges */
.previous-runs-badge {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color);
}

/* Horse number badge in table */
tbody .badge.bg-primary {
    background: linear-gradient(135deg, var(--cyan-bright) 0%, var(--cyan-hover) 100%) !important;
    color: #000 !important;
    font-weight: 700 !important;
}

/* ALL tbody badges now use universal cyan styling - no overrides needed */

/* Success badge for odds */
.text-success, .fw-semibold.text-success {
    color: var(--lime-green) !important;
}

/* Note icon styling */
.note-icon {
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-primary) !important;
}

.note-icon:hover {
    transform: scale(1.2);
    color: var(--yellow-accent) !important;
}

.note-icon.bi-sticky-fill {
    color: var(--yellow-accent) !important;
}

/* Links in tables */
.fw-bold.text-decoration-none,
.fw-semibold.text-decoration-none,
a.text-decoration-none {
    color: var(--cyan-bright) !important;
    transition: all 0.2s ease;
}

.fw-bold.text-decoration-none:hover,
.fw-semibold.text-decoration-none:hover,
a.text-decoration-none:hover {
    color: var(--cyan-hover) !important;
    text-decoration: underline !important;
}

/* Sort icons in table headers */
th[data-sort] {
    cursor: pointer !important;
    user-select: none;
    transition: all 0.2s ease;
}

th[data-sort]:hover {
    background-color: rgba(0, 212, 255, 0.1) !important;
}

th[data-sort] i {
    color: var(--cyan-bright);
    font-size: 0.8rem;
}

/* Modal styling for horse notes */
.modal-content {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
}

.modal-header {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border-bottom: 1px solid var(--border-color) !important;
}

.modal-title {
    color: var(--text-primary) !important;
}

.modal-body {
    background: var(--bg-card);
    color: var(--text-primary);
}

.modal-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color) !important;
}

/* PAYMENT MODAL FIX - Force light theme for payment/subscription modals */
#mandateConsentModal .modal-content,
#mandateConsentModal .modal-body,
.payment-page .card,
.payment-page .card-body {
    background: #ffffff !important;
    color: #212529 !important;
}

#mandateConsentModal .modal-body p,
#mandateConsentModal .modal-body strong,
#mandateConsentModal .modal-body small,
#mandateConsentModal .modal-body label,
#mandateConsentModal .modal-body .form-check-label,
#mandateConsentModal .modal-body .text-muted,
.payment-page .card-body p,
.payment-page .card-body h5,
.payment-page .card-body h4,
.payment-page .card-body strong {
    color: #212529 !important;
}

#mandateConsentModal .modal-header {
    background: linear-gradient(135deg, #4e73df 0%, #224abe 100%) !important;
    border-bottom: none !important;
}

#mandateConsentModal .modal-title,
#mandateConsentModal .modal-title i {
    color: #ffffff !important;
}

#mandateConsentModal .alert-info {
    background: #d1ecf1 !important;
    border-color: #bee5eb !important;
    color: #0c5460 !important;
}

#mandateConsentModal .alert-info strong,
#mandateConsentModal .alert-info i {
    color: #0c5460 !important;
}

#mandateConsentModal .form-check {
    background: #f8f9fc !important;
    border: 2px solid #4e73df !important;
    border-radius: 10px !important;
}

#mandateConsentModal .form-check-input {
    width: 1.5rem !important;
    height: 1.5rem !important;
    margin-top: 0.1rem !important;
    border: 2px solid #4e73df !important;
    cursor: pointer !important;
}

#mandateConsentModal .form-check-input:checked {
    background-color: #1cc88a !important;
    border-color: #1cc88a !important;
}

#mandateConsentModal .form-check-label {
    cursor: pointer !important;
    margin-left: 0.5rem !important;
}

/* Blurred text for non-subscribers */
[style*="blur"] {
    filter: blur(4px) !important;
    user-select: none;
}

/* Text muted in tables */
.text-muted, span.text-muted {
    color: var(--text-secondary) !important;
}

/* Small text */
.small, small {
    color: var(--text-secondary);
}

/* Override small text in table cells - force white */
.table tbody td span,
.table tbody td {
    color: var(--text-primary) !important;
}

/* ===== DETAIL PAGES STYLING (Horse, Owner, Jockey, Trainer) ===== */
/* Override inline styles and Bootstrap defaults */

/* Detail page headers - match table header gradient */
.card-header.bg-success,
.card-header.bg-warning {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%) !important;
    border-bottom: 2px solid var(--cyan-bright) !important;
    color: var(--text-primary) !important;
}

.card-header.bg-success .text-white,
.card-header.bg-success h2,
.card-header.bg-success h5,
.card-header.bg-warning .text-white,
.card-header.bg-warning .text-dark,
.card-header.bg-warning h2,
.card-header.bg-warning h5 {
    color: var(--text-primary) !important;
}

/* White badge inside headers - make them cyan themed with glow like race time badges */
.card-header .badge.bg-white {
    background: linear-gradient(135deg, var(--cyan-bright) 0%, var(--cyan-hover) 100%) !important;
    color: #000 !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.4) !important;
}

/* Override text color classes in bg-white badges to ensure readability */
.card-header .badge.bg-white.text-primary,
.card-header .badge.bg-white.text-success,
.card-header .badge.bg-white.text-info,
.card-header .badge.bg-white.text-warning,
.card-header .badge.bg-white.text-danger {
    color: #000 !important;
}

/* Ensure all content inside bg-white badges is black */
.card-header .badge.bg-white *,
.card-header .badge.bg-white strong,
.card-header .badge.bg-white small {
    color: #000 !important;
}

/* Jockey/Trainer/Horse Details header badges - green for wins, purple for places */
.card-header.bg-warning .badge.bg-success {
    background: #80DA57 !important;
    color: #000 !important;
    font-weight: 700 !important;
    box-shadow: 0 2px 8px rgba(128, 218, 87, 0.5) !important;
}

.card-header.bg-warning .badge.bg-secondary {
    background: linear-gradient(135deg, var(--purple-bright) 0%, var(--purple-hover) 100%) !important;
    color: #000 !important;
    font-weight: 700 !important;
    box-shadow: 0 2px 8px rgba(217, 70, 239, 0.5) !important;
}

/* Text colors in headers */
.card-header .text-white {
    color: var(--text-primary) !important;
}

.card-header .text-white a {
    color: var(--cyan-bright) !important;
}

.card-header .text-white a:hover {
    color: var(--cyan-hover) !important;
}

/* Light badge in headers */
.card-header .badge.bg-light {
    background: rgba(0, 212, 255, 0.2) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--cyan-bright);
}

/* Icon square in detail headers */
.card-header .bg-light {
    background: linear-gradient(135deg, var(--cyan-bright) 0%, var(--cyan-hover) 100%) !important;
    color: #000 !important;
}

/* Card borders */
.card.border-success {
    border-color: var(--cyan-bright) !important;
}

/* Table dark header - override Bootstrap */
.table thead.table-dark th {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border-bottom: 2px solid var(--cyan-bright) !important;
    border-color: var(--border-color) !important;
}

/* Fix all table borders and cells */
.table td,
.table th {
    border-color: var(--border-color) !important;
}

.table-hover tbody tr {
    border-color: var(--border-color) !important;
}

/* Row highlights for positions */
.bg-warning.bg-opacity-25,
.bg-warning.bg-opacity-10 {
    background-color: rgba(255, 215, 0, 0.1) !important;
}

.bg-secondary.bg-opacity-10 {
    background-color: rgba(192, 192, 192, 0.1) !important;
}

/* Links in tables */
table a.text-decoration-none {
    color: var(--cyan-bright) !important;
}

table a.text-decoration-none:hover {
    color: var(--cyan-hover) !important;
    text-decoration: underline !important;
}

/* Font monospace */
.font-monospace {
    font-family: 'Courier New', monospace;
    color: var(--text-primary);
}

/* Override page title inline color */
h4.page-title {
    color: var(--text-primary) !important;
}

/* Override inline border styles on table-responsive wrappers */
.table-responsive[style*="border"] {
    border: 1px solid var(--border-color) !important;
}

/* Table light header - override Bootstrap */
.table thead.table-light th {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

/* Sticky header in tables */
.sticky-top {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg-secondary) !important;
}

/* Override sortable hover */
.sortable:hover {
    background-color: rgba(0, 212, 255, 0.1) !important;
}

/* Headers in detail pages */
h6 {
    color: var(--text-primary) !important;
}

/* ===== ADDITIONAL DETAIL PAGE STYLES (moved from inline) ===== */
/* These were previously inline in individual pages - now centralized */

/* Owner silks styling */
.owner-silks {
    object-fit: contain;
    border: 2px solid rgba(0, 212, 255, 0.3);
}

/* Sortable table headers */
.sortable {
    cursor: pointer;
    user-select: none;
}

/* Table responsive max heights */
.table-responsive {
    max-height: 600px;
    overflow-y: auto;
}

/* ===== CUSTOM SCROLLBAR STYLING ===== */
/* Beautiful themed scrollbars for dark mode */

/* Webkit browsers (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--cyan-bright) 0%, var(--cyan-hover) 100%);
    border-radius: 10px;
    border: 2px solid var(--bg-secondary);
    box-shadow: 0 2px 6px rgba(0, 212, 255, 0.3);
    transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--cyan-hover) 0%, var(--purple-bright) 100%);
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.6);
}

::-webkit-scrollbar-thumb:active {
    background: linear-gradient(135deg, var(--purple-bright) 0%, var(--cyan-bright) 100%);
}

/* Firefox scrollbar styling */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--cyan-bright) var(--bg-secondary);
}

/* Light theme scrollbar adjustments */
[data-theme="light"] ::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--cyan-bright) 0%, var(--cyan-hover) 100%);
    border: 2px solid var(--bg-secondary);
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--cyan-hover) 0%, var(--purple-bright) 100%);
}

/* ===== LIST GROUP STYLING ===== */
/* Override Bootstrap list-group default white backgrounds */
.list-group {
    background: transparent !important;
}

.list-group-item {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
    transition: all 0.2s ease;
}

.list-group-item:hover {
    background: rgba(0, 212, 255, 0.05) !important;
}

.list-group-flush .list-group-item {
    border-left: none !important;
    border-right: none !important;
    border-top: 1px solid var(--border-color) !important;
    border-bottom: 1px solid var(--border-color) !important;
}

.list-group-flush .list-group-item:first-child {
    border-top: none !important;
}

.list-group-flush .list-group-item:last-child {
    border-bottom: none !important;
}

/* ===== FEATURE BADGES (Dashboard) ===== */
/* Override inline styles for premium features display */
.feature-badge {
    background: var(--bg-secondary) !important;
    padding: 12px 16px !important;
    border-radius: 8px !important;
    border-left: 4px solid var(--cyan-bright) !important;
    display: flex !important;
    align-items: center !important;
    transition: all 0.3s ease !important;
}

.feature-badge:hover {
    transform: translateX(5px) !important;
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3) !important;
    background: rgba(0, 212, 255, 0.1) !important;
}

.feature-badge i {
    font-size: 1.2rem !important;
    min-width: 24px !important;
}

.feature-badge span {
    font-size: 0.9rem !important;
    line-height: 1.4 !important;
    color: var(--text-primary) !important;
}

.feature-badge strong {
    color: var(--cyan-bright) !important;
}
/* ===== RACE TIME BREADCRUMB NAVIGATION ===== */
.race-time-breadcrumb .badge {
    cursor: pointer;
    transition: all 0.2s ease;
}

.race-time-breadcrumb a.badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3) !important;
    border-color: var(--cyan-bright) !important;
    background: rgba(0, 212, 255, 0.1) !important;
    color: #fff !important;
}

/* Race time badge hover - for RaceCardDetail and RaceResultDetail pages */
a.race-time-badge:hover {
    color: #fff !important;
}

.race-time-breadcrumb .badge.current-race {
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(0, 212, 255, 0.4);
    }
    50% {
        box-shadow: 0 4px 18px rgba(0, 212, 255, 0.7);
    }
}

/* ===== COIN PACKAGES STYLING ===== */
.coin-package-card {
    position: relative;
    transition: all 0.3s ease;
}

.coin-package-card:hover {
    transform: translateY(-5px);
}

.popular-package {
    border-color: #ffc107 !important;
    box-shadow: 0 0 20px rgba(255, 193, 7, 0.3);
}

.popular-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(45deg, #ffc107, #ff8c00);
    color: white !important;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(255, 193, 7, 0.4);
    z-index: 10;
}

/* ===== SEARCH BOX STYLING ===== */
#globalSearch::placeholder {
    color: #9ca3af !important;
    opacity: 1 !important;
}

#searchResults {
    background: white !important;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1) !important;
    max-width: 800px !important;
}

#searchResults .list-group-item {
    background-color: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    cursor: pointer !important;
    color: white !important;
}

#searchResults .list-group-item:hover {
    background-color: var(--bg-card) !important;
}

#searchResults .list-group-item strong,
#searchResults .list-group-item i,
#searchResults .list-group-item div {
    color: white !important;
}

/* ===== INDIVIDUAL RACE PURCHASE STYLING ===== */
.race-checkbox {
    margin-right: 6px;
    cursor: pointer;
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

.purchase-selected-container {
    display: none;
    margin-left: 10px;
}

.purchase-selected-btn {
    padding: 10px 30px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    text-decoration: none;
    color: #000;
    background: linear-gradient(135deg, #80DA57 0%, #6ee845 100%);
    border: none;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(128, 218, 87, 0.3);
    transition: all 0.2s ease;
    animation: pulse 2s infinite;
}

.purchase-selected-btn:hover {
    background: linear-gradient(135deg, #6ee845 0%, #5dd634 100%);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(128, 218, 87, 0.7);
}

.purchase-selected-btn.disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
    animation: none;
}

.purchase-selected-btn.disabled:hover {
    background: #6c757d;
    transform: none;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.5);
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 4px 15px rgba(128, 218, 87, 0.5); }
    50% { box-shadow: 0 4px 25px rgba(128, 218, 87, 0.8); }
}

/* ===== PREMIUM TIPS TAB STYLING ===== */
.tips-date-tab {
    padding: 12px 24px !important;
    cursor: pointer;
    border: none !important;
    background: transparent !important;
    color: var(--text-secondary) !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease !important;
    border-radius: 0 !important;
}

.tips-date-tab.active {
    background: var(--purple-bright) !important;
    color: #ffffff !important;
}

.tips-date-tab:hover {
    background: rgba(217, 70, 239, 0.1) !important;
    color: var(--purple-bright) !important;
}

.tips-date-tab.active:hover {
    background: var(--purple-hover) !important;
    color: #ffffff !important;
}

.tips-tab-container {
    display: flex;
    border-bottom: 3px solid var(--purple-bright);
    overflow-x: auto;
    background: transparent;
}

.tips-date-content {
    display: none;
}

.tips-date-content.active {
    display: block;
}
