/* CSS Design System - Tennis Arbitrage Dashboard */
:root {
    --bg-dark: #060918;
    --bg-card: rgba(13, 18, 41, 0.75);
    --bg-card-hover: rgba(22, 28, 59, 0.85);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-surebet: rgba(16, 185, 129, 0.4);
    
    --color-text-primary: #f8fafc;
    --color-text-secondary: #94a3b8;
    
    --color-betclic: #ff007f; /* Vibrant Neon Magenta */
    --color-poly: #00f0ff;    /* Electric Cyan */
    --color-green: #10b981;   /* Emerald Green */
    --color-gold: #f59e0b;    /* Warm Amber */
    
    --font-title: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--color-text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

/* Background glowing blob lights */
.glow-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    overflow: hidden;
}

.glow-bg::before, .glow-bg::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.15;
}

.glow-bg::before {
    background: radial-gradient(circle, var(--color-betclic) 0%, transparent 70%);
    top: -100px;
    left: -100px;
}

.glow-bg::after {
    background: radial-gradient(circle, var(--color-poly) 0%, transparent 70%);
    bottom: -150px;
    right: -100px;
}

/* Header design */
.app-header {
    background: rgba(6, 9, 24, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.pulse-dot {
    width: 10px;
    height: 10px;
    background-color: var(--color-betclic);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--color-betclic);
    animation: pulse 1.8s infinite;
}

.header-logo h1 {
    font-family: var(--font-title);
    font-weight: 800;
    font-size: 1.6rem;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #ffffff 40%, var(--color-poly) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.badge {
    background: rgba(0, 240, 255, 0.12);
    border: 1px solid rgba(0, 240, 255, 0.3);
    color: var(--color-poly);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.system-stats {
    display: flex;
    gap: 2rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-val {
    font-family: var(--font-title);
    font-weight: 700;
    font-size: 1.2rem;
}

.highlight-green {
    color: var(--color-green);
    text-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.highlight-blue {
    color: var(--color-poly);
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.4);
}

/* Dashboard Content Grid */
.dashboard-content {
    flex: 1;
    padding: 2.5rem;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
}

.matches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 2rem;
}

/* Card Block Design */
.match-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.match-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.15);
    background: var(--bg-card-hover);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

/* Glowing outline for active surebets */
.match-card.surebet-active {
    border-color: var(--color-green);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.25);
    animation: surebet-border-pulse 2.5s infinite;
}

/* Card Header */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.75rem;
}

.tournament-info {
    display: flex;
    flex-direction: column;
}

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

.match-type {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.15rem;
}

.simulated-tag {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--color-gold);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    text-transform: uppercase;
}

.live-tag {
    background: rgba(255, 0, 127, 0.12);
    border: 1px solid rgba(255, 0, 127, 0.3);
    color: var(--color-betclic);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    text-transform: uppercase;
}

.trj-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 0.3rem 0.6rem;
    font-family: var(--font-title);
    font-weight: 700;
    font-size: 0.9rem;
}

.trj-badge.surebet {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--color-green);
    color: var(--color-green);
    animation: text-pulse 1.8s infinite;
}

/* Matchup / Odds Panel */
.matchup-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.player-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.player-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--color-text-primary);
    max-width: 50%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.odds-comparison {
    display: flex;
    gap: 0.75rem;
}

.odd-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 75px;
    padding: 0.35rem;
    border-radius: 6px;
    border: 1px solid transparent;
}

.odd-box.betclic {
    background: rgba(255, 0, 127, 0.06);
    border-color: rgba(255, 0, 127, 0.15);
}

.odd-box.polymarket {
    background: rgba(0, 240, 255, 0.06);
    border-color: rgba(0, 240, 255, 0.15);
}

.odd-box.betclic.higher {
    background: rgba(255, 0, 127, 0.2);
    border-color: var(--color-betclic);
    box-shadow: 0 0 8px rgba(255, 0, 127, 0.3);
}

.odd-box.polymarket.higher {
    background: rgba(0, 240, 255, 0.2);
    border-color: var(--color-poly);
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
}

