:root {
    --bg-color: #f8fafc;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --accent-color: #2563eb;
    --accent-hover: #1d4ed8;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #0f172a;
        --text-primary: #f8fafc;
        --text-secondary: #cbd5e1;
        --card-bg: #1e293b;
        --border-color: #334155;
        --accent-color: #3b82f6;
        --accent-hover: #60a5fa;
        --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    }
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Noto Sans KR', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.header {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 40px 0;
    margin-bottom: 40px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: -0.025em;
    background: linear-gradient(135deg, var(--accent-color), #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.date-section {
    margin-bottom: 40px;
    animation: fadeIn 0.5s ease-out;
}

.date-header {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.date-header::before {
    content: '';
    display: block;
    width: 6px;
    height: 24px;
    background-color: var(--accent-color);
    border-radius: 4px;
}

.news-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.news-source {
    background-color: var(--border-color);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.news-title {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
}

.news-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.news-title a:hover {
    color: var(--accent-color);
}

.news-description {
    color: var(--text-secondary);
    font-size: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.loading-state, .error-state {
    text-align: center;
    padding: 60px 0;
    color: var(--text-secondary);
}

.hidden {
    display: none !important;
}

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

footer {
    text-align: center;
    padding: 40px 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 40px;
    border-top: 1px solid var(--border-color);
}

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

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* AI Summary Box Styles */
.ai-summary {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.05);
    animation: fadeIn 0.5s ease-out;
}

@media (prefers-color-scheme: dark) {
    .ai-summary {
        background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(167, 139, 250, 0.1) 100%);
        border: 1px solid rgba(167, 139, 250, 0.2);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }
}

.ai-summary-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: #8b5cf6;
}

@media (prefers-color-scheme: dark) {
    .ai-summary-header {
        color: #a78bfa;
    }
}

.sparkle-icon {
    width: 20px;
    height: 20px;
    animation: float 3s ease-in-out infinite;
}

.ai-summary-content {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
}

.ai-summary-content p {
    margin-bottom: 12px;
}

.ai-summary-content p:last-child {
    margin-bottom: 0;
}

.ai-summary-content strong {
    font-weight: 600;
}

.ai-summary-content ul, .ai-summary-content ol {
    margin-bottom: 12px;
    padding-left: 20px;
}

.ai-summary-content li {
    margin-bottom: 4px;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-3px); }
    100% { transform: translateY(0px); }
}

.footnote-link {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9em;
    margin: 0 2px;
    padding: 2px 4px;
    border-radius: 4px;
    background-color: rgba(37, 99, 235, 0.1);
    transition: background-color 0.2s, color 0.2s;
}

@media (prefers-color-scheme: dark) {
    .footnote-link {
        background-color: rgba(59, 130, 246, 0.2);
    }
}

.footnote-link:hover {
    background-color: var(--accent-color);
    color: white;
    text-decoration: none;
}

.article-number {
    color: var(--accent-color);
    margin-right: 6px;
    font-weight: 700;
    font-size: 0.9em;
    opacity: 0.9;
}

