:root {
    --bg: #f5f7fb;
    --panel: #ffffff;
    --text: #172033;
    --muted: #5f6f89;
    --brand: #2563eb;
    --brand-dark: #1d4ed8;
    --border: #dbe3ef;
    --success: #0f766e;
    --danger: #b91c1c;
    --shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }

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

.container {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(10px);
}

.nav-container {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    text-decoration: none;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.nav-links a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 700;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--brand);
}

.hero {
    padding: 72px 0 36px;
}

.hero-card {
    background: linear-gradient(135deg, #ffffff 0%, #eef5ff 100%);
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 48px;
    box-shadow: var(--shadow);
}

.eyebrow {
    color: var(--brand);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: 13px;
}

h1 {
    font-size: clamp(38px, 6vw, 68px);
    line-height: 1.02;
    margin: 12px 0 18px;
}

h2 {
    font-size: 30px;
    margin: 0 0 14px;
}

h3 { margin-top: 0; }

.hero p,
.section-intro {
    color: var(--muted);
    font-size: 18px;
    max-width: 760px;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.button,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    padding: 12px 20px;
    background: var(--brand);
    color: #fff;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.button:hover,
button:hover {
    background: var(--brand-dark);
}

.button.secondary {
    background: #e8eef8;
    color: var(--text);
}

.button.secondary:hover { background: #dbe7f7; }

.section {
    padding: 34px 0;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.card,
.form-card,
.video-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 24px;
    box-shadow: var(--shadow);
}

label {
    display: block;
    font-weight: 800;
    margin: 12px 0 6px;
}

input,
textarea {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    font-size: 16px;
    background: #fff;
}

textarea { min-height: 140px; }

.form-note,
.small {
    color: var(--muted);
    font-size: 14px;
}

.message {
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 16px;
    font-weight: 700;
}

.message.success {
    background: #dff7f2;
    color: var(--success);
}

.message.error {
    background: #fee2e2;
    color: var(--danger);
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.thumbnail {
    aspect-ratio: 16 / 9;
    border-radius: 18px;
    background: linear-gradient(135deg, #1d4ed8, #60a5fa);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 42px;
    font-weight: 900;
    margin-bottom: 16px;
}

.badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 10px;
}

.lesson-list {
    display: grid;
    gap: 14px;
}

.lesson-item {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #fff;
}

.site-footer {
    margin-top: 50px;
    padding: 34px 0;
    border-top: 1px solid var(--border);
    color: var(--muted);
}

.footer-grid {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

@media (max-width: 860px) {
    .nav-container,
    .grid-2,
    .video-grid {
        grid-template-columns: 1fr;
    }

    .nav-container {
        align-items: flex-start;
        flex-direction: column;
        padding: 16px 0;
    }

    .hero-card { padding: 30px; }
}

/* Phase 2A: Featured video hero + real YouTube thumbnail cards */
.hero-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 460px);
    gap: 32px;
    align-items: center;
}

.featured-video-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.12);
}

.featured-thumbnail-link,
.thumbnail-link {
    position: relative;
    display: block;
    overflow: hidden;
    background: #0f172a;
}

.featured-thumbnail,
.thumbnail-img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    transition: transform 180ms ease, opacity 180ms ease;
}

.featured-thumbnail-link:hover .featured-thumbnail,
.thumbnail-link:hover .thumbnail-img {
    transform: scale(1.035);
    opacity: 0.88;
}

.play-button {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.92);
    color: #ffffff;
    font-size: 24px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.28);
}

.small-play {
    width: 48px;
    height: 48px;
    font-size: 18px;
}

.featured-video-body,
.video-card-body {
    padding: 22px;
}

.featured-video-body h2 {
    margin-top: 10px;
}

.featured-video-body p,
.video-card p {
    color: var(--muted);
}

.video-card {
    padding: 0;
    overflow: hidden;
}

.video-card-meta,
.section-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.video-meta {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.section-heading-row {
    margin-bottom: 20px;
}

.section-heading-row h2 {
    margin-bottom: 4px;
}

@media (max-width: 920px) {
    .hero-split {
        grid-template-columns: 1fr;
    }
}

.auth-card {
    max-width: 720px;
    margin: 0 auto;
}

.form-note a {
    color: var(--brand);
    font-weight: 800;
}

/* Phase 2C: admin class-file uploads */
.file-list {
    display: grid;
    gap: 14px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: var(--shadow);
}

.file-item h3 {
    margin: 8px 0 6px;
}

.file-item p {
    margin: 0 0 8px;
    color: var(--muted);
}

.code-block {
    white-space: pre-wrap;
    background: #0f172a;
    color: #e2e8f0;
    padding: 14px;
    border-radius: 14px;
    overflow-x: auto;
    font-size: 14px;
}

@media (max-width: 760px) {
    .file-item {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Phase 2D: password reset flow */
.reset-dev-box {
    margin: 18px 0;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #f8fafc;
    overflow-wrap: anywhere;
}

.reset-dev-box p {
    margin: 8px 0;
    color: var(--muted);
}

.reset-dev-box a {
    color: var(--brand);
    font-weight: 800;
}

/* Phase 2E: blog/news/tutorial article system */
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

.article-card,
.article-detail-card,
.admin-list-item {
    border: 1px solid var(--border);
    border-radius: 20px;
    background: #ffffff;
    box-shadow: var(--shadow);
}

.article-card {
    padding: 22px;
}

.article-card h2,
.article-card h3 {
    margin-top: 12px;
}

.article-card h2 a,
.article-card h3 a {
    color: var(--ink);
    text-decoration: none;
}

.article-card h2 a:hover,
.article-card h3 a:hover {
    color: var(--brand);
}

.article-card p,
.article-summary {
    color: var(--muted);
}

.article-meta,
.small {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    margin: 10px 0 16px;
}

.article-container {
    max-width: 900px;
}

.article-detail-card {
    padding: 34px;
}

.article-body {
    margin-top: 24px;
    line-height: 1.8;
    font-size: 17px;
    color: var(--ink);
}

.admin-list {
    display: grid;
    gap: 14px;
}

.admin-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 16px;
}

.admin-list-item h3 {
    margin: 8px 0 4px;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    font-weight: 800;
}

.checkbox-row input {
    width: auto;
}

select,
textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    font: inherit;
    background: #ffffff;
}

textarea {
    resize: vertical;
}

.article-promo-section {
    background: #f8fafc;
}

@media (max-width: 760px) {
    .admin-list-item {
        align-items: flex-start;
        flex-direction: column;
    }

    .article-detail-card {
        padding: 24px;
    }
}

.admin-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

@media (max-width: 760px) {
    .admin-actions {
        justify-content: flex-start;
    }
}