.platform-name {
    font-size: 0.6rem;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.odd-val {
    font-family: var(--font-title);
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: 0.1rem;
}

/* History Chart Container */
.chart-container {
    height: 180px;
    position: relative;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.15);
    padding: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

/* Calculator Widget */
.calc-widget {
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.15);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.calc-widget.inactive {
    opacity: 0.4;
    background: rgba(255, 255, 255, 0.01);
    border-color: rgba(255, 255, 255, 0.05);
}

.calc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.calc-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-green);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.calc-widget.inactive .calc-title {
    color: var(--color-text-secondary);
}

.stake-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stake-label {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
}

.stake-input {
    width: 70px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: var(--color-text-primary);
    padding: 0.2rem 0.4rem;
    text-align: center;
    font-family: var(--font-title);
    font-weight: 700;
}

.stake-input:focus {
    outline: none;
    border-color: var(--color-poly);
}

.calc-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.calc-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
}

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

.calc-row-val {
    font-weight: 600;
}

.profit-highlight {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 0.5rem;
    margin-top: 0.25rem;
    color: var(--color-green);
    font-weight: 700;
}

/* Spinner and Loaders */
.loading-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5rem 0;
    gap: 1.5rem;
    color: var(--color-text-secondary);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(0, 240, 255, 0.1);
    border-top-color: var(--color-poly);
    border-radius: 50%;
    animation: spin 1s infinite linear;
}

/* Footer style */
.app-footer {
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 2.5rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    background: rgba(6, 9, 24, 0.95);
    margin-top: auto;
}

/* Animations definition */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 10px var(--color-betclic); }
    50% { transform: scale(1.15); box-shadow: 0 0 18px var(--color-betclic); }
    100% { transform: scale(1); box-shadow: 0 0 10px var(--color-betclic); }
}

@keyframes text-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.75; }
}

@keyframes surebet-border-pulse {
    0%, 100% { border-color: rgba(16, 185, 129, 0.4); box-shadow: 0 0 20px rgba(16, 185, 129, 0.25); }
    50% { border-color: rgba(16, 185, 129, 0.95); box-shadow: 0 0 35px rgba(16, 185, 129, 0.5); }
}

/* Tabs Container & Navigation buttons */
.tabs-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem 0 0 0;
    z-index: 10;
}

.tab-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--color-text-secondary);
    font-family: var(--font-title);
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0.55rem 1.8rem;
    border-radius: 30px;
    cursor: pointer;
    transition: var(--transition-smooth);
    letter-spacing: 0.5px;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-text-primary);
    border-color: rgba(255, 255, 255, 0.2);
}

.tab-btn.active {
    background: rgba(0, 240, 255, 0.1);
    border-color: var(--color-poly);
    color: var(--color-poly);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.25);
}

/* Raw Feeds Explorer Section */
.raw-feeds-section {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
}

.feed-container {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.25rem;
    height: 350px;
    display: flex;
    flex-direction: column;
}

.feed-title {
    font-family: var(--font-title);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--color-text-primary);
}

.live-pulse {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-betclic);
    box-shadow: 0 0 8px var(--color-betclic);
    animation: text-pulse 1.2s infinite;
}

.live-pulse.blue {
    background: var(--color-poly);
    box-shadow: 0 0 8px var(--color-poly);
}

.feed-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding-right: 0.25rem;
}

/* Custom scrollbar for raw feeds */
.feed-list::-webkit-scrollbar {
    width: 4px;
}
.feed-list::-webkit-scrollbar-track {
    background: transparent;
}
.feed-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.feed-placeholder {
    color: var(--color-text-secondary);
    font-size: 0.85rem;
    text-align: center;
    padding: 3rem 0;
    font-style: italic;
}

.feed-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.03);
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
}

.feed-item-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    max-width: 70%;
}

.feed-item-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.feed-item-sub {
    font-size: 0.7rem;
    color: var(--color-text-secondary);
}

.feed-item-data {
    display: flex;
    gap: 0.5rem;
    font-family: var(--font-title);
    font-weight: 700;
    font-size: 0.8rem;
}

.feed-odd-badge {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
}

/* Responsive breakpoint adjustments */
@media(max-width: 768px) {
    .app-header {
        flex-direction: column;
        gap: 1.25rem;
        padding: 1.25rem;
    }
    
    .system-stats {
        width: 100%;
        justify-content: space-around;
    }
    
    .dashboard-content {
        padding: 1.25rem;
    }
}
