/* ==================== Community Pages — YouTube Dark Mode ==================== */
.community-page {
    background: #0f0f0f;
    min-height: 100vh;
    color: #f1f1f1;
}

.community-page a { text-decoration: none; color: inherit; }
.community-page ul { list-style: none; }

/* ==================== Nav ==================== */
.community-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: #0f0f0f;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    display: flex;
    align-items: center;
}

.community-nav-inner {
    max-width: 1284px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.community-nav-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.community-nav-brand img { height: 28px; width: auto; }

.community-nav-separator {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
}

.community-nav-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: #f1f1f1;
    transition: color 0.15s;
}

.community-nav-title:hover { color: #3ea6ff; }

/* Breadcrumb */
.community-nav-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    justify-content: center;
    min-width: 0;
}

.community-nav-breadcrumb a {
    color: #aaaaaa;
    font-size: 0.8rem;
    white-space: nowrap;
    transition: color 0.15s;
}

.community-nav-breadcrumb a:hover { color: #f1f1f1; }

.community-nav-breadcrumb .breadcrumb-sep {
    color: #717171;
    font-size: 0.6rem;
}

.community-nav-breadcrumb .breadcrumb-current {
    color: #f1f1f1;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

/* Create Button (nav) */
.nav-create-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #272727;
    border: none;
    color: #f1f1f1;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.15s;
    flex-shrink: 0;
    display: none;
    align-items: center;
    justify-content: center;
}

body.is-admin .nav-create-btn { display: flex; }
.nav-create-btn:hover { background: #3f3f3f; }

/* ==================== Create Modal ==================== */
.create-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.create-modal-overlay.active { display: flex; }

.create-modal {
    background: #212121;
    border-radius: 16px;
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.create-modal::-webkit-scrollbar { width: 4px; }
.create-modal::-webkit-scrollbar-track { background: transparent; }
.create-modal::-webkit-scrollbar-thumb { background: #3f3f3f; border-radius: 4px; }

.create-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    background: #212121;
    z-index: 1;
    border-radius: 16px 16px 0 0;
}

.create-modal-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #f1f1f1;
    margin: 0;
}

.create-modal-close {
    background: none;
    border: none;
    color: #717171;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: background 0.15s;
}

.create-modal-close:hover { background: #3f3f3f; color: #f1f1f1; }

.create-modal-body {
    padding: 24px;
}

/* Step 1: Choose type */
.create-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.create-option-card {
    background: #181818;
    border: 2px solid #303030;
    border-radius: 12px;
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
}

.create-option-card:hover {
    border-color: #3ea6ff;
    background: #1a2a3a;
}

.create-option-card i {
    font-size: 2rem;
    color: #3ea6ff;
    margin-bottom: 12px;
    display: block;
}

.create-option-card h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #f1f1f1;
    margin: 0 0 4px;
}

.create-option-card p {
    font-size: 0.75rem;
    color: #717171;
    margin: 0;
}

/* Form sections */
.create-form-section {
    margin-bottom: 24px;
}

.create-form-section h3 {
    font-size: 0.85rem;
    font-weight: 600;
    color: #aaaaaa;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.create-form-section h3 i {
    font-size: 0.8rem;
}

.create-yt-preview {
    margin-top: 8px;
    border-radius: 8px;
    overflow: hidden;
    display: none;
}

.create-yt-preview img {
    width: 100%;
    border-radius: 8px;
}

/* New module inline toggle */
.create-new-module-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #3ea6ff;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    margin-top: 8px;
    background: none;
    border: none;
    font-family: 'Inter', sans-serif;
    padding: 4px 0;
}

.create-new-module-toggle:hover { opacity: 0.8; }

.create-new-module-fields {
    display: none;
    margin-top: 8px;
    padding: 12px;
    background: #181818;
    border-radius: 8px;
}

.create-new-module-fields.active { display: block; }

/* Materials list in create form */
.create-materials-list {
    margin-bottom: 12px;
}

.create-material-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #181818;
    border-radius: 8px;
    margin-bottom: 6px;
}

