/* ============================================
   Football AI Analyzer - Main Stylesheet v2.5
   ============================================ */

/* ===== CSS Variables ===== */
:root {
    --bg: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #253349;
    --border: rgba(255,255,255,0.06);
    --border-hover: rgba(255,255,255,0.12);
    --text: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --primary: #e94560;
    --primary-hover: #ff6b81;
    --info: #3b82f6;
    --info-hover: #60a5fa;
    --warning: #f59e0b;
    --success: #22c55e;
    --danger: #ef4444;
    --purple: #a855f7;
    --radius: 12px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow: 0 4px 16px rgba(0,0,0,0.2);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.3);
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-lg: 16px;
    --space-xl: 24px;
    --space-2xl: 32px;
}

/* ===== Reset & Base ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }

/* ===== Container ===== */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 16px;
    flex: 1;
    width: 100%;
}

/* ===== Header / Navbar ===== */
.header {
    background: rgba(15,23,42,0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 56px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
}

.header-nav {
    display: flex;
    gap: 4px;
}

.header-nav a {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s;
    white-space: nowrap;
}

.header-nav a:hover {
    color: var(--text);
    background: rgba(255,255,255,0.06);
}

.header-nav a.active {
    color: var(--primary);
    background: rgba(233,69,96,0.1);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    display: none;
}

/* Mobile menu button */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-secondary);
    border-radius: 2px;
    transition: all 0.3s;
}

.mobile-menu-btn.open span:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

.mobile-menu-btn.open span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.open span:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
}

/* ===== Hero Section ===== */
.hero-section {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #1e3a5f 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(59,130,246,0.08) 0%, transparent 70%);
    border-radius: 50%;
}

.hero-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    position: relative;
    z-index: 1;
}

.hero-left h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.hero-left h1 .highlight {
    background: linear-gradient(135deg, #3b82f6, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 500px;
    line-height: 1.7;
    margin-bottom: 16px;
}

.hero-features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hero-feature-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    background: rgba(255,255,255,0.04);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.hero-stats {
    display: flex;
    gap: 20px;
    flex-shrink: 0;
}

.hero-stat-item {
    text-align: center;
}

.hero-stat-item .num {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, #3b82f6, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-stat-item .label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ===== AI Capabilities ===== */
.ai-capabilities {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.ai-cap-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    transition: all 0.25s;
}

.ai-cap-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.ai-cap-icon { font-size: 28px; margin-bottom: 8px; }
.ai-cap-card h4 { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.ai-cap-card p { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }

/* ===== Stats Showcase ===== */
.stats-showcase {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stats-showcase-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
}

.stats-showcase-item .num {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
}

.stats-showcase-item .label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.stats-showcase-item .sub-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ===== VIP CTA ===== */
.vip-cta-section {
    background: linear-gradient(135deg, rgba(245,158,11,0.06) 0%, rgba(233,69,96,0.06) 100%);
    border: 1px solid rgba(245,158,11,0.15);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.vip-cta-left h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.vip-cta-left p {
    font-size: 13px;
    color: var(--text-secondary);
    max-width: 500px;
}

.vip-cta-right {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.vip-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.vip-cta-btn.primary {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: #0f172a;
}

.vip-cta-btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245,158,11,0.3);
}

.vip-cta-btn.secondary {
    background: rgba(255,255,255,0.08);
    color: var(--text);
    border: 1px solid var(--border);
}

.vip-cta-btn.secondary:hover {
    background: rgba(255,255,255,0.12);
}

/* ===== Prediction Cards ===== */
.prediction-card {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    transition: all 0.25s;
    text-decoration: none;
    color: inherit;
}

.prediction-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* ===== Card Component ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 16px;
}

/* ===== Table ===== */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

table th {
    padding: 12px 16px;
    text-align: left;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 12px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

table tr:hover td {
    background: rgba(255,255,255,0.02);
}

/* ===== Form Elements ===== */
.form-select {
    padding: 8px 14px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
}

.form-select:focus {
    border-color: var(--info);
}

.form-select option {
    background: var(--bg-card);
    color: var(--text);
}

/* ===== Loading States ===== */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.loading-spinner-lg {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.08);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

.loading-text {
    font-size: 14px;
    color: var(--text-muted);
}

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

/* ===== Empty States ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.empty-state p {
    color: var(--text-muted);
    font-size: 14px;
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.6;
}

.empty-state .empty-action {
    display: inline-block;
    margin-top: 16px;
    padding: 8px 20px;
    background: var(--info);
    color: #fff;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
}

.empty-state .empty-action:hover {
    background: var(--info-hover);
}

/* ===== Error States ===== */
.error-container {
    text-align: center;
    padding: 60px 20px;
}

.error-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.error-container h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--danger);
}

.error-container p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 16px;
}

