:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a25;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --accent-1st: #00d4ff;
    --accent-2nd: #ff6b35;
    --accent-prediction: #9b59b6;
    --border-color: rgba(255, 255, 255, 0.1);
    --gradient-1st: linear-gradient(135deg, #00d4ff, #0099cc);
    --gradient-2nd: linear-gradient(135deg, #ff6b35, #cc5522);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Pretendard', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, transparent 100%);
    border-radius: 20px;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(90deg, var(--accent-1st), var(--accent-2nd));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Legend */
.legend {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.legend-color {
    width: 20px;
    height: 4px;
    border-radius: 2px;
}

.legend-color.first {
    background: var(--accent-1st);
}

.legend-color.second {
    background: var(--accent-2nd);
}

.legend-color.prediction {
    background: var(--accent-prediction);
    border: 1px dashed var(--accent-2nd);
}

/* Charts */
.chart-section {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.chart-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4);
}

.chart-section h2 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chart-section h2::before {
    content: '';
    width: 4px;
    height: 20px;
    background: var(--gradient-1st);
    border-radius: 2px;
}

.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
}

/* Table Section */
.table-section {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.table-section h2 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.table-section h2::before {
    content: '';
    width: 4px;
    height: 20px;
    background: var(--gradient-2nd);
    border-radius: 2px;
}

.table-container {
    max-height: 500px;
    overflow-y: auto;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.table-container::-webkit-scrollbar {
    width: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.table-container::-webkit-scrollbar-thumb {
    background: var(--text-secondary);
    border-radius: 4px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

thead {
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    z-index: 10;
}

th {
    padding: 1rem;
    text-align: center;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
}

td {
    padding: 0.8rem 1rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.date-1st {
    color: var(--accent-1st);
}

.date-2nd {
    color: var(--accent-2nd);
}

.prediction-row {
    background: rgba(155, 89, 182, 0.1);
}

.prediction-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background: var(--accent-prediction);
    color: white;
    border-radius: 4px;
    font-size: 0.7rem;
    margin-left: 0.5rem;
}

.actual-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background: #27ae60;
    color: white;
    border-radius: 4px;
    font-size: 0.7rem;
    margin-left: 0.5rem;
}

/* Loading */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-1st);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Stats */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    text-align: center;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.stat-value.first {
    color: var(--accent-1st);
}

.stat-value.second {
    color: var(--accent-2nd);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .chart-container {
        height: 300px;
    }
    
    .legend {
        gap: 1rem;
    }
    
    .stats {
        grid-template-columns: repeat(2, 1fr);
    }
}
