/* ============================================
   ROWIN88 - Main Stylesheet
   ============================================ */

:root {
    /* Colors */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #10b981;
    --accent: #f59e0b;
    --danger: #ef4444;

    /* Neutrals */
    --bg-dark: #0f0f1a;
    --bg-card: #1a1a2e;
    --bg-card-hover: #252542;
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --border: #27273a;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;

    /* Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.25);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4);
}

/* ============================================
   Base Styles
   ============================================ */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

/* ============================================
   Navigation
   ============================================ */

.navbar {
    background: rgba(26, 26, 46, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    text-decoration: none;
    font-weight: 700;
    font-size: 1.5rem;
}

.logo-text {
    color: var(--text-primary);
}

.logo-88 {
    color: var(--primary);
    text-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
}

.nav-links {
    display: flex;
    gap: var(--space-lg);
}

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

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
}

/* ============================================
   Buttons
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

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

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

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-google {
    background: white;
    color: #333;
}

.btn-full {
    width: 100%;
}

.btn-sm {
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.75rem;
}

/* ============================================
   Main Content
   ============================================ */

.main-content {
    padding: var(--space-xl) 0;
    min-height: calc(100vh - 64px - 80px);
}

/* ============================================
   Date Picker
   ============================================ */

.date-picker {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.date-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
}

.date-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
}

.date-display {
    font-size: 1.125rem;
    font-weight: 500;
    min-width: 280px;
    text-align: center;
}

/* ============================================
   Worker Status
   ============================================ */

.worker-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
    font-size: 0.875rem;
    color: var(--text-muted);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--text-muted);
}

.status-dot.active {
    background: var(--secondary);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* ============================================
   Matches Grid
   ============================================ */

.matches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: var(--space-lg);
}

.match-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: all 0.2s;
}

.match-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
    font-size: 0.875rem;
}

.league {
    color: var(--primary-light);
    font-weight: 500;
}

.time {
    color: var(--text-muted);
}

.match-teams {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
}

.team {
    text-align: center;
    flex: 1;
}

.team-name {
    display: block;
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.team-prob {
    font-size: 0.875rem;
    color: var(--secondary);
    font-weight: 500;
}

.vs {
    color: var(--text-muted);
    font-size: 0.875rem;
    padding: 0 var(--space-md);
}

.match-draw {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border);
}

.match-prediction {
    text-align: center;
    margin-bottom: var(--space-md);
}

.prediction-score .label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
}

.prediction-score .score {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
}

.prediction-score .prob {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-left: var(--space-xs);
}

.match-esoteric {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    font-size: 0.875rem;
    padding-top: var(--space-md);
    border-top: 1px solid var(--border);
}

.esoteric-label {
    color: var(--text-muted);
}

.esoteric-value {
    font-weight: 500;
}

.esoteric-value.home {
    color: var(--secondary);
}

.esoteric-value.away {
    color: var(--danger);
}

.esoteric-value.draw {
    color: var(--accent);
}

.premium-blur {
    text-align: center;
    padding: var(--space-md);
    background: rgba(99, 102, 241, 0.1);
    border-radius: var(--radius-md);
    color: var(--primary-light);
    font-weight: 500;
    margin-top: var(--space-md);
}

/* ============================================
   Loading & Error States
   ============================================ */

.loading {
    text-align: center;
    padding: var(--space-xl) * 2;
    color: var(--text-muted);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto var(--space-md);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.error {
    text-align: center;
    padding: var(--space-xl);
    color: var(--danger);
}

.no-matches {
    text-align: center;
    padding: var(--space-xl) * 2;
    color: var(--text-muted);
}

.hidden {
    display: none !important;
}

/* ============================================
   Modal
   ============================================ */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    width: 100%;
    max-width: 400px;
    position: relative;
}

.modal-close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal h2 {
    text-align: center;
    margin-bottom: var(--space-lg);
}

.form-group {
    margin-bottom: var(--space-md);
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.form-group input {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
}

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

.divider {
    text-align: center;
    color: var(--text-muted);
    margin: var(--space-lg) 0;
    position: relative;
}

.divider::before,
.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: var(--border);
}

.divider::before {
    left: 0;
}

.divider::after {
    right: 0;
}

.google-icon {
    width: 18px;
    height: 18px;
}

