/* ===========================================
   Mada Platform - Teacher Content Page
   Sidebar, Video Player, Access Control
   =========================================== */

/* ===========================================
   CONTENT HEADER
   =========================================== */
.content-header {
    background: var(--dark-gradient);
    color: white;
    padding: 96px 0 28px;
    position: relative;
}

.content-header .breadcrumb-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.7);
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.content-header .breadcrumb-nav a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: color 0.3s;
}

.content-header .breadcrumb-nav a:hover {
    color: white;
}

.content-header .separator {
    color: rgba(255,255,255,0.4);
}

.content-header .current {
    color: var(--accent-color);
}

/* Teacher Header */
.teacher-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.teacher-identity {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: min(100%, 420px);
}

.teacher-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.3);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.teacher-info h1 {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 5px;
}

.teacher-info .subject-name {
    color: rgba(255,255,255,0.8);
    font-size: 1rem;
}

.subject-term-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
}

.subject-term-pill.term-term1 {
    background: linear-gradient(135deg, #1d4ed8, #0ea5e9);
}

.subject-term-pill.term-term2 {
    background: linear-gradient(135deg, #1d4ed8, #0ea5e9);
}

/* Pricing Section */
.pricing-section {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.price-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.old-price {
    text-decoration: line-through;
    color: rgba(255,255,255,0.5);
    font-size: 1rem;
}

.new-price, .price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent-color);
}

.discount-badge {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.free-badge {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 700;
}

.subscribed-badge {
    background: rgba(74, 222, 128, 0.2);
    color: #4ade80;
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 0.95rem;
    font-weight: 600;
    border: 1px solid rgba(74, 222, 128, 0.3);
}

.btn-subscribe {
    background: var(--primary-gradient);
    color: white;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 24px rgba(47, 91, 255, 0.28);
}

.btn-subscribe:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 30px rgba(47, 91, 255, 0.35);
}

/* ===========================================
   CONTENT MAIN LAYOUT
   =========================================== */
.content-main {
    padding: 40px 0 80px;
    background: var(--bg-light);
    min-height: 80vh;
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 350px;
    grid-template-areas: "player sidebar";
    gap: 30px;
    align-items: start;
}

/* ===========================================
   SIDEBAR
   =========================================== */
.content-sidebar {
    grid-area: sidebar;
    display: flex;
    flex-direction: column;
    gap: 25px;
    align-self: start;
    position: sticky;
    top: 110px;
}

.sidebar-section {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(47, 91, 255, 0.12);
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(148, 163, 184, 0.2);
}

/* Materials List */
.materials-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.material-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    background: #f9fafb;
    transition: all 0.3s ease;
}

.material-item.accessible:hover {
    background: rgba(47, 91, 255, 0.08);
    cursor: pointer;
}

.material-item.locked {
    opacity: 0.6;
    filter: grayscale(0.3);
}

.material-icon {
    font-size: 1.5rem;
}

.material-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.material-title {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.material-size {
    font-size: 0.75rem;
    color: #888;
}

.btn-download {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-download:hover {
    transform: scale(1.2);
}

.lock-icon {
    font-size: 1.1rem;
}

/* Lessons Accordion */
.lessons-accordion {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.unit-item {
    background: #f9fafb;
    border-radius: 12px;
    overflow: hidden;
}

.unit-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    text-align: right;
    transition: background 0.3s;
}

.unit-header:hover {
    background: rgba(0,0,0,0.03);
}

.unit-arrow {
    transition: transform 0.3s;
    font-size: 0.8rem;
}

.unit-item.open .unit-arrow {
    transform: rotate(180deg);
}

.unit-lessons {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.unit-item.open .unit-lessons {
    max-height: 2000px;
}

.chapter-item {
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    margin: 10px;
    overflow: hidden;
}

.chapter-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    background: #f8fafc;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
    text-align: right;
}

.chapter-arrow {
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

.chapter-item.open .chapter-arrow {
    transform: rotate(180deg);
}

.chapter-lessons {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0 6px 6px;
}

.chapter-item.open .chapter-lessons {
    max-height: 1400px;
}

.lesson-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(47, 91, 255, 0.12);
    border-radius: 10px;
    margin: 8px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-wrap: wrap;
}

.lesson-item.accessible:hover {
    background: rgba(47, 91, 255, 0.08);
}

.lesson-item.active {
    background: linear-gradient(135deg, rgba(47, 91, 255, 0.18), rgba(18, 182, 166, 0.16));
    border: 1px solid rgba(47, 91, 255, 0.35);
}

.lesson-item.locked {
    opacity: 0.6;
    cursor: not-allowed;
}

.lesson-status {
    font-size: 1rem;
}

.lesson-info {
    flex: 1;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 10px;
}

.lesson-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: #333;
}

.lesson-duration {
    font-size: 0.75rem;
    color: #888;
}

.lesson-action {
    border: 1px solid rgba(47, 91, 255, 0.25);
    background: rgba(47, 91, 255, 0.12);
    color: #1d3fbf;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    margin-inline-start: auto;
}

.lesson-item.locked .lesson-action {
    display: none;
}

/* ===========================================
   VIDEO PLAYER
   =========================================== */
.content-player {
    grid-area: player;
    display: flex;
    flex-direction: column;
    gap: 25px;
    min-width: 0;
}

.content-panel {
    background: #fff;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.panel-header h3 {
    margin: 0;
    font-size: 1.15rem;
    color: #0f172a;
}

.panel-hint {
    margin: 6px 0 0;
    color: #64748b;
    font-size: 0.85rem;
}

.panel-meta {
    background: rgba(47, 91, 255, 0.12);
    color: #1d3fbf;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.file-card {
    border: 1px solid rgba(47, 91, 255, 0.12);
    border-radius: 14px;
    padding: 14px;
    background: rgba(47, 91, 255, 0.04);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: 0.2s ease;
}

.file-card.accessible:hover {
    border-color: rgba(47, 91, 255, 0.35);
    background: rgba(47, 91, 255, 0.08);
}

.file-icon {
    font-size: 1.6rem;
}

.file-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.file-title {
    font-weight: 700;
    color: #0f172a;
    font-size: 0.95rem;
}

.file-meta {
    color: #64748b;
    font-size: 0.8rem;
}

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

.btn-primary {
    background: var(--primary-gradient);
    color: #fff;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.8rem;
    text-decoration: none;
    border: none;
}

.btn-ghost {
    background: rgba(15, 23, 42, 0.08);
    color: #0f172a;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.8rem;
    text-decoration: none;
    border: none;
}

.file-locked {
    color: #dc2626;
    font-size: 0.8rem;
    font-weight: 600;
}

.empty-card {
    padding: 14px;
    border-radius: 12px;
    border: 1px dashed #e2e8f0;
    text-align: center;
    color: #94a3b8;
    background: #f8fafc;
}

.video-player-wrapper {
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 16/9;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.video-player-wrapper iframe {
    width: 100%;
    height: 100%;
}

.video-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e293b, #0f172a);
}

.placeholder-content {
    text-align: center;
    color: rgba(255,255,255,0.6);
}

.placeholder-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 15px;
}

