/* =============================================
   ROJAN THEME - Main Stylesheet
   ============================================= */

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #4F46E5;
    --primary-dark: #4338CA;
    --primary-light: #EEF2FF;
    --secondary: #0EA5E9;
    --accent: #F59E0B;
    --success: #10B981;
    --error: #EF4444;
    --warning: #F59E0B;
    --dark: #0F172A;
    --gray-900: #1E293B;
    --gray-700: #334155;
    --gray-500: #64748B;
    --gray-300: #CBD5E1;
    --gray-100: #F1F5F9;
    --gray-50: #F8FAFC;
    --white: #FFFFFF;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --container: 1200px;
    --transition: 0.2s ease;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    color: var(--gray-900);
    background: var(--gray-50);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    width: 100%;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4, h5, h6 { line-height: 1.3; color: var(--dark); font-weight: 700; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; width: 100%; overflow: hidden; }

.section { padding: 80px 0; }

.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-header h2 {
    font-size: 2rem;
    margin-bottom: 12px;
}

.section-header p {
    color: var(--gray-500);
    font-size: 1.125rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: var(--font);
    line-height: 1.4;
    border: 2px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover { transform: translateY(-1px); }

.btn-sm { padding: 6px 16px; font-size: 0.8125rem; }
.btn-lg { padding: 14px 32px; font-size: 1.0625rem; }
.btn-block { width: 100%; }

.btn-primary { background: var(--primary); color: var(--white); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: var(--white); }

.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: var(--white); }

.btn-ghost { background: transparent; color: var(--gray-500); border-color: transparent; }
.btn-ghost:hover { background: var(--gray-100); color: var(--gray-900); }

.btn-white { background: var(--white); color: var(--primary); border-color: var(--white); }
.btn-white:hover { background: var(--gray-100); color: var(--primary-dark); }

/* ---- Header ---- */
.site-header {
    position: relative;
    z-index: 100;
    background: white;
    border-bottom: 1px solid var(--gray-100);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
    gap: 24px;
}

.site-title {
    font-size: 1.375rem;
    font-weight: 800;
    color: var(--dark);
    letter-spacing: -0.5px;
}

.site-logo {
    display: inline-flex;
    align-items: center;
    max-width: 200px;
}

.site-logo img {
    max-width: 100%;
    max-height: 60px;
    height: auto;
    width: auto;
}

.main-nav { display: flex; align-items: center; }

.nav-menu {
    display: flex;
    list-style: none;
    gap: 4px;
}

.nav-menu li a {
    padding: 8px 16px;
    color: var(--gray-700);
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: var(--radius);
    transition: all var(--transition);
}

.nav-menu li a:hover,
.nav-menu li.current-menu-item a {
    color: var(--primary);
    background: var(--primary-light);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-greeting {
    font-size: 0.875rem;
    color: var(--gray-500);
    font-weight: 500;
}

.nav-toggle { display: none; }

/* ---- Hero Section ---- */
.hero-section {
    position: relative;
    padding: 100px 0 80px;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 50%, #C7D2FE 100%);
    z-index: -1;
}

.hero-bg::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(79,70,229,0.08) 0%, transparent 70%);
}

.hero-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero-content h1 {
    font-size: 3.25rem;
    font-weight: 800;
    letter-spacing: -1.5px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--dark) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--gray-500);
    margin-bottom: 36px;
    line-height: 1.7;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 60px;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 60px;
}

.stat { text-align: center; }

.stat-number {
    display: block;
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--gray-500);
    font-weight: 500;
}

.hero-content h1 {
    font-size: 3.25rem;
    font-weight: 800;
    letter-spacing: -1.5px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--dark) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--gray-500);
    margin-bottom: 36px;
    line-height: 1.7;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 60px;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 60px;
}

.stat { text-align: center; }

.stat-number {
    display: block;
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--gray-500);
    font-weight: 500;
}