/* ============================================
   User Menu
   ============================================ */

.user-menu {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.user-name {
    font-weight: 500;
}

.premium-badge {
    background: linear-gradient(135deg, var(--accent), var(--primary));
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
}

/* ============================================
   Footer
   ============================================ */

.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: var(--space-lg) 0;
}

.footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    gap: var(--space-lg);
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--text-primary);
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
    .navbar .container {
        height: 56px;
    }

    .nav-links {
        display: none;
    }

    .matches-grid {
        grid-template-columns: 1fr;
    }

    .date-display {
        font-size: 1rem;
        min-width: auto;
    }

    .footer .container {
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }
}

/* ============================================
   User Avatar & Dropdown
   ============================================ */

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    color: white;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.user-avatar:hover {
    border-color: var(--primary-light);
    transform: scale(1.05);
}

.user-avatar.premium {
    background: linear-gradient(135deg, var(--accent), #d97706);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    min-width: 180px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    z-index: 200;
}

.user-avatar-container:hover .user-dropdown,
.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-header {
    padding: var(--space-md);
    border-bottom: 1px solid var(--border);
}

.user-dropdown-email {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.user-dropdown-item:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.user-dropdown-item.danger {
    color: var(--danger);
}

.user-dropdown-item.danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

.user-avatar-container {
    position: relative;
}

/* ============================================
   Larger Team Names
   ============================================ */

.team-name {
    display: block;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: var(--space-xs);
}

/* ============================================
   Probability Bar with Icons
   ============================================ */

.prob-bar-container {
    display: flex;
    height: 40px;
    border-radius: 20px;
    overflow: hidden;
    margin: var(--space-md) 0;
    background: var(--bg-dark);
}

.prob-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    transition: width 0.5s ease;
}

.prob-bar.home {
    background: linear-gradient(135deg, #10b981, #059669);
}

.prob-bar.draw {
    background: linear-gradient(135deg, #6b7280, #4b5563);
}

.prob-bar.away {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.prob-icon {
    font-size: 1rem;
}

/* ============================================
   League Positioning
   ============================================ */

.match-card .league {
    display: block;
    text-align: center;
    margin-top: var(--space-xs);
    margin-bottom: var(--space-md);
    font-size: 0.75rem;
    padding: 0;
}

.match-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 0;
    font-size: 0.875rem;
}

.match-teams-section {
    text-align: center;
}

/* ============================================
   Gold Value Bets
   ============================================ */

.value-bets-section {
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border);
}

.value-bets-title {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-sm);
}

.value-bet-card {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(212, 160, 23, 0.15));
    border: 1px solid rgba(255, 215, 0, 0.4);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-sm);
}

.value-bet-card.gold {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(212, 160, 23, 0.25));
    border: 2px solid rgba(255, 215, 0, 0.6);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
    animation: goldPulse 2.5s ease-in-out infinite;
}

@keyframes goldPulse {

    0%,
    100% {
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
    }

    50% {
        box-shadow: 0 0 25px rgba(255, 215, 0, 0.4);
    }
}

.value-bet-market {
    font-size: 0.8rem;
    font-weight: 600;
    color: #ffd700;
}

.value-bet-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: var(--space-xs);
}

.value-bet-edge {
    color: #10b981;
    font-weight: 600;
}

/* ============================================
   Gematria Section
   ============================================ */

.gematria-section {
    margin-top: var(--space-md);
    padding: var(--space-md);
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: var(--radius-md);
}

.gematria-title {
    font-size: 0.75rem;
    color: #a855f7;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.gematria-values {
    display: flex;
    justify-content: space-around;
    text-align: center;
}

.gematria-team {
    flex: 1;
}

.gematria-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #c084fc;
}

.gematria-label {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ============================================
   Predictions Section
   ============================================ */

.predictions-section {
    margin-top: var(--space-md);
    padding: var(--space-md);
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-md);
}

.predictions-title {
    font-size: 0.75rem;
    color: #10b981;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.prediction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-xs) 0;
    font-size: 0.85rem;
}

.prediction-label {
    color: var(--text-secondary);
}

.prediction-value {
    font-weight: 600;
    color: var(--text-primary);
}

.prediction-value.high-confidence {
    color: #10b981;
}

.prediction-value.medium-confidence {
    color: var(--accent);
}