.create-material-item .material-icon {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

.create-material-item-info {
    flex: 1;
    min-width: 0;
}

.create-material-item-info h5 {
    font-size: 0.8rem;
    font-weight: 500;
    color: #f1f1f1;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.create-material-item-info span {
    font-size: 0.7rem;
    color: #717171;
}

.create-material-remove {
    background: none;
    border: none;
    color: #717171;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.15s;
}

.create-material-remove:hover { color: #ff4444; }

.create-add-material-btn {
    background: transparent;
    border: 1px dashed #3f3f3f;
    border-radius: 8px;
    color: #717171;
    font-size: 0.8rem;
    padding: 10px;
    width: 100%;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.15s;
}

.create-add-material-btn:hover {
    border-color: #3ea6ff;
    color: #3ea6ff;
}

.create-material-form {
    display: none;
    padding: 12px;
    background: #181818;
    border-radius: 8px;
    margin-top: 8px;
}

.create-material-form.active { display: block; }

/* Publish button */
.create-publish-row {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-publish {
    background: #3ea6ff;
    color: #0f0f0f;
    border: none;
    border-radius: 20px;
    padding: 10px 24px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: opacity 0.15s;
}

.btn-publish:hover { opacity: 0.9; }
.btn-publish:disabled { opacity: 0.3; cursor: not-allowed; }

/* Upload Progress */
.upload-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0;
}

.upload-progress-track {
    flex: 1;
    height: 6px;
    background: #3f3f3f;
    border-radius: 3px;
    overflow: hidden;
}

.upload-progress-bar {
    width: 0%;
    height: 100%;
    background: #3ea6ff;
    border-radius: 3px;
    transition: width 0.2s;
}

.upload-progress-text {
    color: #aaaaaa;
    font-size: 0.75rem;
    min-width: 35px;
    text-align: right;
}

/* Material type: file */
.material-icon.file { background: #2a2a1a; color: #ffa726; }

.material-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #ffa726;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 4px 10px;
    background: rgba(255, 167, 38, 0.1);
    border-radius: 12px;
    transition: background 0.15s;
}

.material-download-btn:hover {
    background: rgba(255, 167, 38, 0.2);
    text-decoration: none;
}

/* Create modal responsive */
@media (max-width: 768px) {
    .create-modal-overlay { padding: 0; }
    .create-modal {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
        height: 100vh;
    }
    .create-modal-header { border-radius: 0; }
    .create-modal-body { padding: 16px; }
    .create-options { grid-template-columns: 1fr; gap: 12px; }
    .create-option-card { padding: 24px 16px; }
}

/* Search Bar */
.community-nav-search {
    flex: 1;
    max-width: 540px;
    margin: 0 16px;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    height: 40px;
    background: #121212;
    border: 1px solid #303030;
    border-radius: 20px 0 0 20px;
    color: #f1f1f1;
    padding: 0 16px;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.search-input:focus {
    border-color: #3ea6ff;
}

.search-input::placeholder { color: #717171; }

.search-btn {
    height: 40px;
    width: 56px;
    background: #222222;
    border: 1px solid #303030;
    border-left: none;
    border-radius: 0 20px 20px 0;
    color: #f1f1f1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
    transition: background 0.15s;
}

.search-btn:hover { background: #3a3a3a; }

.search-suggestions {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #212121;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    z-index: 1100;
    display: none;
    max-height: 400px;
    overflow-y: auto;
    padding: 8px 0;
}

.search-suggestions.active { display: block; }

.search-suggestion-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    cursor: pointer;
    transition: background 0.15s;
}

.search-suggestion-item:hover { background: #303030; }

.search-suggestion-item i.fa-search {
    color: #717171;
    font-size: 0.85rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.search-suggestion-thumb {
    width: 60px;
    min-width: 60px;
    aspect-ratio: 16/9;
    border-radius: 4px;
    overflow: hidden;
    background: #181818;
}

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

.search-suggestion-info {
    flex: 1;
    min-width: 0;
}

.search-suggestion-info h4 {
    font-size: 0.85rem;
    font-weight: 500;
    color: #f1f1f1;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-suggestion-info span {
    font-size: 0.7rem;
    color: #717171;
}

.search-no-results {
    padding: 16px;
    text-align: center;
    color: #717171;
    font-size: 0.85rem;
}

/* Search toggle mobile (icon button) */
.search-toggle-mobile {
    display: none;
    background: none;
    border: none;
    color: #f1f1f1;
    padding: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.15s;
    flex-shrink: 0;
}

.search-toggle-mobile:hover { background: #272727; }

/* Mobile search overlay */
.search-overlay-mobile {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #0f0f0f;
    z-index: 1200;
    flex-direction: column;
}

.search-overlay-mobile.active {
    display: flex;
}

.search-overlay-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    height: 56px;
    box-sizing: border-box;
}

.search-overlay-back {
    background: none;
    border: none;
    color: #f1f1f1;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.search-overlay-bar .search-input {
    border-radius: 20px;
    border: 1px solid #303030;
    height: 36px;
    font-size: 0.85rem;
}

.search-suggestions-mobile {
    position: static;
    border-radius: 0;
    box-shadow: none;
    max-height: none;
    flex: 1;
    overflow-y: auto;
    display: block;
    background: #0f0f0f;
}

/* User */
.community-nav-user {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.nav-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.nav-user-name {
    font-size: 0.8rem;
    color: #aaaaaa;
    font-weight: 400;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-admin-badge {
    background: #263850;
    color: #3ea6ff;
    font-size: 0.6rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-btn-logout {
    background: none;
    border: none;
    color: #aaaaaa;
    font-size: 0.8rem;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    padding: 6px 10px;
    border-radius: 18px;
    transition: background 0.15s;
}

.nav-btn-logout:hover { background: #272727; color: #f1f1f1; }


/* Hamburger */
.community-nav-hamburger {
    display: none;
    background: none;
    border: none;
    color: #f1f1f1;
    padding: 8px;
    font-size: 1.2rem;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.15s;
}

.community-nav-hamburger:hover { background: #272727; }

/* Mobile menu */
.community-nav-mobile {
    display: none;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    background: #0f0f0f;
    z-index: 999;
    padding: 16px;
    overflow-y: auto;
}

.community-nav-mobile.active { display: block; }

.mobile-menu-section { margin-bottom: 16px; }

.mobile-menu-section h4 {
    color: #717171;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
    padding: 0 12px;
}

.mobile-menu-section a {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #f1f1f1;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: background 0.15s;
}

.mobile-menu-section a:hover,
.mobile-menu-section a.active { background: #272727; }

.mobile-menu-section a i { width: 20px; text-align: center; color: #aaaaaa; }

.mobile-menu-user {
    padding: 12px;
    background: #272727;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.mobile-menu-user img { width: 36px; height: 36px; border-radius: 50%; }
.mobile-menu-user-info { flex: 1; }
.mobile-menu-user-info strong { display: block; color: #f1f1f1; font-size: 0.85rem; }
.mobile-menu-user-info span { color: #717171; font-size: 0.75rem; }

/* ==================== Container ==================== */
.yt-container {
    max-width: 1284px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ==================== Homepage: Module Shelves ==================== */
.community-content {
    padding: 72px 0 40px;
    background: #0f0f0f;
}

/* Legacy shelf styles (kept for admin/search contexts) */
.module-shelf {
    margin-bottom: 40px;
    position: relative;
}

.module-shelf .admin-controls {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 10;
}

.module-shelf-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding: 0 4px;
}

.module-shelf-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #f1f1f1;
    margin: 0;
}

.module-shelf-header a {
    color: #3ea6ff;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: opacity 0.15s;
}

.module-shelf-header a:hover { opacity: 0.8; }

.shelf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

/* ==================== Community Hero ==================== */
.community-hero {
    margin-bottom: 32px;
    padding: 32px 0 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.community-hero h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #f1f1f1;
    margin: 0 0 8px;
}

.community-hero p {
    color: #aaaaaa;
    font-size: 0.95rem;
    margin: 0;
    line-height: 1.5;
}

/* ==================== Module Cards Grid ==================== */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

.module-card {
    background: #181818;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.module-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.module-card .admin-controls {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
}

/* Module Card Cover */
.module-card-cover {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #272727;
}

.module-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.module-card:hover .module-card-cover img {
    transform: scale(1.05);
}

.module-card-cover-empty {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.module-card-cover-empty i {
    font-size: 2.5rem;
    color: rgba(255, 255, 255, 0.15);
}

.module-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px 16px 12px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
}

.module-card-number {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #3ea6ff;
    color: #0f0f0f;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.module-card-count {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.module-card-count i {
    font-size: 0.75rem;
}

/* Module Card Body */
.module-card-body {
    padding: 16px;
}

.module-card-body h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: #f1f1f1;
    margin: 0 0 6px;
    line-height: 1.3;
}

.module-card-body p {
    font-size: 0.85rem;
    color: #aaaaaa;
    margin: 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


/* ==================== Lesson List (Module Detail Page) ==================== */
.lesson-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lesson-list-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: #181818;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
    position: relative;
}

.lesson-list-item:hover {
    background: #222222;
}

.lesson-list-item:first-child {
    border-radius: 12px 12px 8px 8px;
}

.lesson-list-item:last-child {
    border-radius: 8px 8px 12px 12px;
}

.lesson-list-item:only-child {
    border-radius: 12px;
}

.lesson-list-item .admin-controls {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.15s;
}

.lesson-list-item:hover .admin-controls {
    opacity: 1;
}

.lesson-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #272727;
    color: #aaaaaa;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.lesson-thumb {
    width: 120px;
    min-width: 120px;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    overflow: hidden;
    background: #272727;
    position: relative;
}

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

.lesson-thumb .play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.2s;
}

.lesson-list-item:hover .lesson-thumb .play-overlay {
    opacity: 1;
}

.lesson-thumb .play-overlay i {
    color: #fff;
    font-size: 1.2rem;
}

.lesson-list-item .lesson-info {
    flex: 1;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: none;
}

.lesson-list-item .lesson-info h4 {
    font-size: 0.95rem;
    font-weight: 500;
    color: #f1f1f1;
    margin: 0 0 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lesson-list-item .lesson-info .lesson-meta {
    font-size: 0.8rem;
    color: #717171;
}

.lesson-arrow {
    color: #717171;
    font-size: 0.85rem;
    flex-shrink: 0;
    transition: color 0.15s;
}

.lesson-list-item:hover .lesson-arrow {
    color: #aaaaaa;
}

/* Module Detail Header Enhanced */
.module-detail-header {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    margin-bottom: 32px;
}

.module-detail-cover {
    width: 280px;
    min-width: 280px;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    background: #272727;
}

.module-detail-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.module-detail-cover-empty {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.module-detail-cover-empty i {
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.15);
}

.module-detail-info {
    flex: 1;
    min-width: 0;
}

.module-detail-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #3ea6ff;
    background: rgba(62, 166, 255, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.module-detail-info h1 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #f1f1f1;
    margin: 0 0 8px;
}

.module-detail-info p {
    color: #aaaaaa;
    font-size: 0.9rem;
    line-height: 1.5;
    max-width: 700px;
    margin: 0 0 12px;
}

.module-detail-count {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #717171;
}

.module-detail-count i {
    font-size: 0.8rem;
}

/* ==================== YouTube Video Card (vertical) ==================== */
.yt-video-card {
    cursor: pointer;
    border-radius: 0;
    background: transparent;
    transition: opacity 0.15s;
    position: relative;
}

.yt-video-card:hover { opacity: 0.85; }

.yt-video-card .admin-controls {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
}

.yt-video-card-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 12px;
    overflow: hidden;
    background: #181818;
    position: relative;
    margin-bottom: 12px;
}

.yt-video-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.yt-video-card-thumb .play-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s;
}

.yt-video-card:hover .play-overlay { opacity: 1; }
.play-overlay i { color: #fff; font-size: 1.2rem; }

.yt-video-card-info { padding: 0 4px; }

.yt-video-card-info h4 {
    font-size: 0.95rem;
    font-weight: 500;
    color: #f1f1f1;
    margin: 0 0 4px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.yt-video-card-info .yt-card-meta {
    font-size: 0.8rem;
    color: #aaaaaa;
}

.yt-video-card-info p {
    font-size: 0.75rem;
    color: #aaaaaa;
    margin: 2px 0 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

/* ==================== Module Detail Page ==================== */
.module-content {
    padding: 72px 0 40px;
    background: #0f0f0f;
}

.module-header-bar {
    margin-bottom: 24px;
}

.module-header-bar h1 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #f1f1f1;
    margin: 8px 0;
}

.module-header-bar p {
    color: #aaaaaa;
    font-size: 0.9rem;
    line-height: 1.5;
    max-width: 700px;
    margin: 0;
}

.module-lessons-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.module-lessons-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #f1f1f1;
}

/* ==================== Back Link ==================== */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #3ea6ff;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 8px;
    padding: 6px 0;
    transition: opacity 0.15s;
}

.back-link:hover { opacity: 0.8; }
.back-link i { font-size: 0.75rem; }

/* ==================== Watch Page (Lesson Detail) ==================== */
.watch-page {
    padding: 72px 0 40px;
    background: #0f0f0f;
}

.watch-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.watch-primary {
    flex: 1;
    min-width: 0;
}

.watch-secondary {
    width: 402px;
    flex-shrink: 0;
    position: sticky;
    top: 72px;
    max-height: calc(100vh - 88px);
    overflow-y: auto;
}

/* Hide scrollbar on sidebar */
.watch-secondary::-webkit-scrollbar { width: 4px; }
.watch-secondary::-webkit-scrollbar-track { background: transparent; }
.watch-secondary::-webkit-scrollbar-thumb { background: #3f3f3f; border-radius: 4px; }

/* Video Player */
.lesson-video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    background: #000;
}

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

.video-lazy-thumb {
    position: absolute;
    inset: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
    background-color: #000;
}

.video-lazy-thumb .play-btn-large {
    width: 68px;
    height: 48px;
    background: rgba(255, 0, 0, 0.9);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s, opacity 0.15s;
}

.video-lazy-thumb:hover .play-btn-large {
    opacity: 0.85;
    transform: scale(1.05);
}

.play-btn-large i {
    color: #fff;
    font-size: 1.4rem;
    margin-left: 3px;
}

.resume-hint {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 4px;
    font-family: 'Inter', sans-serif;
}

/* Lesson Info */
.lesson-info {
    margin: 16px 0;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.lesson-info h1 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #f1f1f1;
    margin-bottom: 8px;
    line-height: 1.4;
}

.lesson-info p {
    color: #aaaaaa;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ==================== Playlist Sidebar ==================== */
.playlist-sidebar {
    background: #181818;
    border-radius: 12px;
    overflow: hidden;
}

.playlist-sidebar-header {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.playlist-sidebar-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #f1f1f1;
    margin: 0 0 4px;
}

.playlist-sidebar-header p {
    font-size: 0.8rem;
    color: #aaaaaa;
    margin: 0;
}

.playlist-sidebar-items {
    padding: 8px 0;
}

.playlist-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.15s;
}

.playlist-item:hover { background: #272727; }

.playlist-item.active {
    background: rgba(255, 255, 255, 0.1);
}

.playlist-item-num {
    font-size: 0.75rem;
    color: #717171;
    min-width: 24px;
    text-align: center;
    padding-top: 6px;
    flex-shrink: 0;
}

.playlist-item.active .playlist-item-num {
    color: #3ea6ff;
}

.playlist-item-thumb {
    width: 100px;
    min-width: 100px;
    aspect-ratio: 16/9;
    border-radius: 6px;
    overflow: hidden;
    background: #272727;
}

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

.playlist-item-info {
    flex: 1;
    min-width: 0;
    padding-top: 2px;
}

.playlist-item-info h4 {
    font-size: 0.8rem;
    font-weight: 500;
    color: #f1f1f1;
    margin: 0 0 2px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.playlist-item-info span {
    font-size: 0.7rem;
    color: #717171;
}

/* ==================== Materials ==================== */
.materials-section {
    margin-top: 16px;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.materials-section h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #f1f1f1;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.materials-section h4 i { color: #aaaaaa; font-size: 0.85rem; }

.material-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 4px;
    transition: background 0.15s;
}

.material-item:hover { background: #272727; }

.material-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.material-icon.link { background: #263850; color: #3ea6ff; }
.material-icon.text { background: #1b3a2a; color: #4caf50; }
.material-icon.document { background: #3a1b2e; color: #e91e63; }

.material-info { flex: 1; min-width: 0; }
.material-info h5 { font-size: 0.85rem; font-weight: 500; color: #f1f1f1; margin: 0; }
.material-info p { font-size: 0.75rem; color: #717171; margin: 2px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.material-item a { color: #3ea6ff; font-size: 0.75rem; font-weight: 500; }
.material-item a:hover { text-decoration: underline; }

.material-text-content {
    color: #aaaaaa;
    font-size: 0.85rem;
    line-height: 1.5;
    padding: 10px 12px;
    background: #1a1a1a;
    border-radius: 8px;
    margin-top: 6px;
}

/* ==================== Comments ==================== */
.comments-section {
    margin-top: 24px;
    padding-top: 16px;
}

.comments-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.comments-header h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #f1f1f1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.comments-header h4 i { color: #aaaaaa; }

.comment-count-badge {
    color: #aaaaaa;
    font-size: 0.85rem;
    font-weight: 400;
}

.comment-login-prompt {
    text-align: center;
    padding: 24px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.comment-login-prompt p {
    color: #aaaaaa;
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.btn-google {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid #3ea6ff;
    color: #3ea6ff;
    border-radius: 18px;
    padding: 8px 20px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: background 0.15s;
}

.btn-google:hover { background: rgba(62, 166, 255, 0.1); }

.comment-input-wrapper { display: flex; gap: 12px; margin-bottom: 24px; }

.comment-input-avatar {
    width: 40px; height: 40px; min-width: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.comment-input-form { flex: 1; }

.comment-textarea {
    width: 100%;
    min-height: 44px;
    background: transparent;
    border: none;
    border-bottom: 1px solid #717171;
    color: #f1f1f1;
    padding: 8px 0;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    resize: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.comment-textarea:focus {
    outline: none;
    border-bottom: 2px solid #3ea6ff;
}

.comment-textarea::placeholder { color: #717171; }

.comment-submit-row { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

.btn-comment-submit {
    background: #3ea6ff;
    color: #0f0f0f;
    border: none;
    border-radius: 18px;
    padding: 8px 16px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: opacity 0.15s;
}

.btn-comment-submit:hover { opacity: 0.9; }
.btn-comment-submit:disabled { opacity: 0.3; cursor: not-allowed; }

.btn-comment-cancel {
    background: transparent;
    color: #aaaaaa;
    border: none;
    border-radius: 18px;
    padding: 8px 16px;
    font-size: 0.8rem;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: background 0.15s;
}

.btn-comment-cancel:hover { background: #272727; }

.comment-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
}

.comment-avatar { width: 40px; height: 40px; min-width: 40px; border-radius: 50%; object-fit: cover; }
.comment-body { flex: 1; min-width: 0; }

.comment-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.comment-author { font-size: 0.8rem; font-weight: 600; color: #f1f1f1; }
.comment-time { font-size: 0.75rem; color: #717171; }
.comment-text { font-size: 0.9rem; color: #f1f1f1; line-height: 1.4; word-break: break-word; }

.comment-actions { display: flex; gap: 8px; margin-top: 4px; }

.comment-action-btn {
    background: none;
    border: none;
    color: #717171;
    font-size: 0.75rem;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    padding: 4px 8px;
    border-radius: 12px;
    transition: background 0.15s;
}

.comment-action-btn:hover { background: #272727; color: #f1f1f1; }
.comment-action-btn.delete:hover { color: #ff4444; }

/* Comments Preview (collapsed state) */
.comments-preview-toggle {
    cursor: pointer;
    padding: 12px;
    border-radius: 12px;
    background: #181818;
    transition: background 0.15s;
}

.comments-preview-toggle:hover { background: #212121; }

.comments-preview-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.comments-preview-text {
    font-size: 0.85rem;
    color: #aaaaaa;
    margin: 0;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.comments-preview-text strong {
    color: #f1f1f1;
    font-weight: 500;
    margin-right: 4px;
}

/* Load More Comments Button */
.comments-load-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    background: transparent;
    border: none;
    color: #3ea6ff;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    border-radius: 8px;
    transition: background 0.15s;
    margin-top: 4px;
}

.comments-load-more:hover { background: rgba(62, 166, 255, 0.1); }
.comments-load-more i { font-size: 0.7rem; }

/* Comment Login Inline */
.comment-login-inline {
    margin-top: 8px;
}

.comment-replies { margin-left: 52px; }
.comment-replies .comment-item { padding: 8px 0; }
.comment-replies .comment-avatar { width: 24px; height: 24px; min-width: 24px; }

.reply-input-wrapper { margin-left: 52px; margin-top: 4px; }

/* ==================== Admin Controls ==================== */
.admin-controls { display: none; }

body.is-admin .admin-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.admin-btn {
    background: #272727;
    border: none;
    border-radius: 6px;
    color: #aaaaaa;
    cursor: pointer;
    font-size: 0.75rem;
    padding: 6px 10px;
    font-family: 'Inter', sans-serif;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.admin-btn:hover { background: #3f3f3f; color: #f1f1f1; }

.admin-btn.danger { color: #717171; }
.admin-btn.danger:hover { background: #3a1a1a; color: #ff4444; }
.admin-btn i { margin-right: 3px; }

.order-arrows { display: flex; flex-direction: column; gap: 1px; }

.order-arrow {
    background: #272727;
    border: none;
    border-radius: 4px;
    color: #717171;
    cursor: pointer;
    font-size: 0.6rem;
    padding: 3px 6px;
    transition: background 0.15s;
}

.order-arrow:hover:not(:disabled) { background: #3f3f3f; color: #f1f1f1; }
.order-arrow:disabled { opacity: 0.2; cursor: not-allowed; }

.admin-add-btn {
    display: none;
    width: 100%;
    padding: 14px;
    background: transparent;
    border: 1px dashed #3f3f3f;
    border-radius: 8px;
    color: #717171;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.15s;
    margin-top: 12px;
}

body.is-admin .admin-add-btn { display: block; }
.admin-add-btn:hover { border-color: #3ea6ff; color: #3ea6ff; }
.admin-add-btn i { margin-right: 6px; }

/* Admin Forms */
.admin-form {
    background: #1a1a1a;
    border: 1px solid #3f3f3f;
    border-radius: 12px;
    padding: 20px;
    margin-top: 12px;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.admin-form h4 { color: #f1f1f1; font-size: 0.95rem; font-weight: 600; margin-bottom: 14px; }
.admin-form-group { margin-bottom: 12px; }
.admin-form-group label { display: block; font-size: 0.75rem; font-weight: 500; color: #aaaaaa; margin-bottom: 4px; }

.admin-input {
    width: 100%;
    background: #272727;
    border: 1px solid #3f3f3f;
    border-radius: 8px;
    color: #f1f1f1;
    padding: 10px 12px;
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.admin-input:focus { outline: none; border-color: #3ea6ff; }
.admin-input::placeholder { color: #717171; }

.admin-select {
    width: 100%;
    background: #272727;
    border: 1px solid #3f3f3f;
    border-radius: 8px;
    color: #f1f1f1;
    padding: 10px 12px;
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    appearance: none;
}

.admin-select option { background: #272727; color: #f1f1f1; }

.admin-textarea {
    width: 100%;
    min-height: 70px;
    background: #272727;
    border: 1px solid #3f3f3f;
    border-radius: 8px;
    color: #f1f1f1;
    padding: 10px 12px;
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
    resize: vertical;
    box-sizing: border-box;
}

.admin-textarea:focus { outline: none; border-color: #3ea6ff; }

.admin-form-actions { display: flex; gap: 8px; margin-top: 14px; }

.admin-form-actions .btn-save {
    background: #3ea6ff;
    color: #0f0f0f;
    border: none;
    border-radius: 18px;
    padding: 8px 20px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: opacity 0.15s;
}

.admin-form-actions .btn-save:hover { opacity: 0.9; }

.admin-form-actions .btn-cancel {
    background: transparent;
    color: #aaaaaa;
    border: none;
    border-radius: 18px;
    padding: 8px 16px;
    font-size: 0.8rem;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
}

.admin-form-actions .btn-cancel:hover { background: #272727; }

.yt-preview { margin-top: 8px; border-radius: 8px; overflow: hidden; display: none; }
.yt-preview img { width: 100%; border-radius: 8px; }

/* Cover Upload */
.cover-upload-area {
    border: 2px dashed #3f3f3f;
    border-radius: 10px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #717171;
}

.cover-upload-area:hover {
    border-color: #3ea6ff;
    background: rgba(62, 166, 255, 0.05);
    color: #3ea6ff;
}

.cover-upload-area i {
    font-size: 1.5rem;
}

.cover-upload-area span {
    font-size: 0.85rem;
}

.cover-preview-container {
    margin-top: 8px;
}

.cover-preview {
    position: relative;
    display: inline-block;
    border-radius: 10px;
    overflow: hidden;
    max-width: 280px;
}

.cover-preview img {
    width: 100%;
    display: block;
    border-radius: 10px;
}

.cover-preview-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    transition: background 0.15s;
}

.cover-preview-remove:hover {
    background: #ff4444;
}

/* ==================== Admin Login Modal ==================== */
.admin-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.admin-modal-overlay.active { display: flex; }

.admin-modal {
    background: #272727;
    border-radius: 12px;
    padding: 32px 24px;
    max-width: 380px;
    width: 100%;
    position: relative;
}

.admin-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: #717171;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px;
}

.admin-modal-close:hover { color: #f1f1f1; }
.admin-modal h3 { font-size: 1.1rem; font-weight: 600; color: #f1f1f1; margin-bottom: 4px; text-align: center; }
.admin-modal p { color: #aaaaaa; font-size: 0.8rem; text-align: center; margin-bottom: 20px; }
.admin-modal .admin-form-group { margin-bottom: 14px; }
.admin-login-error { color: #ff4444; font-size: 0.75rem; text-align: center; margin-top: 10px; display: none; }

/* ==================== Toast ==================== */
.toast {
    position: fixed;
    bottom: 24px;
    left: 24px;
    background: #323232;
    border-radius: 4px;
    padding: 12px 24px;
    color: #f1f1f1;
    font-size: 0.85rem;
    z-index: 3000;
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show { transform: translateY(0); opacity: 1; }
.toast.success i { color: #4caf50; }
.toast.error i { color: #ff4444; }

/* ==================== Loading / Empty States ==================== */
.loading-spinner { text-align: center; padding: 48px 16px; color: #717171; }

.loading-spinner i {
    font-size: 1.5rem;
    color: #3ea6ff;
    animation: spin 1s linear infinite;
    display: block;
    margin-bottom: 12px;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.empty-state { text-align: center; padding: 40px 16px; color: #717171; }
.empty-state i { font-size: 2rem; color: #3f3f3f; margin-bottom: 12px; display: block; }
.empty-state p { font-size: 0.9rem; }

/* ==================== Confirm Dialog ==================== */
.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2500;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.confirm-overlay.active { display: flex; }

.confirm-dialog {
    background: #272727;
    border-radius: 12px;
    padding: 24px;
    max-width: 360px;
    width: 100%;
    text-align: center;
}

.confirm-dialog h4 { color: #f1f1f1; font-size: 1rem; margin-bottom: 8px; }
.confirm-dialog p { color: #aaaaaa; font-size: 0.85rem; margin-bottom: 20px; }
.confirm-actions { display: flex; gap: 8px; justify-content: flex-end; }

.confirm-actions .btn-confirm-yes {
    background: transparent;
    border: none;
    color: #3ea6ff;
    border-radius: 18px;
    padding: 8px 16px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.8rem;
}

.confirm-actions .btn-confirm-yes:hover { background: rgba(62, 166, 255, 0.1); }

.confirm-actions .btn-confirm-no {
    background: transparent;
    border: none;
    color: #aaaaaa;
    border-radius: 18px;
    padding: 8px 16px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
}

.confirm-actions .btn-confirm-no:hover { background: #3f3f3f; }

/* ==================== Community Footer ==================== */
.community-footer {
    background: #181818;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 24px 0;
    margin-top: 40px;
}

.community-footer-inner {
    max-width: 1284px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.community-footer-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.community-footer-link {
    color: #aaaaaa;
    font-size: 0.8rem;
    font-weight: 400;
    transition: color 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.community-footer-link:hover { color: #f1f1f1; }

.community-footer-link i {
    font-size: 0.7rem;
}

.community-footer-sep {
    color: #3f3f3f;
    font-size: 0.6rem;
}

.community-footer-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.community-footer-copy {
    color: #555555;
    font-size: 0.75rem;
}

.admin-login-footer {
    display: inline-block;
    color: #333333;
    font-size: 0.7rem;
    cursor: pointer;
    transition: color 0.15s;
}

.admin-login-footer:hover { color: #717171; }

@media (max-width: 768px) {
    .community-footer {
        padding: 16px 0;
        margin-top: 24px;
    }

    .community-footer-inner {
        flex-direction: column;
        gap: 10px;
        padding: 0 16px;
        text-align: center;
    }

    .community-footer-left {
        gap: 12px;
    }

    .community-footer-link { font-size: 0.75rem; }
    .community-footer-copy { font-size: 0.7rem; }
}

/* ==================== Responsive ==================== */
@media (max-width: 1024px) {
    .watch-secondary { width: 340px; }
}

@media (max-width: 768px) {
    .community-nav-inner {
        padding: 0 8px;
        gap: 4px;
    }

    .community-nav-brand { gap: 8px; }
    .community-nav-brand img { height: 24px; }
    .community-nav-separator { display: none; }
    .community-nav-title { font-size: 0.8rem; }

    .community-nav-breadcrumb { display: none; }
    .community-nav-search { display: none; }
    .search-toggle-mobile { display: block; }

    .community-nav-user {
        gap: 4px;
    }
    .community-nav-user .nav-user-name { display: none; }
    .community-nav-user .nav-admin-badge { display: none; }
    .community-nav-user .nav-btn-logout { display: none; }
    .nav-user-avatar { width: 28px; height: 28px; }

    .community-nav-hamburger { display: block; padding: 6px; }

    /* Homepage — single column, full-width cards like YouTube mobile */
    .community-content {
        padding: 60px 0 24px;
        overflow-x: hidden;
    }

    .module-content {
        overflow-x: hidden;
    }

    .yt-container { padding: 0 12px; }

    .module-shelf { margin-bottom: 24px; }

    .module-shelf-header {
        padding: 0;
        margin-bottom: 12px;
    }

    .module-shelf-header h2 { font-size: 1.1rem; }

    .shelf-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* Full-width thumbnails like YouTube mobile */
    .yt-video-card-thumb {
        border-radius: 0;
        margin-left: -12px;
        margin-right: -12px;
        width: calc(100% + 24px);
    }

    .yt-video-card-info {
        padding: 0 4px;
    }

    .yt-video-card-info h4 {
        font-size: 0.9rem;
    }

    .yt-video-card-info .yt-card-meta {
        font-size: 0.75rem;
    }

    /* Watch page — full-width player like YouTube mobile */
    .watch-page {
        padding: 56px 0 24px;
        overflow-x: hidden;
    }

    .watch-page > .yt-container {
        padding: 0;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .watch-page .back-link {
        padding: 8px 12px;
        margin-bottom: 0;
    }

    .watch-layout {
        flex-direction: column;
        gap: 0;
        width: 100%;
    }

    .watch-primary {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        padding: 0;
        box-sizing: border-box;
    }

    /* Player edge-to-edge */
    #player-container {
        width: 100%;
        max-width: 100%;
    }

    .lesson-video-wrapper {
        border-radius: 0;
        width: 100%;
        max-width: 100%;
    }

    /* Info and comments with padding */
    .lesson-info {
        padding: 12px 12px 12px;
        margin: 0;
    }

    .lesson-info h1 { font-size: 1.05rem; }

    .materials-section {
        padding: 12px;
        margin-top: 0;
    }

    .comments-section {
        padding: 12px;
        margin-top: 0;
    }

    .comments-header { margin-bottom: 16px; }

    /* Sidebar becomes inline playlist below content */
    .watch-secondary {
        width: 100%;
        position: static;
        max-height: none;
        padding: 0 12px;
    }

    .playlist-sidebar {
        margin-top: 8px;
        border-radius: 12px;
    }

    .playlist-sidebar-items {
        max-height: 280px;
        overflow-y: auto;
    }

    /* Module page */
    .module-content { padding: 60px 0 24px; }

    .module-header-bar h1 { font-size: 1.2rem; }

    .comment-replies { margin-left: 36px; }
    .reply-input-wrapper { margin-left: 36px; }

    .admin-btn { padding: 8px 12px; min-height: 40px; }

    .admin-form { padding: 16px; }

    /* Module Cards — single column */
    .community-hero { padding: 20px 0 16px; margin-bottom: 24px; }
    .community-hero h1 { font-size: 1.25rem; }
    .community-hero p { font-size: 0.85rem; }

    .modules-grid { grid-template-columns: 1fr; gap: 16px; }

    .module-card:hover { transform: none; box-shadow: none; }

    /* Module Detail Header — stack vertically */
    .module-detail-header { flex-direction: column; gap: 16px; }
    .module-detail-cover { width: 100%; min-width: unset; }
    .module-detail-info h1 { font-size: 1.2rem; }

    /* Lesson List */
    .lesson-list-item { padding: 10px 12px; gap: 12px; }
    .lesson-thumb { width: 100px; min-width: 100px; }
    .lesson-num { width: 28px; height: 28px; font-size: 0.8rem; }
    .lesson-list-item .lesson-info h4 { font-size: 0.9rem; }
    .lesson-list-item .admin-controls { opacity: 1; }
}

@media (max-width: 480px) {
    .yt-container { padding: 0 8px; }

    /* Thumbnails stretch even more edge-to-edge */
    .yt-video-card-thumb {
        margin-left: -8px;
        margin-right: -8px;
        width: calc(100% + 16px);
    }

    .yt-video-card-info h4 { font-size: 0.85rem; }

    .module-shelf-header h2 { font-size: 1rem; }
    .module-header-bar h1 { font-size: 1.1rem; }

    .playlist-item-thumb { width: 80px; min-width: 80px; }
    .playlist-item-info h4 { font-size: 0.75rem; }

    /* Lesson list — smaller thumbs */
    .lesson-thumb { width: 80px; min-width: 80px; }
    .lesson-num { width: 24px; height: 24px; font-size: 0.75rem; }
    .lesson-list-item .lesson-info h4 { font-size: 0.85rem; }

    .lesson-info { padding: 10px 8px; }
    .lesson-info h1 { font-size: 1rem; }

    .materials-section { padding: 10px 8px; }
    .comments-section { padding: 10px 8px; }

    .watch-page .back-link { padding: 6px 8px; font-size: 0.8rem; }
    .watch-secondary { padding: 0 8px; }

    .comment-item { gap: 8px; }
    .comment-avatar { width: 32px; height: 32px; min-width: 32px; }
    .comment-replies { margin-left: 24px; }
    .admin-modal { padding: 24px 16px; }

    .community-nav-inner { padding: 0 6px; gap: 2px; }
    .community-nav-brand img { height: 22px; }
    .community-nav-title { font-size: 0.75rem; }
    .search-toggle-mobile { padding: 6px; font-size: 1rem; }
    .community-nav-hamburger { padding: 6px; font-size: 1rem; }
}