/* ---- Features Section ---- */
.features-section { background: var(--white); }

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.feature-card {
    padding: 32px 24px;
    border-radius: var(--radius-lg);
    background: var(--gray-50);
    transition: all var(--transition);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.feature-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 1.125rem;
    margin-bottom: 8px;
}

.feature-card p {
    font-size: 0.9375rem;
    color: var(--gray-500);
    line-height: 1.6;
}

/* ---- Subjects Grid ---- */
.subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}

.subject-card {
    display: block;
    padding: 32px;
    border-radius: var(--radius-lg);
    background: var(--white);
    border: 2px solid var(--gray-100);
    text-align: center;
    transition: all var(--transition);
    color: var(--gray-900);
}

.subject-card:hover {
    border-color: var(--subject-color, var(--primary));
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    color: var(--gray-900);
}

.subject-placeholder {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.subject-placeholder .subject-initial {
    color: var(--white);
    font-size: 28px;
    font-weight: 700;
}

.subject-card h3 { font-size: 1.25rem; margin-bottom: 8px; }

.video-count {
    font-size: 0.875rem;
    color: var(--gray-500);
    font-weight: 500;
}

/* ---- Video Grid ---- */
.videos-page { padding: 0; }

.videos-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 32px;
}

.videos-header h1 { font-size: 1.75rem; }

.access-note {
    width: 100%;
    padding: 8px 12px;
    background: var(--primary-light);
    color: var(--primary-dark);
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    margin-top: 12px;
}

.video-filters { display: flex; gap: 12px; }

.filter-select {
    padding: 8px 16px;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-family: var(--font);
    background: var(--white);
    color: var(--gray-700);
    cursor: pointer;
    transition: border-color var(--transition);
}

.filter-select:focus { outline: none; border-color: var(--primary); }

.filter-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 32px; }

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.video-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    transition: all var(--transition);
}

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

.video-thumb {
    position: relative;
    display: block;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: var(--gray-100);
}

.video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.video-card:hover .video-thumb img { transform: scale(1.05); }

.play-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.25);
    opacity: 0;
    transition: opacity var(--transition);
}

.video-card:hover .play-overlay { opacity: 1; }

.play-overlay svg { filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3)); }

.video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8125rem;
    font-weight: 600;
}

.video-info {
    padding: 20px;
}

.video-subject {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    margin-bottom: 8px;
}

.video-difficulty {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 8px;
    margin-left: 4px;
}

.badge-beginner { background: #DCFCE7; color: #166534; }
.badge-intermediate { background: #FEF3C7; color: #92400E; }
.badge-advanced { background: #FEE2E2; color: #991B1B; }

.video-info h3 {
    font-size: 1.0625rem;
    margin-bottom: 12px;
}

.video-info h3 a { color: var(--dark); }
.video-info h3 a:hover { color: var(--primary); }

.no-videos {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-500);
    font-size: 1.125rem;
}

/* ---- Single Video ---- */
.single-video { padding: 40px 0; }

.video-player-wrapper {
    margin-bottom: 32px;
}

.video-player {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

.video-player iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
}

/* Video Protection Layers */
.video-protection-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 10;
    pointer-events: none;
    background: transparent;
    /* Prevents right-click save and drag */
    -webkit-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
    user-drag: none;
}

/* Dynamic Watermark - diagonal repeating pattern */
.video-watermark {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 11;
    pointer-events: none;
    overflow: hidden;
    opacity: 0.08;
    font-family: var(--font);
}

.video-watermark::before,
.video-watermark::after {
    content: attr(data-text);
    position: absolute;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 500;
    color: var(--white);
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    transform: rotate(-25deg);
    animation: watermarkMove 20s linear infinite;
}

.video-watermark::before {
    top: -50%;
    left: -50%;
    animation-delay: 0s;
}

.video-watermark::after {
    bottom: -50%;
    right: -50%;
    animation-delay: -10s;
}

@keyframes watermarkMove {
    0% { transform: rotate(-25deg) translateX(-100%); }
    100% { transform: rotate(-25deg) translateX(100%); }
}

/* Video blurred state when tab unfocused */
.video-player-wrapper.blurred .video-player {
    filter: blur(8px);
    pointer-events: none;
}

.video-player-wrapper.blurred::after {
    content: 'Tab inactive — video blurred for protection';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(15, 23, 42, 0.95);
    color: white;
    padding: 16px 24px;
    border-radius: var(--radius);
    font-size: 0.9375rem;
    font-weight: 500;
    text-align: center;
    z-index: 20;
    pointer-events: none;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.95); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* Protection Toast Notification */
.rojan-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--dark);
    color: var(--white);
    padding: 14px 20px;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: var(--shadow-xl);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideInRight 0.3s ease;
    max-width: 360px;
}

