﻿
/* ═══ LAYOUT ═══ */
.ec-page {
    min-height: 100vh;
    background: #f0f2f5;
    font-family: 'Segoe UI', system-ui, sans-serif;
    color: #1a202c;
}

/* ── LOADING ── */
.ec-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    gap: 16px;
    color: #64748b;
}

.ec-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── EMPTY ── */
.ec-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    gap: 12px;
    color: #64748b;
    text-align: center;
}

.ec-empty-icon {
    font-size: 64px;
}

.ec-empty h3 {
    margin: 0;
    color: #1a202c;
}

/* ── HEADER ── */
.ec-header {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 16px 24px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 6px rgba(0,0,0,.06);
}

.ec-header-left {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 1;
}

.ec-back-btn {
    margin-top: 4px;
    width: 36px;
    height: 36px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    flex-shrink: 0;
    transition: all .15s;
}

    .ec-back-btn:hover {
        background: #f8fafc;
        color: #1a202c;
        border-color: #94a3b8;
    }

.ec-breadcrumb {
    font-size: 12px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ec-bc-sep {
    color: #cbd5e1;
}

.ec-bc-active {
    color: #64748b;
}

.ec-unit-title {
    margin: 4px 0;
    font-size: 18px;
    font-weight: 700;
    color: #1a202c;
    line-height: 1.3;
}

.ec-header-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.ec-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.ec-badge-blue {
    background: #eff6ff;
    color: #2563eb;
}

.ec-badge-gray {
    background: #f1f5f9;
    color: #64748b;
}

.ec-badge-green {
    background: #f0fdf4;
    color: #16a34a;
}

.ec-header-right {
    flex-shrink: 0;
    min-width: 160px;
}

.ec-overall-progress {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ec-progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #64748b;
}

.ec-progress-pct {
    font-weight: 700;
    color: #3b82f6;
}

.ec-progress-track {
    height: 6px;
    background: #e2e8f0;
    border-radius: 99px;
    overflow: hidden;
}

.ec-progress-fill {
    height: 100%;
    background: linear-gradient(90deg,#3b82f6,#6366f1);
    border-radius: 99px;
    transition: width .4s ease;
}

/* ── STEP BAR ── */
.ec-stepbar {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    overflow-x: auto;
    gap: 0;
    scrollbar-width: none;
}

    .ec-stepbar::-webkit-scrollbar {
        display: none;
    }

.ec-step {
    position: relative;
    display: flex;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: opacity .2s;
}

    .ec-step:disabled {
        cursor: not-allowed;
        opacity: .5;
    }

.ec-step-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    border: 2px solid #e2e8f0;
    background: #f8fafc;
    color: #94a3b8;
    transition: all .2s;
    position: relative;
    z-index: 1;
}

.ec-step.active .ec-step-dot {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
    box-shadow: 0 0 0 4px #bfdbfe;
}

.ec-step.done .ec-step-dot {
    background: #22c55e;
    border-color: #22c55e;
    color: #fff;
}

.ec-step-line {
    width: 32px;
    height: 2px;
    background: #e2e8f0;
    display: none;
}

    .ec-step-line.show {
        display: block;
    }

.ec-step.done + .ec-step .ec-step-line,
.ec-step.done .ec-step-line {
    background: #22c55e;
}

/* ── TIMER ALERT ── */
.ec-timer-alert {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-bottom: 2px solid #f59e0b;
    padding: 12px 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ec-timer-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #92400e;
}

    .ec-timer-content i {
        font-size: 20px;
        color: #f59e0b;
    }

.ec-countdown {
    font-size: 16px;
    font-weight: 800;
    color: #b45309;
    font-family: 'Courier New', monospace;
}

.ec-timer-progress {
    height: 4px;
    background: rgba(180,83,9,.2);
    border-radius: 99px;
    overflow: hidden;
}

.ec-timer-fill {
    height: 100%;
    background: #f59e0b;
    width: 0;
    animation-name: ec-timer-shrink;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
}

/* ── BODY ── */
.ec-body {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
    gap: 24px;
    align-items: flex-start;
}

/* ── SIDEBAR ── */
.ec-sidebar {
    width: 273px;
    flex-shrink: 0;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 76px;
    max-height: calc(100vh - 100px);
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}

.ec-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
    font-weight: 700;
    font-size: 13px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .05em;
    flex-shrink: 0; /* ← header sabit kalır, sadece nav scrolllanır */
}

.ec-sidebar-close {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #94a3b8;
}