/* Lesson Details */
.lesson-details {
    background: white;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.lesson-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.lesson-type {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f1f5f9;
    color: #475569;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.lesson-meta-text {
    color: #64748b;
    font-size: 0.85rem;
}

.lesson-access-badge {
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.lesson-access-badge.success {
    background: #dcfce7;
    color: #166534;
}

.lesson-access-badge.warning {
    background: #fff7ed;
    color: #9a3412;
}

.lesson-access-badge.danger {
    background: #fee2e2;
    color: #b91c1c;
}

.lesson-files {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lesson-notice {
    margin-top: 16px;
    background: #f1f5f9;
    color: #334155;
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 0.9rem;
}

.lesson-notice.warning {
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fed7aa;
}

.lesson-notice .notice-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.lesson-type-icon {
    margin-left: 6px;
}
.current-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
}

.lesson-description {
    color: #666;
    line-height: 1.8;
}

/* Subscribe CTA */
.subscribe-cta {
    background: var(--primary-gradient);
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    color: white;
}

.subscribe-cta h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.subscribe-cta p {
    opacity: 0.9;
    margin-bottom: 20px;
}

.btn-subscribe-large {
    background: white;
    color: #1d3fbf;
    border: none;
    padding: 15px 40px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

.btn-subscribe-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}

/* ===========================================
   TEACHER PRICING IN CARDS
   =========================================== */
.teacher-pricing {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    margin: 10px 0;
}

.teacher-pricing .old-price {
    text-decoration: line-through;
    color: #999;
    font-size: 0.85rem;
}

.teacher-pricing .new-price {
    color: #22c55e;
    font-size: 1.1rem;
    font-weight: 700;
}

.teacher-pricing .price {
    color: #333;
    font-size: 1.1rem;
    font-weight: 700;
}

.teacher-pricing .discount-badge {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
}

.teacher-pricing .free-badge {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* ===========================================
   FOCUS MODE
   =========================================== */
.teacher-content-focus .main-header,
.teacher-content-focus .site-footer {
    display: none !important;
}

.focus-mini-hero {
    color: #fff;
    padding: 22px 0 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.focus-mini-hero-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.focus-mini-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    font-size: 0.75rem;
    font-weight: 700;
}

.focus-mini-hero-copy h1 {
    margin: 8px 0 4px;
    font-size: 1.55rem;
    line-height: 1.3;
}

.focus-mini-hero-copy p {
    margin: 0;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
}

.focus-mini-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.teacher-content-focus .content-main {
    padding: 18px 0 56px;
    min-height: auto;
}

.teacher-content-focus .content-grid {
    max-width: 1320px;
    margin: 0 auto;
}

.teacher-content-focus .content-sidebar {
    top: 14px;
}

/* ===========================================
   RESPONSIVE
   =========================================== */
@media (max-width: 992px) {
    .content-grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "player"
            "sidebar";
    }
    
    .content-sidebar {
        order: 2;
        position: static;
    }
    
    .content-player {
        order: 1;
    }
}

@media (max-width: 768px) {
    .teacher-header {
        flex-direction: column;
        text-align: center;
    }

    .teacher-identity {
        min-width: 0;
        justify-content: center;
        text-align: center;
    }
    
    .pricing-section {
        justify-content: center;
    }
    
    .teacher-info h1 {
        font-size: 1.4rem;
    }
}
