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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #295d94 0%, #1D6EC3 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    background: #123357;
    padding: 5px;
    margin-bottom: 5px;
    text-align: center;
}

.header .logo {
    display: block;
    margin: 0 auto 4px auto;
    max-width: 280px;
    height: auto;
    filter: drop-shadow(0 2px 8px rgba(44,62,80,0.10));
}

.header .subtitle {
    color: #ffffff;
    font-size: 1.2em;
    margin-bottom: 8px;
}

.glass-effect {
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border-radius: 15px;
}

.section {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    margin-bottom: 30px;
}

.v75-banner, .v86-banner {
    color: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
}

.v75-banner h3, .v86-banner h3 {
    font-size: 1.5em;
    margin-bottom: 10px;
}

.v75-banner {
    background: linear-gradient(45deg, #1f4e9a, #143A77);
}

.v86-banner {
    background: linear-gradient(45deg, #802c7e, #5C1A5A);
}

/* Race Navigation */
.race-navigation {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    gap: 10px;
}

.race-nav-button {
    background: #3498db;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1em;
    transition: all 0.15s ease;
    min-width: 50px;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
}

.race-nav-button:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.race-nav-button:active {
    transform: translateY(0px);
    transition: all 0.1s ease;
}

.race-nav-button.v75 {
    background: #1f4e9a;
}

.race-nav-button.v75:hover {
    background: #143A77;
}

.race-nav-button.v75:active {
    background: #0f2c5a;
}

.race-nav-button.v86 {
    background: #802c7e;
}

.race-nav-button.v86:hover {
    background: #5C1A5A;
}

.race-nav-button.v86:active {
    background: #3d0e3c;
}

.race-nav-button.active {
    background: #e74c3c !important;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
    transform: translateY(-1px);
    border: 2px solid #c0392b;
}

.race-nav-button.active:active {
    transform: translateY(0px);
}

/* Single Race Display */
.race-display {
    display: none;
}

.race-display.active {
    display: block;
}

.race-header {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.race-title {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.race-number {
    background: #3498db;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2em;
    margin-right: 15px;
}

.race-number.v75 {
    background: #1f4e9a;
}

.race-number.v86 {
    background: #802c7e;
}

.race-name {
    font-size: 1.1em;
    font-weight: 600;
    color: #2c3e50;
}

.race-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.detail-item {
    text-align: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

.detail-value {
    font-weight: bold;
    color: #2c3e50;
    font-size: 1.1em;
}

.detail-label {
    font-size: 0.9em;
    color: #7f8c8d;
    margin-top: 5px;
}

/* Horse Cards */
.horses-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

/* Sorting Controls */
.sorting-controls {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid #e9ecef;
}

.sorting-title {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 1.0em;
}

.sorting-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 6px;
}

.sorting-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px;
    border-radius: 5px;
    transition: background-color 0.2s ease;
}

.sorting-checkbox:hover {
    background-color: #e9ecef;
}

.sorting-checkbox input[type="checkbox"] {
    margin: 0;
    transform: scale(1.2);
}

.sorting-checkbox label {
    font-size: 0.9em;
    color: #495057;
    cursor: pointer;
    user-select: none;
}

.sorting-checkbox input[type="checkbox"]:checked + label {
    color: #2c3e50;
    font-weight: 600;
}

.horse-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
}

.horse-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.horse-compact {
    padding: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
}

.horse-number {
    background: #3498db;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.horse-number.v75 {
    background: #1f4e9a;
}

.horse-number.v86 {
    background: #802c7e;
}

/* Result position colors - entire card background */
.horse-compact.gold,
.horse-compact.silver,
.horse-compact.bronze {
    position: relative;
}

.horse-compact.gold {
    background: linear-gradient(135deg, #FFE55C, #FFD700) !important;
    color: #000 !important;
    border: 2px solid #FFD700 !important;
}

.horse-compact.silver {
    background: linear-gradient(135deg, #E8E8E8, #D0D0D0) !important;
    color: #000 !important;
    border: 2px solid #D0D0D0 !important;
}

.horse-compact.bronze {
    background: linear-gradient(135deg, #D4A574, #CD7F32) !important;
    color: #fff !important;
    border: 2px solid #CD7F32 !important;
}

.horse-compact.gold::after,
.horse-compact.silver::after,
.horse-compact.bronze::after {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 1.2em;
}

.horse-compact.gold::after {
    content: "🥇";
}

.horse-compact.silver::after {
    content: "🥈";
}

.horse-compact.bronze::after {
    content: "🥉";
}

.horse-info {
    flex-grow: 1;
    min-width: 0;
}

.horse-name {
    font-weight: bold;
    color: #2c3e50;
    font-size: 1.0em;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.horse-compact-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9em;
    color: #666;
}

.horse-percentage {
    color: #27ae60;
    font-weight: bold;
}

.horse-driver {
    color: #7f8c8d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.expand-icon {
    color: #bdc3c7;
    font-size: 1.2em;
    transition: transform 0.3s ease;
}

.horse-card.expanded .expand-icon {
    transform: rotate(180deg);
}

.horse-details {
    display: none;
    padding: 0 15px 15px;
    border-top: 1px solid #ecf0f1;
    background: #f8f9fa;
}

.horse-card.expanded .horse-details {
    display: block;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.detail-section {
    background: white;
    padding: 16px;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.detail-section h5 {
    color: #2c3e50;
    margin-bottom: 12px;
    font-weight: 600;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 6px;
}

.detail-row, .stats-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin: 8px 0;
    font-size: 0.9em;
    gap: 12px;
}

.detail-row strong, .stats-row strong {
    font-weight: 600;
    flex-shrink: 0;
    min-width: fit-content;
}

.detail-row strong {
    color: #2c3e50;
}

.detail-row span, .stats-row span {
    text-align: right;
    word-wrap: break-word;
    line-height: 1.4;
}

.detail-row span {
    color: #495057;
}

.stats-row strong, .stats-row span {
    color: #2c3e50;
}

.stats-row strong {
    color: #27ae60;
}

.performance-stats {
    background: rgba(39, 174, 96, 0.1);
    padding: 16px;
    border-radius: 10px;
    margin: 20px 0;
    border: 1px solid rgba(39, 174, 96, 0.2);
}

.performance-stats h5 {
    color: #27ae60;
    margin-bottom: 12px;
    font-weight: 600;
    border-bottom: 2px solid rgba(39, 174, 96, 0.3);
    padding-bottom: 6px;
}

.no-data {
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
    padding: 40px;
}

.footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 40px;
    padding: 20px;
}

/* AI Coupon Generator Styles */
.coupon-section {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
}

.ai-coupon-section {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.08), rgba(41, 128, 185, 0.12));
    border: 1px solid rgba(52, 152, 219, 0.2);
    border-radius: 12px;
    margin-top: 15px;
    padding: 20px;
}

.ai-coupon-button {
    background: linear-gradient(45deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.1em;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.ai-coupon-button:hover {
    background: linear-gradient(45deg, #2980b9, #21618c);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.coupon-input {
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1em;
    width: 150px;
    margin: 0 10px;
}

.coupon-result {
    margin-top: 20px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.coupon-race {
    padding: 10px;
    margin: 5px 0;
    background: #f0f0f0;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Winner highlighting for correct answers in past races */
.winner-highlight {
    display: inline-block;
    background: #27ae60;
    color: white;
    border: 2px solid #27ae60;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    line-height: 20px;
    text-align: center;
    font-weight: bold;
    font-size: 0.9em;
    margin: 0 2px;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .race-navigation {
        flex-wrap: wrap;
        margin: 10px 0;
        gap: 6px;
    }
    
    .race-nav-button {
        padding: 8px 14px;
        font-size: 0.9em;
        min-width: 36px;
        border-radius: 6px;
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
        transition: all 0.1s ease;
    }
    
    .v75-banner, .v86-banner {
        padding: 12px;
        margin-bottom: 12px;
        border-radius: 8px;
    }
    
    .v75-banner h3, .v86-banner h3 {
        font-size: 1.2em;
        margin-bottom: 6px;
    }
    
    .v75-banner p, .v86-banner p {
        font-size: 0.9em;
        margin-bottom: 4px;
        line-height: 1.3;
    }
    
    .race-header {
        padding: 12px;
        margin-bottom: 12px;
    }
    
    .race-number {
        width: 28px;
        height: 28px;
        font-size: 1em;
        margin-right: 10px;
    }
    
    .race-name {
        font-size: 1em;
    }
    
    .race-details {
        gap: 8px;
        margin-top: 10px;
    }
    
    .detail-item {
        padding: 6px;
    }
    
    .detail-value {
        font-size: 0.95em;
    }
    
    .detail-label {
        font-size: 0.8em;
    }
    
    .sorting-controls {
        padding: 8px;
        margin: 8px 0;
    }
    
    .sorting-title {
        font-size: 0.9em;
        margin-bottom: 6px;
    }
    
    .sorting-checkboxes {
        gap: 3px;
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }
    
    .sorting-checkbox {
        padding: 2px;
        gap: 4px;
    }
    
    .sorting-checkbox label {
        font-size: 0.8em;
    }
    
    .horses-container {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .horse-card {
        margin-bottom: 8px;
    }
    
    .horse-compact {
        padding: 8px 12px;
        gap: 8px;
        flex-direction: row;
        align-items: center;
    }
    
    .horse-number {
        width: 24px;
        height: 24px;
        font-size: 0.8em;
        flex-shrink: 0;
    }
    
    .horse-info {
        flex-grow: 1;
        min-width: 0;
    }
    
    .horse-name {
        font-size: 0.9em;
        margin-bottom: 2px;
        line-height: 1.2;
    }
    
    .horse-compact-info {
        width: 100%;
        font-size: 0.8em;
        gap: 8px;
    }
    
    .horse-percentage {
        font-size: 0.85em;
    }
    
    .horse-driver {
        max-width: 100px;
        font-size: 0.8em;
    }
    
    .expand-icon {
        font-size: 1em;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        margin: 15px 0;
    }
    
    .detail-section {
        padding: 12px;
    }
    
    .detail-row, .stats-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .detail-row span, .stats-row span {
        text-align: left;
    }
    
    #horse-modal-content {
        width: 98vw !important;
        max-height: 95vh !important;
    }
} 