/* Base styles */
:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #1f2937;
    --gray: #6b7280;
    --light: #f3f4f6;
    --white: #ffffff;
    --border: #e5e7eb;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.1);
    --radius: 8px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--light);
    color: var(--dark);
    line-height: 1.5;
}

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

/* Navbar */
.navbar {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-links a {
    color: var(--gray);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
}

.nav-links a.logout-link {
    color: var(--danger);
}

.nav-links a.logout-link:hover {
    color: #dc2626;
}

/* Main content */
main {
    padding: 30px 0;
    min-height: calc(100vh - 140px);
}

/* Pages */
.page {
    display: none;
}

.page.active {
    display: block;
}

h1 {
    font-size: 2rem;
    margin-bottom: 24px;
    color: var(--dark);
}

h2 {
    font-size: 1.25rem;
    margin-bottom: 16px;
    color: var(--dark);
}

h3 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: var(--dark);
}

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    text-align: center;
}

.stat-card.positive .stat-value {
    color: var(--success);
}

.stat-card.negative .stat-value {
    color: var(--danger);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.stat-label {
    color: var(--gray);
    font-size: 0.875rem;
}

/* Two columns layout */
.two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .two-columns {
        grid-template-columns: 1fr;
    }
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray);
    margin-bottom: 6px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--light);
    color: var(--dark);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1.125rem;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.875rem;
}

/* Predict form */
.predict-form {
    max-width: 1000px;
}

.teams-section {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.team-card {
    background: var(--light);
    border-radius: var(--radius);
    padding: 20px;
}

.vs-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray);
}

.h2h-section,
.odds-section {
    background: var(--light);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
}

/* Result card */
.result-card {
    margin-top: 30px;
}

.result-card.hidden {
    display: none;
}

.result-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.result-item {
    background: var(--light);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
}

.result-item.highlight {
    background: var(--primary);
    color: var(--white);
}

.result-item.value-positive {
    background: var(--success);
    color: var(--white);
}

.result-item.value-negative {
    background: var(--danger);
    color: var(--white);
}

.result-value {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.result-label {
    font-size: 0.875rem;
    opacity: 0.8;
}

.confidence-stars {
    color: #fbbf24;
    font-size: 1.25rem;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    font-weight: 600;
    color: var(--gray);
    font-size: 0.875rem;
    background: var(--light);
}

.data-table tbody tr:hover {
    background: var(--light);
}

.data-table .loading {
    text-align: center;
    color: var(--gray);
    padding: 40px;
}

/* Filters */
.filters {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filters select,
.filters input {
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    background: var(--white);
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-scheduled {
    background: var(--light);
    color: var(--gray);
}

.status-live {
    background: var(--danger);
    color: var(--white);
}

.status-finished {
    background: var(--success);
    color: var(--white);
}

.result-win {
    color: var(--success);
    font-weight: 600;
}

.result-loss {
    color: var(--danger);
    font-weight: 600;
}

.result-pending {
    color: var(--gray);
}

/* Charts */
.chart-container {
    position: relative;
    height: 300px;
}

/* Matches list */
.matches-list {
    max-height: 400px;
    overflow-y: auto;
}

.match-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid var(--border);
}

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

.match-teams {
    flex: 1;
}

.match-home,
.match-away {
    font-weight: 500;
}

.match-vs {
    color: var(--gray);
    font-size: 0.875rem;
    margin: 0 8px;
}

.match-info {
    text-align: right;
}

.match-time {
    font-size: 0.875rem;
    color: var(--gray);
}

.match-score {
    font-weight: 700;
    font-size: 1.125rem;
}

/* Value bets */
.value-bets-list {
    max-height: 400px;
    overflow-y: auto;
}

.value-bet-item {
    padding: 12px;
    border-bottom: 1px solid var(--border);
}

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

.value-bet-match {
    font-weight: 600;
    margin-bottom: 4px;
}

.value-bet-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: var(--gray);
}

.value-percent {
    color: var(--success);
    font-weight: 600;
}

/* Footer */
.footer {
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: 20px 0;
    text-align: center;
    color: var(--gray);
    font-size: 0.875rem;
}

/* Loading state */
.loading {
    color: var(--gray);
    text-align: center;
    padding: 20px;
}

/* Odds cells */
.odds-cell {
    display: inline-block;
    padding: 4px 8px;
    margin: 0 2px;
    background: var(--light);
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
    min-width: 45px;
    text-align: center;
}

/* Leagues stats */
.leagues-stats {
    padding: 10px 0;
}

.league-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

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

.league-stat-item .count {
    font-weight: 600;
    color: var(--primary);
}

/* Match item enhanced */
.match-item {
    display: grid;
    grid-template-columns: 80px 100px 1fr 120px;
    gap: 10px;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.2s;
}

.match-item:hover {
    background: var(--light);
}

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

.match-date {
    font-size: 0.875rem;
    color: var(--gray);
}

.match-league {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 500;
}

.match-teams {
    font-weight: 500;
}

.match-teams .vs {
    color: var(--gray);
    font-weight: 400;
    margin: 0 6px;
}

.match-odds {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
}

.match-odds .odds {
    padding: 4px 8px;
    background: var(--light);
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
    min-width: 40px;
    text-align: center;
}

.match-odds .odds.home {
    background: #dbeafe;
    color: #1d4ed8;
}

.match-odds .odds.away {
    background: #fce7f3;
    color: #be185d;
}

.match-odds .odds.draw {
    background: #f3f4f6;
    color: var(--gray);
}

/* Modal styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray);
}

/* Responsive */
@media (max-width: 768px) {
    .teams-section {
        grid-template-columns: 1fr;
    }

    .vs-divider {
        padding: 10px 0;
    }

    .nav-links {
        gap: 15px;
        font-size: 0.875rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    .match-item {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .match-odds {
        justify-content: flex-start;
    }
}
