/* ==============================
   ARBITRAGE PAGE STYLES
   ============================== */

:root {
    --primary-color: #0a0e27;
    --secondary-color: #dc143c;
    --success-color: #ff4444;
    --warning-color: #ff6b35;
    --danger-color: #c41e3a;
    --light-bg: #1a1f3a;
    --white: #ffffff;
    --text-dark: #ffffff;
    --text-light: #b0b0b0;
    --border-color: #dc143c;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #0a0e27;
    color: var(--text-dark);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* ==============================
   NAVBAR
   ============================== */

.navbar {
    background-color: var(--primary-color);
    color: white;
    padding: 0.25rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.4rem 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: white;
    border-radius: 0 0 8px 8px;
    max-height: 90px;
    overflow: visible;
}

.navbar-logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    font-size: 1.8rem;
}

.navbar-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--secondary-color);
}

.login-btn {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.login-btn:hover {
    background-color: #2980b9;
}

.nav-auth {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.user-menu {
    position: relative;
}

.user-menu-trigger {
    background-color: #2c2f4a;
}

.user-menu-trigger:hover {
    background-color: #3a3f5c;
}

.user-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: #1a1f3a;
    border: 1px solid #dc143c;
    border-radius: 4px;
    min-width: 140px;
    z-index: 9999;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}

.user-dropdown.open {
    display: block;
}

.user-dropdown-item {
    display: block;
    padding: 0.6rem 1rem;
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
}

.user-dropdown-item:hover {
    background: #dc143c;
}

/* ==============================
   HEADER
   ============================== */

.header {
    text-align: center;
    margin-bottom: 2rem;
}

.header h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.1rem;
    color: #e0e0e0;
    font-weight: 600;
}

/* ==============================
   STATS SECTION
   ============================== */

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
    border-left: 4px solid var(--secondary-color);
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    font-weight: 600;
}

.stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--secondary-color);
}

/* ==============================
   FILTERS SECTION
   ============================== */

