/**
 * Captain's Tips - Global Stylesheet
 * Common styles shared across all pages
 */

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

/* ===== NAVIGATION BAR ===== */
.navbar {
    background: white;
    border-radius: 12px;
    padding: 15px 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.navbar-brand {
    font-size: 1.3em;
    font-weight: 700;
    color: #1e3a8a;
    text-decoration: none;
}

.navbar-toggle {
    display: none;
}

.navbar-menu {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.navbar-link {
    color: #4b5563;
    text-decoration: none;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s;
}

.navbar-link:hover {
    background: #f3f4f6;
    color: #1e3a8a;
}

.navbar-link.active {
    background: #1e3a8a;
    color: white;
}

.navbar-auth {
    display: flex;
    gap: 12px;
    align-items: center;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: #f3f4f6;
    border-radius: 8px;
    color: #374151;
    font-weight: 600;
}

.navbar-user-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.9em;
}

/* ===== BUTTONS ===== */
.btn {
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-block;
    cursor: pointer;
    border: none;
    font-size: 1em;
}

.btn-primary {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(30, 58, 138, 0.3);
}

.btn-secondary {
    background: white;
    color: #1e3a8a;
    border: 2px solid #1e3a8a;
}

.btn-secondary:hover {
    background: #1e3a8a;
    color: white;
}

.btn-logout {
    background: #ef4444;
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: #dc2626;
}

/* ===== CARDS ===== */
.stat-card,
.chart-card,
.predictions-card,
.filter-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.stat-card {
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.chart-card h2,
.predictions-card h2,
.filter-section h3 {
    color: #1e3a8a;
    margin-bottom: 20px;
    font-size: 1.3em;
}

/* ===== GRID LAYOUTS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.predictions-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(600px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* ===== STAT VALUES ===== */
.stat-label {
    font-size: 0.9em;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 2.5em;
    font-weight: bold;
    color: #1e3a8a;
}

.stat-value.success {
    color: #10b981;
}

.stat-value.warning {
    color: #f59e0b;
}

.stat-value.info {
    color: #3b82f6;
}

/* ===== BADGES ===== */
.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    display: inline-block;
}

.badge.correct {
    background: #d1fae5;
    color: #065f46;
}

.badge.incorrect {
    background: #fee2e2;
    color: #991b1b;
}

.badge.not-predicted {
    background: #e5e7eb;
    color: #4b5563;
}

.badge.pending {
    background: #fef3c7;
    color: #92400e;
}

.badge.high-conf {
    background: #d1fae5;
    color: #065f46;
}

.badge.med-conf {
    background: #fef3c7;
    color: #92400e;
}

.badge.low-conf {
    background: #fee2e2;
    color: #991b1b;
}

/* ===== PREDICTION ITEMS ===== */
.prediction-item {
    border-left: 4px solid #e5e7eb;
    padding: 15px;
    margin-bottom: 15px;
    background: #f9fafb;
    border-radius: 5px;
    transition: all 0.3s;
}

.prediction-item:hover {
    background: #f3f4f6;
    border-left-color: #1e3a8a;
}

.prediction-item.correct {
    border-left-color: #10b981;
}

.prediction-item.incorrect {
    border-left-color: #ef4444;
}

.prediction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.event-name {
    font-weight: bold;
    color: #1f2937;
    font-size: 1.05em;
}

.prediction-details {
    font-size: 0.9em;
    color: #6b7280;
    margin-top: 8px;
}

.prediction-details div {
    margin-bottom: 4px;
}

.sport-tag {
    display: inline-block;
    padding: 2px 8px;
    background: #e5e7eb;
    border-radius: 4px;
    font-size: 0.75em;
    text-transform: uppercase;
    margin-right: 8px;
}

/* ===== FILTERS ===== */
.filter-options {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 12px 20px;
    min-height: 44px;
    min-width: 44px;
    border-radius: 8px;
    background: #f3f4f6;
    transition: all 0.2s;
    user-select: none;
}

.filter-checkbox:hover {
    background: #e5e7eb;
}

.filter-checkbox.active {
    background: #1e3a8a;
    color: white;
    box-shadow: 0 2px 8px rgba(30, 58, 138, 0.3);
}

.filter-checkbox input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.filter-checkbox label {
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95em;
}

.filter-stats {
    color: #6b7280;
    font-size: 0.9em;
    margin-top: 12px;
}

/* ===== TABULAR NUMBERS ===== */
/* Ensures numbers align perfectly in columns */
.stat-value,
.stat-card .stat-value,
.odds,
.odds-table .odds,
.price-amount,
.score,
.confidence-score,
.betting-amount,
.profit-loss,
[data-type="number"],
table td:last-child {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

/* ===== UTILITY CLASSES ===== */
.loading {
    text-align: center;
    padding: 50px;
    color: white;
    font-size: 1.2em;
}

.error {
    background: #fee2e2;
    border: 2px solid #ef4444;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    color: #991b1b;
}

.last-updated {
    text-align: center;
    color: white;
    opacity: 0.8;
    margin-top: 20px;
    font-size: 0.9em;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    body {
        padding: 10px;
        font-size: 16px; /* Ensure minimum readable text size */
    }

    h1 {
        font-size: 1.8em;
    }

    .navbar {
        padding: 15px 20px;
        flex-direction: column;
        align-items: stretch;
    }

    .navbar-container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    .navbar-toggle {
        display: block;
        background: none;
        border: none;
        cursor: pointer;
        padding: 8px;
    }

    .navbar-toggle span {
        display: block;
        width: 25px;
        height: 3px;
        background: #1e3a8a;
        margin: 5px 0;
        transition: all 0.3s;
        border-radius: 3px;
    }

    .navbar-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }

    .navbar-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .navbar-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }

    .navbar-menu {
        display: none;
        flex-direction: column;
        gap: 0;
        width: 100%;
        margin-top: 15px;
        padding-top: 15px;
        border-top: 1px solid #e5e7eb;
    }

    .navbar-menu.active {
        display: flex;
    }

    .navbar-link {
        width: 100%;
        padding: 12px 16px;
        text-align: left;
    }

    .navbar-auth {
        display: none;
        flex-direction: column;
        gap: 10px;
        width: 100%;
        margin-top: 10px;
    }

    .navbar-auth.active {
        display: flex;
    }

    .btn {
        width: 100%;
        text-align: center;
        padding: 12px 20px;
    }

    .navbar-user {
        width: 100%;
        justify-content: flex-start;
    }

    .chart-grid,
    .predictions-section {
        grid-template-columns: 1fr;
    }

    .filter-options {
        flex-direction: column;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}