.ec-nav {
    padding: 8px;
    flex: 1; /* ← kalan yüksekliği doldurur */
    overflow-y: auto;
    /* güzel scrollbar */
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
    margin-top:40px;
}

    .ec-nav::-webkit-scrollbar {
        width: 4px;
    }

    .ec-nav::-webkit-scrollbar-track {
        background: transparent;
    }

    .ec-nav::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 99px;
    }

        .ec-nav::-webkit-scrollbar-thumb:hover {
            background: #94a3b8;
        }

.ec-nav-item {
    width: 100%;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
    border-radius: 8px;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background .15s;
}

    .ec-nav-item:hover:not(:disabled) {
        background: #f8fafc;
    }

    .ec-nav-item:disabled {
        cursor: not-allowed;
        opacity: .6;
    }

    .ec-nav-item.active {
        background: #eff6ff;
    }

    .ec-nav-item.done {
        opacity: .75;
    }

.ec-nav-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    background: #f1f5f9;
    color: #64748b;
    margin-top: 1px;
}

.ec-nav-item.active .ec-nav-icon {
    background: #3b82f6;
    color: #fff;
}

.ec-nav-item.done .ec-nav-icon {
    background: #22c55e;
    color: #fff;
}

.icon-done {
    font-size: 13px;
}

.icon-active {
    font-size: 10px;
}

.ec-nav-text {
    flex: 1;
    min-width: 0;
}

