:root {
    /* Base colors */
    --bg: #ffffff;
    --surface: #ffffff;
    --text: #0f172a;
    --text-secondary: #475569;
    --muted: #64748b;
    --accent: #3b82f6;
    --accent-light: #dbeafe;
    --accent-dark: #1e40af;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    
    /* Animation */
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --radius: 0.75rem;
}

[data-theme="dark"] {
    --bg: #0f172a;
    --surface: #1e293b;
    --text: #f8fafc;
    --text-secondary: #cbd5e1;
    --muted: #94a3b8;
    --accent: #60a5fa;
    --accent-light: #1e3a8a;
    --accent-dark: #93c5fd;
    --border: #334155;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
}

body {
    margin: 0;
    font-family: 'DM Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* Navigation */
.top-nav {
    position: sticky;
    top: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    z-index: 100;
    backdrop-filter: blur(8px);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'Fraunces', serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.5px;
}

/* Theme Toggle */
.theme-toggle {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: all var(--transition);
    color: var(--text);
}

.theme-toggle:hover {
    transform: scale(1.1);
    background: var(--accent-light);
}

/* Main Content */
.page-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* Controls */
.controls {
    margin-bottom: 2rem;
    display: flex;
    gap: 1rem;
    position: sticky;
    top: 4.5rem;
    z-index: 90;
    background: var(--bg);
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

input[type="text"], select {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    transition: all var(--transition);
}

input[type="text"] {
    flex: 1;
}

input[type="text"]:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

select {
    min-width: 200px;
    cursor: pointer;
    padding-right: 2.5rem;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1em;
}

/* Dark theme adjustment for the arrow */
[data-theme='dark'] select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
}

/* Articles */
article {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    transition: all var(--transition);
    cursor: pointer;
    border: 1px solid var(--border);
}

article:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 20px rgb(0 0 0 / 0.1);
    border-color: var(--accent);
}

article h2 {
    font-family: 'Fraunces', serif;
    color: var(--text);
    margin: 0 0 1rem;
    font-size: 1.5rem;
    line-height: 1.3;
}

article p {
    color: var(--text-secondary);
    margin: 0 0 1rem;
    line-height: 1.6;
}

article small {
    color: var(--muted);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Loading States */
.skeleton-article {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.skeleton-article::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    background-image: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0,
        rgba(255, 255, 255, 0.2) 20%,
        rgba(255, 255, 255, 0.5) 60%,
        rgba(255, 255, 255, 0)
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    color: var(--muted);
    border-top: 1px solid var(--border);
    background: var(--surface);
    margin-top: 4rem;
}

/* Article View */
.article-view {
    max-width: 800px;
    margin: 0 auto;
    padding: 0;
    margin-bottom: 5rem;
}

.article-header {
    margin-bottom: 2rem;
}

.back-button {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    margin-bottom: 1.5rem;
    transition: all var(--transition);
}

.back-button:hover {
    background: var(--accent-light);
    border-color: var(--accent);
}

.article-header h1 {
    font-family: 'Fraunces', serif;
    font-size: 2.5rem;
    line-height: 1.2;
    margin: 0 0 1rem;
    color: var(--text);
}

.article-meta {
    display: flex;
    gap: 0.5rem;
    color: var(--muted);
    font-size: 0.95rem;
}

.article-content {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 1.1rem;
}

/* Article Content Images */
.article-image {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 2rem auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* Article Content Links */
.article-link {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all var(--transition);
}

.article-link:hover {
    border-bottom-color: var(--accent);
}

.article-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 5px 24px;
    font-size: 0.95rem;
    color: inherit !important;
    background-color: var(--surface-color, #f8f9fa);
    border: 1px solid var(--border-color, #a3a3a3);
    border-radius: 12px;
    max-width: 200px;
    margin: 0 auto;
    margin-top: 1.5rem;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.article-button::after {
    content: "→";
    margin-left: 4px;
    transition: transform 0.2s ease;
}

.article-button:hover {
    transform: translateY(-1px);
    background: var(--accent-light);
    border-color: var(--accent);
}

.article-button:hover::after {
    transform: translateX(4px);
}

.article-button:active {
    transform: translateY(0);
}

/* Dark theme adjustments */
[data-theme='dark'] .article-button {
    background-color: var(--surface-color, #1f2937);
    border-color: var(--border-color, #374151);
}

[data-theme='dark'] .article-button:hover {
    background-color: var(--hover-color, #2d3748);
    border-color: var(--border-hover-color, #4b5563);
}

.error-message {
    color: var(--text);
    border: 1px solid var(--border);
    padding: 1rem;
    border-radius: var(--radius);
    margin: 2rem auto;
    max-width: 600px;
    text-align: center;
}

.error-message span {
    font-size: 2rem;
    font-weight: bold;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        padding: 1rem;
    }
    
    .page-container {
        padding: 0 1rem;
        margin: 1rem auto;
    }
    
    .controls {
        flex-direction: column;
        position: relative;
        top: 0;
        padding: 0;
        border: none;
    }
    
    select {
        min-width: unset;
        width: 100%;
    }
    
    article {
        padding: 1.25rem;
    }
    
    article h2 {
        font-size: 1.25rem;
    }

    .article-view {
        padding: 1rem;
    }

    .article-header h1 {
        font-size: 1.8rem;
    }

    .article-content {
        font-size: 1rem;
    }
}
  