.rojan-toast.warning {
    background: var(--warning);
    color: #1a1a1a;
}

.rojan-toast.error {
    background: var(--error);
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

.rojan-toast.fade-out {
    animation: slideOutRight 0.3s ease forwards;
}

@keyframes slideOutRight {
    to { opacity: 0; transform: translateX(100%); }
}

/* Disable context menu on video wrapper */
.video-player-wrapper {
    -webkit-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
    user-drag: none;
}

.video-player-placeholder {
    aspect-ratio: 16/9;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    border-radius: var(--radius-lg);
    color: var(--gray-500);
}

.video-content {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
}

.video-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.video-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    color: var(--gray-500);
}

.video-title {
    font-size: 2rem;
    margin-bottom: 20px;
}

.video-description {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--gray-700);
}

.video-description p { margin-bottom: 16px; }

/* ---- Related Videos ---- */
.related-videos h3 {
    font-size: 1.125rem;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--gray-100);
}

.related-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius);
    transition: background var(--transition);
    text-decoration: none;
    color: var(--gray-900);
}

.related-item:hover { background: var(--gray-50); }

.related-thumb {
    position: relative;
    flex-shrink: 0;
    width: 120px;
    aspect-ratio: 16/9;
    border-radius: 6px;
    overflow: hidden;
    background: var(--gray-100);
}

.related-thumb img { width: 100%; height: 100%; object-fit: cover; }

.related-duration {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 0.6875rem;
    font-weight: 600;
}

.related-info h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.3;
}

.related-subject {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* ---- Archive Header ---- */
.archive-header {
    padding: 32px 0 16px;
    background: var(--gray-50);
    text-align: center;
}

.archive-header h1 { font-size: 1.75rem; margin-bottom: 4px; }

.archive-header p { color: var(--gray-500); font-size: 1rem; margin: 0; }

.archive-header p a { text-decoration: underline; }

.archive-header + .section { padding-top: 0; }

.archive-header + .section .container > .search-bar:first-child { margin-top: 0; }

.breadcrumb {
    display: block;
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin-bottom: 12px;
}

.term-count {
    font-weight: 600;
    color: var(--primary) !important;
    margin-top: 8px;
}

/* ---- Auth Pages ---- */
.auth-container {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-100);
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header h1 {
    font-size: 1.75rem;
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--gray-500);
    font-size: 0.9375rem;
}

.social-login {
    margin-bottom: 24px;
    display: flex;
    justify-content: center;
}

.auth-divider {
    position: relative;
    text-align: center;
    margin: 24px 0;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--gray-100);
}

.auth-divider span {
    position: relative;
    background: var(--white);
    padding: 0 16px;
    color: var(--gray-500);
    font-size: 0.8125rem;
}

.auth-form .form-group {
    margin-bottom: 20px;
}

.auth-form label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="tel"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    font-family: var(--font);
    transition: border-color var(--transition);
    background: var(--white);
}

.auth-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