.filters-container {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.filters-left {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
}

.filter-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.filter-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-locked {
    opacity: 0.35;
    pointer-events: none;
    user-select: none;
}

.filter-section .filter-group {
    flex: 1;
    min-width: 130px;
}

.filter-header {
    font-size: 1rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.alert-save-btn {
    width: 100%;
    padding: 0.6rem;
    border: none;
    border-radius: 4px;
    font-weight: 700;
    cursor: pointer;
}

.alert-save-btn--diamond {
    background: #a78bfa;
    color: #000;
}

.alert-save-btn--locked {
    background: #555;
    color: #999;
    cursor: not-allowed;
}

.filters-right {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
    border-left: 2px solid var(--border-color);
    padding-left: 2rem;
    min-width: 350px;
}

.multiselect-dropdown {
    position: relative;
    width: 100%;
}

.multiselect-toggle {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: #333333;
    color: white;
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.multiselect-toggle::after {
    content: '▼';
    font-size: 0.7rem;
}

.multiselect-toggle:hover {
    background-color: #444444;
    border-color: var(--secondary-color);
}

.multiselect-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    margin-top: 0.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
}

.multiselect-list.hidden {
    display: none;
}

.multiselect-search {
    padding: 0.75rem 1rem;
    border: none;
    border-bottom: 1px solid #e0e0e0;
    width: 100%;
    font-size: 0.9rem;
    box-sizing: border-box;
    position: sticky;
    top: 0;
    background: white;
}

.multiselect-search:focus {
    outline: none;
    background-color: #f9f9f9;
}

.multiselect-items {
    padding: 0.5rem 0;
}

.multiselect-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    user-select: none;
}

.multiselect-item:hover {
    background-color: #f5f5f5;
}

.multiselect-item input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.multiselect-item label {
    cursor: pointer;
    flex: 1;
    margin: 0;
    color: var(--secondary-color);
    font-weight: 500;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 150px;
}

.filter-group label {
    font-weight: 600;
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.filter-group select,
.filter-group input {
    padding: 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 4px rgba(52, 152, 219, 0.3);
}

.apply-btn {
    padding: 0.6rem 1.5rem;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.apply-btn:hover {
    background-color: #2980b9;
}

/* ==============================
   LOADING STATE
   ============================== */

.loading-container {
    text-align: center;
    padding: 3rem;
}

.spinner {
    border: 4px solid var(--light-bg);
    border-top: 4px solid var(--secondary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==============================
   OPPORTUNITIES TABLE
   ============================== */

.opportunities-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.opportunity-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.opportunity-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 1.1rem;
    font-weight: bold;
}

.card-time {
    font-size: 0.8rem;
    opacity: 0.9;
}

.card-body {
    padding: 1.5rem;
}

.game-info {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--light-bg);
}

.game-teams {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.game-market {
    font-size: 0.85rem;
    color: var(--text-light);
}

.odds-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.odds-box {
    background: var(--light-bg);
    padding: 0.8rem;
    border-radius: 4px;
}

.odds-header {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.sportsbook-name {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.sportsbook-link {
    display: inline-block;
    margin-top: 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-color, #dc143c);
    text-decoration: none;
    border: 1px solid var(--accent-color, #dc143c);
    border-radius: 3px;
    padding: 0.2rem 0.5rem;
    transition: background 0.15s, color 0.15s;
}

.sportsbook-link:hover {
    background: var(--accent-color, #dc143c);
    color: #fff;
}

.sportsbook-signup-link {
    display: inline-block;
    margin-top: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #888;
    text-decoration: none;
    border: 1px solid #444;
    border-radius: 3px;
    padding: 0.2rem 0.5rem;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.sportsbook-signup-link:hover {
    background: #333;
    color: #ddd;
    border-color: #666;
}

.odds-value {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--secondary-color);
}

.spread-value {
    font-size: 0.8rem;
    color: var(--text-light);
}

.metrics-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--light-bg);
    border-radius: 4px;
}

.metric {
    text-align: center;
}

.metric-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    margin-bottom: 0.3rem;
}

.metric-value {
    font-size: 1.1rem;
    font-weight: bold;
}

.metric-value.good {
    color: var(--success-color);
}

.metric-value.warning {
    color: var(--warning-color);
}

.metric-value.bad {
    color: var(--danger-color);
}

.profit-highlight {
    background: var(--success-color);
    color: white;
    padding: 1rem;
    border-radius: 4px;
    text-align: center;
    margin-bottom: 1rem;
}

.profit-label {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    text-transform: uppercase;
}

.profit-value {
    font-size: 1.8rem;
    font-weight: bold;
}

.calc-btn-small {
    width: 100%;
    padding: 0.8rem;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.calc-btn-small:hover {
    background-color: #2980b9;
}

/* ==============================
   NO DATA STATE
   ============================== */

.no-data {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: 8px;
    color: var(--text-light);
}

/* ==============================
   MODAL
   ============================== */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: var(--white);
    padding: 2rem;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.close-modal {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--text-light);
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: var(--text-dark);
}

/* ==============================
   CALCULATOR PANEL
   ============================== */

.calculator-panel {
    width: 100%;
}

.calculator-panel h2 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.calc-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.calc-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.calc-input-group label {
    font-weight: 600;
    color: red;
}

.calc-input-group input {
    padding: 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    color: red;
}

.calc-vig-display {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem;
    background: var(--light-bg);
    border-radius: 4px;
    margin-top: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.card-meta {
    padding: 0.5rem 0;
    font-size: 0.85rem;
    color: var(--text-light);
}

.calc-mode-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tab-btn {
    padding: 0.6rem;
    background: var(--light-bg);
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

.calc-btn {
    width: 100%;
    padding: 0.8rem;
    background-color: var(--success-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: background-color 0.3s ease;
    margin-top: 0.5rem;
}

.calc-btn:hover {
    background-color: #229954;
}

.calc-results {
    background: var(--light-bg);
    padding: 1rem;
    border-radius: 4px;
    margin-top: 1rem;
}

.calc-results h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.result-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid white;
}

.result-row.highlight {
    font-weight: bold;
    color: var(--secondary-color);
}

.result-row:last-child {
    border-bottom: none;
}

/* ==============================
   RESPONSIVE
   ============================== */

@media (max-width: 768px) {
    .navbar-container {
        flex-direction: column;
        gap: 1rem;
    }

    .navbar-menu {
        gap: 1rem;
    }

    .header h1 {
        font-size: 1.8rem;
    }

    .stats-container {
        grid-template-columns: 1fr 1fr;
    }

    .filters-container {
        flex-direction: column;
        gap: 1rem;
    }

    .filters-left {
        width: 100%;
    }

    .filter-row {
        flex-direction: column;
    }

    .filter-section .filter-group {
        width: 100%;
        min-width: unset;
    }

    .filters-right {
        width: 100%;
        border-left: none;
        border-top: 2px solid var(--border-color);
        padding-left: 0;
        padding-top: 1rem;
        min-width: unset;
    }

    .filter-group {
        min-width: unset;
    }

    .multiselect-list {
        position: static;
        border: 1px solid #e0e0e0;
        box-shadow: none;
        margin-top: 0;
    }

    .opportunities-container {
        grid-template-columns: 1fr;
    }

    .odds-row {
        grid-template-columns: 1fr;
    }

    .metrics-row {
        grid-template-columns: 1fr;
    }

    .calc-inputs {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .stats-container {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        padding: 1.5rem;
    }
}

/* ==============================
   SIDE AD SLOTS
   Positioned outside the 1400px container.
   Hidden below 1700px so they never overlap content.
   ============================== */
.ad-slot {
    position: fixed;
    top: 160px;
    width: 160px;
    min-height: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    z-index: 10;
}

.ad-slot-left  { left:  calc(50% - 700px - 180px); }
.ad-slot-right { right: calc(50% - 700px - 180px); }

.ad-unit {
    width: 160px;
    height: 600px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #444;
    font-size: 0.7rem;
    text-align: center;
    overflow: hidden;
}

/* Hide on screens where they'd overlap the main content */
@media (max-width: 1700px) {
    .ad-slot { display: none; }
}
