:root {
    --primary: #009688;
    --primary-hover: #00796b;
    --primary-light: #e0f2f1;
    --accent: #ff7043;
    --accent-hover: #f4511e;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --bg-page: #f8fafc;
    --card-bg: #ffffff;
    --border: #e2e8f0;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 15px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.12);
}

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

body {
    font-family: 'Quicksand', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .brand-title, .step-badge, .btn-ctrl, .cat-pill {
    font-family: 'Fredoka', cursive, sans-serif;
    letter-spacing: 0.3px;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
}

/* ========================================================= */
/* HEADER                                                    */
/* ========================================================= */
.site-header {
    background: #ffffff;
    border-bottom: 2px solid #eef2f6;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    cursor: pointer;
}

.brand-icon {
    font-size: 28px;
    background: #e0f2f1;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    box-shadow: 0 2px 6px rgba(0,150,136,0.15);
}

.brand-title {
    font-size: 22px;
    font-weight: 700;
    color: #0f766e;
    line-height: 1.1;
}

.brand-sub {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* Search Box */
.header-search {
    flex: 1;
    max-width: 420px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 14px;
    font-size: 15px;
    color: #94a3b8;
    pointer-events: none;
}

.header-search input {
    width: 100%;
    padding: 10px 38px 10px 40px;
    background: #f1f5f9;
    border: 2px solid transparent;
    border-radius: 25px;
    font-size: 14px;
    color: #334155;
    outline: none;
    transition: all 0.2s ease;
}

.header-search input:focus {
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,150,136,0.15);
}

.search-clear-btn {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 14px;
}

/* Color Online Pill in Header */
.nav-pill-color {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: linear-gradient(135deg, #ff7043, #f4511e);
    color: #ffffff !important;
    padding: 9px 18px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(244,81,30,0.25);
    transition: all 0.2s ease;
}

.nav-pill-color:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(244,81,30,0.35);
}

/* ========================================================= */
/* HERO BANNER                                               */
/* ========================================================= */
.hero-banner {
    background: linear-gradient(135deg, #0f766e 0%, #0d9488 100%);
    color: #ffffff;
    padding: 40px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-banner::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 0;
    right: 0;
    height: 40px;
    background: var(--bg-page);
    border-radius: 50% 50% 0 0;
}

.hero-title {
    font-size: 34px;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.hero-title .highlight {
    color: #fde047;
}

.hero-desc {
    font-size: 16px;
    color: #ccfbf1;
    max-width: 600px;
    margin: 0 auto;
}

/* ========================================================= */
/* CATEGORIES / APPS FILTER TABS                             */
/* ========================================================= */
.category-filter-bar {
    max-width: 1200px;
    margin: 25px auto 10px;
    padding: 0 20px;
}

.category-pills {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: thin;
}

.cat-pill {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    color: #475569;
    padding: 8px 18px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.cat-pill:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.cat-pill.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(0,150,136,0.25);
}

/* ========================================================= */
/* DRAWINGS GRID                                             */
/* ========================================================= */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.grid-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
}

.section-title {
    font-size: 24px;
    color: var(--text-main);
}

.items-count-badge {
    background: #e2e8f0;
    color: #475569;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
}

.drawings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 22px;
}

/* Drawing Card */
.drawing-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s cubic-bezier(0.165, 0.84, 0.44, 1);
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.drawing-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: #cbd5e1;
}

.card-img-wrap {
    height: 190px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    position: relative;
    border-bottom: 1px solid #f1f5f9;
}

.card-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.25s ease;
}

.drawing-card:hover .card-img {
    transform: scale(1.06);
}

.card-step-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(15, 118, 110, 0.9);
    backdrop-filter: blur(4px);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 20px;
}

.card-body {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
}

.card-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-main);
    text-transform: capitalize;
    margin-bottom: 8px;
}

.card-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    margin-top: auto;
}

.card-action span:last-child {
    transition: transform 0.2s ease;
}

.drawing-card:hover .card-action span:last-child {
    transform: translateX(4px);
}

/* Skeleton Loading */
.skeleton-card {
    background: #ffffff;
    border-radius: var(--radius-md);
    height: 260px;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.skeleton-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.7), transparent);
    animation: skeletonShimmer 1.4s infinite;
}

@keyframes skeletonShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: #ffffff;
    border-radius: var(--radius-md);
    border: 1px dashed var(--border);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

/* ========================================================= */
/* VIEW 2: STEP-BY-STEP PLAYER                               */
/* ========================================================= */
.player-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}