.ec-nav-title {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1a202c;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ec-nav-item.active .ec-nav-title {
    color: #2563eb;
}

.ec-nav-meta {
    display: block;
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
}

.ec-nav-timer {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ec-nav-timer-bar {
    height: 3px;
    background: #e2e8f0;
    border-radius: 99px;
    overflow: hidden;
}

@keyframes ec-timer-shrink {
    from { width: 100%; }
    to { width: 0%; }
}

.ec-nav-timer-fill {
    height: 100%;
    background: #f59e0b;
    width: 0;
    animation-name: ec-timer-shrink;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
}

.ec-nav-countdown {
    font-size: 10px;
    font-weight: 700;
    color: #b45309;
    font-family: 'Courier New', monospace;
}

/* ── MAIN ── */
.ec-mainclassic {
    flex: 1;
    min-width: 0;
}

.ec-content-card {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

/* Content header */
.ec-content-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #f1f5f9;
    gap: 12px;
}

.ec-content-header-left {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 1;
}

.ec-toc-btn {
    display: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1.5px solid #e2e8f0;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    color: #64748b;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    transition: all .15s;
}

    .ec-toc-btn:hover {
        background: #f8fafc;
    }

.ec-content-type-tag {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .05em;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.ec-duration {
    font-weight: 400;
    color: #94a3b8;
}

.ec-content-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #1a202c;
    line-height: 1.4;
}

.ec-page-counter {
    flex-shrink: 0;
    font-size: 13px;
    color: #94a3b8;
    white-space: nowrap;
    margin-top: 6px;
    font-weight: 600;
}

/* Content body */
.ec-content-body {
    padding: 28px 32px;
    min-height: 320px;
}

.ec-html-body {
    line-height: 1.8;
    font-size: 15px;
    color: #374151;
}

    .ec-html-body h1, .ec-html-body h2, .ec-html-body h3 {
        color: #1a202c;
        font-weight: 700;
        margin: 1.5em 0 .6em;
    }

    .ec-html-body p {
        margin: 0 0 1em;
    }

    .ec-html-body ul, .ec-html-body ol {
        padding-left: 1.5em;
        margin: 0 0 1em;
    }

    .ec-html-body li {
        margin-bottom: .4em;
    }

    .ec-html-body img {
        max-width: 100%;
        border-radius: 8px;
        margin: 8px 0;
    }

    .ec-html-body table {
        width: 100%;
        border-collapse: collapse;
        margin: 1em 0;
    }

    .ec-html-body th, .ec-html-body td {
        border: 1px solid #e2e8f0;
        padding: 8px 12px;
        font-size: 14px;
    }

    .ec-html-body th {
        background: #f8fafc;
        font-weight: 700;
    }

    .ec-html-body blockquote {
        border-left: 4px solid #3b82f6;
        margin: 1em 0;
        padding: 8px 16px;
        background: #eff6ff;
        border-radius: 0 8px 8px 0;
    }

    .ec-html-body code {
        background: #f1f5f9;
        padding: 1px 5px;
        border-radius: 4px;
        font-size: 13px;
    }

    .ec-html-body pre {
        background: #1e293b;
        color: #e2e8f0;
        padding: 16px;
        border-radius: 10px;
        overflow-x: auto;
        font-size: 13px;
    }

/* PDF */
.ec-pdf-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ec-pdf-frame {
    width: 100%;
    height: 640px;
    border: none;
    border-radius: 8px;
    background: #f8fafc;
}

.ec-pdf-link {
    font-size: 13px;
    color: #3b82f6;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

    .ec-pdf-link:hover {
        text-decoration: underline;
    }

/* Video */
.ec-video-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ec-video {
    width: 100%;
    border-radius: 10px;
    background: #000;
    max-height: 500px;
}

.ec-media-label {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
}

.mt-3 {
    margin-top: 20px;
}

/* Audio */
.ec-audio-wrapper {
    margin-top: 20px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ec-audio {
    width: 100%;
}

/* ── ACTIONS ── */
.ec-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-top: 1px solid #f1f5f9;
    gap: 12px;
}

.ec-actions-center {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ec-dot-nav {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid #e2e8f0;
    background: #f1f5f9;
    cursor: pointer;
    transition: all .2s;
    padding: 0;
}

    .ec-dot-nav:disabled {
        cursor: not-allowed;
        opacity: .4;
    }

    .ec-dot-nav.current {
        background: #3b82f6;
        border-color: #3b82f6;
        width: 14px;
        border-radius: 99px;
    }

    .ec-dot-nav.done {
        background: #22c55e;
        border-color: #22c55e;
    }

/* Buttons */
.ec-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all .15s;
    white-space: nowrap;
}

    .ec-btn:disabled {
        opacity: .4;
        cursor: not-allowed;
    }

.ec-btn-outline {
    background: #fff;
    border: 1.5px solid #e2e8f0;
    color: #374151;
}

    .ec-btn-outline:not(:disabled):hover {
        background: #f8fafc;
        border-color: #94a3b8;
    }

.ec-btn-primary {
    background: #3b82f6;
    color: #fff;
}

    .ec-btn-primary:not(:disabled):hover {
        background: #2563eb;
    }

.ec-btn-success {
    background: linear-gradient(135deg,#22c55e,#16a34a);
    color: #fff;
}

    .ec-btn-success:not(:disabled):hover {
        background: linear-gradient(135deg,#16a34a,#15803d);
    }

/* Overlay */
.ec-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    z-index: 200;
}
.module-tabs-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.module-tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 10px;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all .15s;
}

    .module-tab-btn:hover {
        border-color: #3b82f6;
        color: #2563eb;
        background: #eff6ff;
    }

    .module-tab-btn.active {
        border-color: #3b82f6;
        background: #3b82f6;
        color: #fff;
    }

.mod-tab-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 99px;
    background: rgba(0,0,0,.1);
}

.module-tab-btn.active .mod-tab-badge {
    background: rgba(255,255,255,.25);
    color: #fff;
}

.mod-tab-badge.done {
    background: #dcfce7;
    color: #16a34a;
}

.module-tab-btn.active .mod-tab-badge.done {
    background: rgba(255,255,255,.3);
    color: #fff;
}

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
    .ec-body {
        padding: 16px;
        gap: 16px;
    }

    .ec-sidebar {
        width: 275px;
        flex-shrink: 0;
        background: #fff;
        border-radius: 12px;
        border: 1px solid #e2e8f0;
        display: flex;
        flex-direction: column;
        position: sticky;
        top: 140px; /* header ~80px + stepbar ~52px + 8px boşluk */
        max-height: calc(100vh - 160px); /* viewport - (top değeri + alt boşluk) */
        z-index: 10; /* header z-index:100 altında kalmalı */
        box-shadow: 0 1px 4px rgba(0,0,0,.05);
    }

        .ec-sidebar.open {
            left: 0;
        }

    .ec-sidebar-close {
        display: flex;
    }

    .ec-toc-btn {
        display: flex;
    }
}

@media (max-width: 640px) {
    .ec-header {
        padding: 12px 16px;
        flex-direction: column;
    }

    .ec-header-right {
        width: 100%;
    }

    .ec-body {
        padding: 12px;
    }

    .ec-content-body {
        padding: 16px;
    }

    .ec-actions {
        padding: 12px 16px;
    }

    .ec-unit-title {
        font-size: 15px;
    }

    .ec-content-title {
        font-size: 17px;
    }

    .ec-actions-center {
        display: none;
    }

    .ec-timer-alert {
        padding: 10px 16px;
    }
}