.error-retry-btn {
    display: inline-block;
    padding: 8px 20px;
    background: var(--danger);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.error-retry-btn:hover {
    background: #dc2626;
}

/* ===== Toast Notifications ===== */
.toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
    max-width: 360px;
}

.toast-success {
    background: rgba(34,197,94,0.95);
    color: #fff;
}

.toast-error {
    background: rgba(239,68,68,0.95);
    color: #fff;
}

.toast-info {
    background: rgba(59,130,246,0.95);
    color: #fff;
}

@keyframes toastIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ===== Guide Tip ===== */
.guide-tip {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 20px;
    background: linear-gradient(135deg, rgba(59,130,246,0.08), rgba(139,92,246,0.08));
    border: 1px solid rgba(59,130,246,0.15);
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.guide-tip-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.guide-tip-content {
    flex: 1;
}

.guide-tip-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 4px;
    flex-shrink: 0;
    transition: all 0.2s;
}

.guide-tip-close:hover {
    background: rgba(255,255,255,0.08);
    color: var(--text);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .container {
        padding: 16px 12px;
    }

    .header-content {
        padding: 0 12px;
    }

    .header-nav {
        display: none;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        background: rgba(15,23,42,0.98);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 8px;
        gap: 2px;
    }

    .header-nav.nav-open {
        display: flex;
    }

    .header-nav a {
        padding: 10px 16px;
        font-size: 15px;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .header-subtitle {
        display: none;
    }

    .hero-content {
        flex-direction: column;
        text-align: center;
    }

    .hero-stats {
        justify-content: center;
    }

    .hero-left h1 {
        font-size: 22px;
    }

    .hero-features {
        justify-content: center;
    }

    .ai-capabilities {
        grid-template-columns: 1fr;
    }

    .stats-showcase {
        grid-template-columns: repeat(2, 1fr);
    }

    .vip-cta-section {
        flex-direction: column;
        text-align: center;
    }

    .vip-cta-right {
        justify-content: center;
    }

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

    .match-card {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }

    .match-teams {
        flex-direction: column;
    }

    .match-time {
        min-width: auto;
    }

    .match-status-tag {
        text-align: center;
    }

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

    .benefits-table {
        font-size: 12px;
    }

    .benefits-table th,
    .benefits-table td {
        padding: 8px 10px;
    }

    .detail-page-wrapper {
        padding: 16px 12px;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 24px 20px;
    }

    .error-card {
        padding: 32px 24px;
    }

    .error-code {
        font-size: 48px;
    }

    .stats-showcase {
        grid-template-columns: 1fr 1fr;
    }

    .hero-stat-item .num {
        font-size: 22px;
    }
}

/* ===== Print Styles ===== */
@media print {
    .header,
    .footer,
    .vip-cta-section,
    .guide-tip {
        display: none !important;
    }

    body {
        background: #fff;
        color: #000;
    }

    .card,
    .prediction-card {
        border: 1px solid #ddd;
        break-inside: avoid;
    }
}