.btn-back {
    background: #ffffff;
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.btn-back:hover {
    background: #f1f5f9;
}

.breadcrumbs {
    font-size: 14px;
    color: var(--text-muted);
}

.breadcrumbs strong {
    color: var(--text-main);
    text-transform: capitalize;
}

.topbar-actions {
    display: flex;
    gap: 10px;
}

.btn-tool {
    background: #ffffff;
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.btn-tool:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-color-link {
    background: #fff7ed;
    border-color: #ffedd5;
    color: #c2410c;
}

.btn-color-link:hover {
    background: #ffedd5;
    border-color: #fdba74;
    color: #9a3412;
}

/* Player Card */
.player-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.player-header {
    padding: 20px 28px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.player-title {
    font-size: 26px;
    color: var(--text-main);
    text-transform: capitalize;
}

.player-subtitle {
    font-size: 13px;
    color: var(--text-muted);
}

.step-badge {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
}

/* Stage Wrapper */
.stage-wrapper {
    position: relative;
    background: #ffffff;
    padding: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 440px;
}

.stage-canvas-container {
    max-width: 520px;
    width: 100%;
    height: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.stage-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: opacity 0.18s ease;
}

.stage-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    font-size: 28px;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.stage-nav-arrow:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.stage-nav-prev { left: 20px; }
.stage-nav-next { right: 20px; }

/* Progress Bar */
.progress-bar-container {
    height: 5px;
    background: #f1f5f9;
    width: 100%;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #009688, #4db6ac);
    transition: width 0.25s ease;
}

/* Player Controls Bar */
.player-controls {
    padding: 16px 28px;
    background: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-ctrl {
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    border: none;
}

.btn-prev {
    background: #ffffff;
    color: #334155;
    border: 1px solid var(--border);
}

.btn-prev:hover:not(:disabled) {
    background: #f1f5f9;
}

.btn-next {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0,150,136,0.3);
}

.btn-next:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-ctrl:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}

.ctrl-center-tools {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-autoplay {
    background: #ffffff;
    border: 1px solid var(--border);
    color: #334155;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-autoplay.active {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #b91c1c;
}

.select-speed {
    padding: 7px 10px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: #ffffff;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    outline: none;
}

/* Filmstrip Thumbnail Track */
.filmstrip-section {
    padding: 18px 24px;
    background: #ffffff;
}

.filmstrip-title {
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.filmstrip-track {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: thin;
}

.film-thumb {
    flex: 0 0 68px;
    height: 68px;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    background: #f8fafc;
    padding: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all 0.15s ease;
}

.film-thumb:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.film-thumb.active {
    border-color: var(--primary);
    background: #f0fdf4;
    box-shadow: 0 0 0 3px rgba(0,150,136,0.25);
}

.film-thumb img {
    max-width: 100%;
    max-height: 44px;
    object-fit: contain;
}

.film-thumb-num {
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
    margin-top: 2px;
}

/* Completed Banner */
.completed-banner {
    margin-top: 25px;
    background: linear-gradient(135deg, #f0fdf4 0%, #e0f2fe 100%);
    border: 2px solid #bbf7d0;
    border-radius: var(--radius-lg);
    padding: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.completed-badge {
    display: inline-block;
    background: #15803d;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 10px;
}

.completed-content h3 {
    font-size: 24px;
    color: #14532d;
    margin-bottom: 6px;
}

.completed-content p {
    font-size: 14px;
    color: #166534;
    margin-bottom: 18px;
}

.completed-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: #ffffff;
    color: #334155;
    border: 1px solid var(--border);
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.completed-preview {
    width: 140px;
    height: 140px;
    background: #ffffff;
    border-radius: 16px;
    border: 2px solid #bbf7d0;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.completed-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* ========================================================= */
/* PRINTABLE WORKSHEET MODAL & PRINT STYLES                  */
/* ========================================================= */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.print-dialog {
    background: #ffffff;
    border-radius: var(--radius-lg);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
}

.print-dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.print-sheet {
    background: #ffffff;
    padding: 20px;
}

.print-sheet-header {
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px dashed #cbd5e1;
}

.print-sheet-header h1 {
    font-size: 26px;
    color: #1e293b;
    text-transform: capitalize;
}

.print-sheet-header p {
    font-size: 12px;
    color: #64748b;
}

.print-steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.print-step-item {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    background: #ffffff;
}

.print-step-item img {
    width: 100%;
    height: 140px;
    object-fit: contain;
    margin-bottom: 6px;
}

.print-step-num {
    font-size: 12px;
    font-weight: 700;
    color: #334155;
}

@media print {
    body * {
        visibility: hidden;
    }
    .print-sheet, .print-sheet * {
        visibility: visible;
    }
    .print-sheet {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        margin: 0;
        padding: 10px;
    }
    .no-print {
        display: none !important;
    }
}

/* ========================================================= */
/* FOOTER                                                    */
/* ========================================================= */
.site-footer {
    background: #ffffff;
    border-top: 1px solid #eef2f6;
    margin-top: 60px;
    padding: 30px 20px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-brand .footer-logo {
    font-size: 18px;
    font-weight: 700;
    color: #0f766e;
    font-family: 'Fredoka', cursive, sans-serif;
}

.footer-brand p {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.footer-links {
    display: flex;
    gap: 20px;
    font-size: 14px;
    font-weight: 600;
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-copy {
    font-size: 12px;
    color: #94a3b8;
    width: 100%;
    border-top: 1px solid #f1f5f9;
    padding-top: 16px;
    margin-top: 10px;
}

/* ========================================================= */
/* RESPONSIVE DESIGN                                         */
/* ========================================================= */
@media (max-width: 768px) {
    .hero-title { font-size: 26px; }
    .header-container { flex-wrap: wrap; }
    .header-search { order: 3; max-width: 100%; margin-top: 6px; }
    .drawings-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
    .stage-wrapper { padding: 15px; min-height: 300px; }
    .stage-canvas-container { height: 260px; }
    .stage-nav-arrow { display: none; }
    .completed-banner { flex-direction: column; text-align: center; }
    .completed-actions { justify-content: center; }
    .print-steps-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .drawings-grid { grid-template-columns: 1fr; }
    .player-header { flex-direction: column; align-items: flex-start; gap: 8px; }
    .player-controls { justify-content: center; }
    .btn-ctrl { width: 100%; justify-content: center; }
}
