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

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    --dark-bg: #0f172a;
    --light-bg: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --highlight-yellow: #fef08a;
    --highlight-border: #eab308;
}

body.dark {
    --light-bg: #0f172a;
    --card-bg: #1e293b;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #334155;
    --highlight-yellow: #854d0e;
    --highlight-border: #fbbf24;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, 'Roboto', sans-serif;
    background: var(--light-bg);
    color: var(--text-main);
    font-size: 18px;
    line-height: 1.7;
    transition: background 0.3s, color 0.2s;
}

/* progress bar */
.progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: transparent;
    z-index: 2000;
}
.progress-bar {
    height: 5px;
    background: linear-gradient(90deg, var(--primary), #a855f7);
    width: 0%;
    transition: width 0.1s;
}

/* header */
.header {
    position: sticky;
    top: 0;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(16px);
    z-index: 1000;
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
}
body.dark .header { background: rgba(15,23,42,0.95); }
.nav-container {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    font-size: 1.9rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    cursor: pointer;
}
.nav-menu {
    display: flex;
    gap: 2rem;
    align-items: center;
}
.nav-menu a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
}
.nav-menu a:hover { color: var(--primary); }
.dark-toggle {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 42px;
    height: 42px;
    cursor: pointer;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hamburger {
    display: none;
    font-size: 1.8rem;
    cursor: pointer;
}

/* main container - BIGGER & COMFORTABLE */
.container {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* article card */
.article-detail {
    background: var(--card-bg);
    border-radius: 2rem;
    padding: 2.5rem;
    box-shadow: 0 20px 35px -12px rgba(0,0,0,0.15);
    margin-bottom: 2.5rem;
    transition: 0.2s;
}

.article-header {
    border-bottom: 2px solid var(--border);
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
}
.article-title {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}
.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
    font-size: 0.95rem;
    color: var(--text-muted);
}
.level-badge {
    padding: 0.3rem 1rem;
    border-radius: 40px;
    font-weight: 700;
}
.level-1-badge { background: #dcfce7; color: #166534; }
.level-2-badge { background: #fed7aa; color: #9a3412; }
.level-3-badge { background: #fee2e2; color: #b91c1c; }

/* featured image */
.featured-img {
    width: 100%;
    max-height: 480px;
    object-fit: cover;
    border-radius: 1.5rem;
    margin: 1.5rem 0;
    box-shadow: var(--shadow-sm);
}

/* toolbar */
.article-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 0;
    margin: 1rem 0 2rem 0;
}
.control-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--light-bg);
    border: 1px solid var(--border);
    padding: 0.6rem 1.2rem;
    border-radius: 44px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
    font-size: 0.95rem;
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}
.like-btn.active { background: #dcfce7; color: #166534; border-color: #166534; }
.dislike-btn.active { background: #fee2e2; color: #b91c1c; border-color: #b91c1c; }
.bookmark-btn.active { background: #fef08a; color: #854d0e; }
.tts-active { background: var(--success); color: white; animation: pulse 1s infinite; }

/* article content -> bigger text */
.article-content {
    font-size: 1.2rem;
    line-height: 1.8;
    margin: 2rem 0;
}
.article-content p {
    margin-bottom: 1.5rem;
}

/* Highlight style (selection based) */
.user-highlight {
    background-color: var(--highlight-yellow);
    border-bottom: 2px solid var(--highlight-border);
    cursor: pointer;
    transition: 0.1s;
    border-radius: 4px;
}

/* vocabulary */
.vocabulary-section {
    background: var(--light-bg);
    border-radius: 1.2rem;
    padding: 1.6rem;
    margin: 2rem 0;
}
.vocab-word {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 0.3rem 1rem;
    border-radius: 40px;
    margin: 0.25rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: 0.2s;
}
.vocab-word:hover {
    background: var(--primary-dark);
    transform: scale(1.02);
}

/* comments */
.comments-section {
    background: var(--card-bg);
    border-radius: 1.5rem;
    padding: 2rem;
}
.comment-form {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}
.comment-input {
    flex: 1;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
    background: var(--light-bg);
    font-family: inherit;
}
.comment-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 2rem;
    padding: 0 1.8rem;
    cursor: pointer;
    font-weight: 600;
}
.comment {
    border-bottom: 1px solid var(--border);
    padding: 1.2rem 0;
}
.comment-header {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 0.85rem;
}
.comment-author { font-weight: bold; color: var(--primary); }
.comment-text { margin: 0.5rem 0; line-height: 1.5; }
.comment-actions { display: flex; gap: 1rem; }
.comment-like, .comment-dislike {
    cursor: pointer;
    font-size: 0.85rem;
}

/* toast */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--success);
    color: white;
    padding: 0.8rem 1.8rem;
    border-radius: 60px;
    z-index: 2000;
    animation: fadeUp 0.3s ease;
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@media (max-width: 768px) {
    .container { padding: 0 1.2rem; }
    .article-detail { padding: 1.5rem; }
    .article-content { font-size: 1rem; }
    .nav-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 75px;
        left: 0;
        width: 100%;
        background: var(--card-bg);
        padding: 1rem;
        border-bottom: 1px solid var(--border);
    }
    .nav-menu.active { display: flex; }
    .hamburger { display: block; }
}

/* Responsive footer */
footer {
    text-align: center;
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    margin-top: 2rem;
    font-size: clamp(0.75rem, 3vw, 0.9rem);
}

/* Table Styles */
.vocabulary-table-container {
    overflow-x: auto;
    margin-top: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.vocabulary-table {
    width: 100%;
    background-color: var(--bg-primary);
    border-collapse: separate;
    border-spacing: 1;
    border-radius: 0.5rem;
    overflow: hidden;
    color: var(--text-primary);
}

.vocabulary-table thead tr {
    background-color: var(--header-bg);
}

.vocabulary-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-primary);
}

.vocabulary-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.vocabulary-table tbody tr:hover {
    background-color: var(--hover-bg);
    transition: background-color 0.2s ease;
}