.remember-group { display: flex; align-items: center; gap: 8px; }
.remember-group label { margin: 0; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.remember-group input[type="checkbox"] { width: auto; }

.auth-form .btn { margin-top: 8px; }

.auth-footer-text {
    text-align: center;
    margin-top: 24px;
    font-size: 0.875rem;
    color: var(--gray-500);
}

.auth-footer-text a { font-weight: 600; }

/* ---- Alerts ---- */
.rojan-alert {
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 24px;
    font-size: 0.9375rem;
}

.rojan-alert p { margin: 0; }

.rojan-alert a {
    font-weight: 600;
    text-decoration: underline;
}

.rojan-alert.error { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.rojan-alert.success { background: #F0FDF4; color: #166534; border: 1px solid #BBF7D0; }
.rojan-alert.warning { background: #FFFBEB; color: #92400E; border: 1px solid #FDE68A; }
.rojan-alert.info { background: #EFF6FF; color: #1E40AF; border: 1px solid #BFDBFE; }

/* ---- CTA Section ---- */
.cta-section { padding: 60px 0; }

.cta-card {
    text-align: center;
    padding: 64px 40px;
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
}

.cta-card h2 {
    font-size: 2rem;
    color: var(--white);
    margin-bottom: 12px;
}

.cta-card p {
    font-size: 1.125rem;
    opacity: 0.9;
    margin-bottom: 32px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* ---- Footer ---- */
.site-footer {
    background: var(--dark);
    color: var(--gray-300);
    padding: 60px 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-brand h3 {
    font-size: 1.25rem;
    color: var(--white);
    margin-bottom: 12px;
}

.footer-brand p {
    font-size: 0.875rem;
    line-height: 1.7;
    margin-bottom: 20px;
}

.footer-social {
    display: flex;
    gap: 12px;
}

.footer-social a {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    color: var(--gray-300);
    transition: all var(--transition);
}

.footer-social a:hover {
    background: var(--primary);
    color: var(--white);
}

.footer-links h4,
.footer-contact h4 {
    font-size: 0.9375rem;
    color: var(--white);
    margin-bottom: 16px;
}

.footer-menu {
    list-style: none;
}

.footer-menu li { margin-bottom: 8px; }

.footer-menu li a {
    color: var(--gray-300);
    font-size: 0.875rem;
    transition: color var(--transition);
}

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

.footer-contact p {
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 12px;
}

.footer-email { color: var(--primary); font-weight: 500; }

.footer-bottom {
    padding: 24px 0;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--gray-500);
}

/* ---- Account Page ---- */
.account-container { max-width: 800px; margin: 0 auto; }

.account-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 40px;
    padding: 32px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
}

.account-avatar img {
    border-radius: 50%;
    width: 80px;
    height: 80px;
}

.account-header h1 { font-size: 1.5rem; }

.account-email { color: var(--gray-500); font-size: 0.9375rem; }

.account-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

.account-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
}

.account-card h3 {
    font-size: 1.125rem;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--gray-100);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-50);
}

.detail-row:last-child { border-bottom: none; }

.detail-label { font-size: 0.875rem; color: var(--gray-500); }
.detail-value { font-size: 0.875rem; font-weight: 600; color: var(--gray-900); }

.account-actions { display: flex; flex-direction: column; gap: 12px; }

/* ---- 404 Page ---- */
.error-404 {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
}

.error-code {
    display: block;
    font-size: 8rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 8px;
    opacity: 0.3;
}

.error-404 h1 { font-size: 2rem; margin-bottom: 12px; }

.error-404 p {
    color: var(--gray-500);
    margin-bottom: 32px;
    font-size: 1.125rem;
}

/* ---- Entry (Posts) ---- */
.entry { margin-bottom: 40px; }

.entry-title {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.entry-title a { color: var(--dark); }
.entry-title a:hover { color: var(--primary); }

.entry-meta {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-bottom: 16px;
}

.entry-content { color: var(--gray-700); line-height: 1.7; }

.page-title {
    font-size: 2rem;
    margin-bottom: 24px;
}

/* ---- Pagination ---- */
.pagination { margin-top: 40px; text-align: center; }

.pagination .page-numbers {
    display: inline-block;
    padding: 8px 16px;
    margin: 0 2px;
    border-radius: var(--radius);
    border: 2px solid var(--gray-200);
    color: var(--gray-700);
    font-weight: 500;
    font-size: 0.875rem;
    transition: all var(--transition);
}

.pagination .page-numbers:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.pagination .page-numbers.current {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

/* ---- Mobile Responsive ---- */
@media (max-width: 1024px) {
    .features-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
    .video-content { grid-template-columns: 1fr; }
    .account-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .site-header { position: static; }
    .header-inner { display: flex; flex-direction: row; align-items: center; gap: 8px; height: auto; padding: 12px 0; justify-content: space-between; }
    .site-branding { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
    .site-title { font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
    .site-logo { max-width: 140px; }
    .header-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
    .hero-content h1 { font-size: 2.25rem; }
    .hero-subtitle { font-size: 1.0625rem; }
    .hero-stats { gap: 32px; }
    .stat-number { font-size: 1.75rem; }

    .header-actions .user-greeting { display: none; }

    .video-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
    .subjects-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
    .features-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }

    .videos-header { flex-direction: column; align-items: flex-start; }
    .video-filters { width: 100%; }
    .video-filters .filter-select { flex: 1; }

    .auth-card { padding: 24px; }

    .section { padding: 48px 0; }
    .section-header h2 { font-size: 1.5rem; }

    .cta-card { padding: 40px 24px; }
    .cta-card h2 { font-size: 1.5rem; }
}

@media (max-width: 480px) {
    .hero-content h1 { font-size: 1.75rem; }
    .hero-actions { flex-direction: column; align-items: center; }
    .hero-stats { flex-direction: column; gap: 16px; }
    .video-grid { grid-template-columns: 1fr; }
    .auth-card { padding: 20px; }
}

/* ---- Search Bar (Apple/Neumorphic) ---- */
.search-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    width: min(85vw, 560px);
    padding: 0;
}

.search-bar-inner {
    display: flex;
    align-items: center;
    width: 100%;
    height: 58px;
    background: var(--search-color, #6E7FF8);
    border-radius: 9999px;
    padding: 0 6px;
    box-shadow:
        rgba(255,255,255,0.25) -4px -4px 10px,
        rgba(0,0,0,0.16) 6px 6px 14px;
    overflow: hidden;
    transition: box-shadow 300ms ease, background 300ms ease;
    box-sizing: border-box;
}

.search-bar-inner .search-input {
    flex: 1;
    height: calc(100% - 12px);
    margin: 0 6px;
    padding: 0 18px;
    background: #fff;
    border: none;
    border-radius: 9999px;
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Poppins', 'SF Pro Display', sans-serif;
    font-size: 18px;
    font-weight: 500;
    color: #1e293b;
    caret-color: var(--search-color, #6E7FF8);
    outline: none;
    box-sizing: border-box;
}

.search-bar-inner .search-input::placeholder {
    color: #5D72C5;
    font-weight: 400;
    font-size: 18px;
}

.search-bar-inner .search-input::-webkit-input-placeholder { color: #5D72C5; }
.search-bar-inner .search-input:-moz-placeholder { color: #5D72C5; }
.search-bar-inner .search-input::-moz-placeholder { color: #5D72C5; }

.search-btn {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    margin-right: 1px;
    border: none;
    border-radius: 50%;
    background: var(--search-color, #6E7FF8);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 300ms ease, box-shadow 300ms ease;
    box-shadow:
        rgba(255,255,255,0.3) -2px -2px 5px inset,
        rgba(0,0,0,0.12) 2px 2px 6px;
    position: relative;
}

.search-btn::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    right: 50%;
    bottom: 50%;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    pointer-events: none;
}

.search-btn:hover {
    transform: scale(1.05);
    box-shadow:
        rgba(255,255,255,0.35) -2px -2px 5px inset,
        rgba(0,0,0,0.18) 4px 4px 10px;
}

.search-btn:hover .search-icon {
    transform: rotate(10deg);
}

.search-btn:active {
    transform: scale(0.97);
    box-shadow:
        rgba(0,0,0,0.12) 2px 2px 6px inset,
        rgba(255,255,255,0.1) -1px -1px 3px inset;
}

.search-btn:active .search-icon {
    transform: rotate(0deg);
}

.search-icon {
    width: 28px;
    height: 28px;
    stroke: #fff;
    stroke-width: 2.5;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 300ms ease;
}

/* ---- Contact Page Social Links ---- */
.contact-social {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 24px 0;
}

.contact-social-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform 200ms ease, box-shadow 200ms ease;
    color: #fff;
}

.contact-social-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.contact-social-link.youtube { background: #FF0000; }
.contact-social-link.facebook { background: #1877F2; }
.contact-social-link.instagram {
    background: linear-gradient(135deg, #833AB4, #FD1D1D, #FCAF45);
}

/* Responsive */
@media (max-width: 600px) {
    .search-bar-inner {
        height: 50px;
        padding: 0 5px;
    }
    .search-bar-inner .search-input {
        font-size: 15px;
        padding: 0 14px;
    }
    .search-bar-inner .search-input::placeholder {
        font-size: 15px;
    }
    .search-btn {
        width: 42px;
        height: 42px;
    }
    .search-icon {
        width: 22px;
        height: 22px;
    }
}

/* =============================================
   ADDITIONAL RESPONSIVE BREAKPOINTS
   ============================================= */
@media (max-width: 1024px) {
    .hero-content h1 { font-size: 2.5rem; }
    .subjects-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
    .video-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
    .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 32px; }
    .subject-banner { flex-direction: column; align-items: flex-start !important; }
    .subject-banner .video-count-badge { align-self: flex-start; }
}

@media (max-width: 480px) {
    .hero-content h1 { font-size: 1.75rem; }
    .hero-actions { flex-direction: column; align-items: center; width: 100%; }
    .hero-actions .btn { width: 100%; max-width: 100%; text-align: center; }
    .hero-stats { flex-direction: column; gap: 16px; align-items: center; }
    .hero-actions { margin-bottom: 32px; }
    .video-grid { grid-template-columns: 1fr; }
    .subjects-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .auth-card { padding: 20px; }
    .header-inner { padding: 10px 0; gap: 6px; }
    .site-title { font-size: 0.85rem; max-width: 85vw; }
    .site-logo { max-width: 120px; }
    .header-actions .btn { padding: 6px 10px; font-size: 0.75rem; }
    .header-actions { gap: 4px; }
    .video-thumb img { height: auto; aspect-ratio: 16/9; object-fit: cover; }
    .video-card .video-info h3 { font-size: 0.95rem; }
    .subject-card { padding: 16px 12px; }
    .subject-placeholder { width: 48px; height: 48px; }
    .subject-placeholder .subject-initial { font-size: 1.25rem; }
    .pagination .page-numbers { padding: 6px 10px; font-size: 0.85rem; }
    .archive-header { padding: 32px 0; }
    .archive-header h1 { font-size: 1.5rem; }
}

@media (max-width: 360px) {
    .subjects-grid {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 10px;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        padding-bottom: 4px;
    }
    .subjects-grid .subject-card {
        flex: 0 0 120px;
        scroll-snap-align: start;
        padding: 12px 8px;
    }
    .subjects-grid .subject-placeholder { width: 40px; height: 40px; }
    .subjects-grid .subject-initial { font-size: 1rem; }
    .subjects-grid .subject-card h3 { font-size: 0.8rem; }
    .subjects-grid .video-count { font-size: 0.7rem; }
    .search-bar { width: min(95vw, 100%); }
    .search-bar-inner .search-input { font-size: 15px; padding: 0 12px; }
    .search-bar-inner .search-input::placeholder { font-size: 15px; }
    .search-btn { width: 42px; height: 42px; }
    .search-icon { width: 22px; height: 22px; }
}

/* Improve touch targets on mobile */
@media (pointer: coarse) {
    .nav-menu li a, .btn, .search-btn, button, input[type="submit"] {
        min-height: 44px;
    }
    .subject-card, .video-card { cursor: pointer; }
}
