/**
 * Polifilm TOC — Timeline/Line Style
 * Solda dikey çizgi + noktalar + sağda başlıklar
 * Şeffaf arkaplan, hover ile açılır
 */

:root {
    --ptoc-primary: #f26522;
    --ptoc-line: rgba(242, 101, 34, 0.25);
    --ptoc-dot: rgba(242, 101, 34, 0.4);
    --ptoc-dot-active: #f26522;
    --ptoc-text: rgba(30, 30, 30, 0.75);
    --ptoc-text-active: #f26522;
    --ptoc-transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== WRAPPER ==================== */
.ptoc-wrapper {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    /* Başlangıçta açık */
    --ptoc-expanded: 1;
}

.ptoc-left  { left: 20px; }
.ptoc-right { right: 20px; }

/* ==================== İÇ YAPI ==================== */
.ptoc-inner {
    display: flex;
    align-items: flex-start;
    gap: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    position: relative;
}

/* ==================== HEADER / BAŞLIK SATIRI ==================== */
.ptoc-header {
    display: none; /* Başlık yok */
}

/* ==================== DİKEY ÇİZGİ + NOKTALAR ==================== */
.ptoc-line-track {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 20px;
    flex-shrink: 0;
}

/* Dikey çizgi */
.ptoc-line-track::before {
    content: '';
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    background: var(--ptoc-line);
    border-radius: 2px;
    transition: background var(--ptoc-transition);
}

.ptoc-wrapper:hover .ptoc-line-track::before,
.ptoc-wrapper.ptoc-open .ptoc-line-track::before {
    background: rgba(242, 101, 34, 0.5);
}

/* ==================== LİSTE ==================== */
.ptoc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.ptoc-list-labels {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
    /* Kapalı state */
    max-width: 0;
    opacity: 0;
    pointer-events: none;
    transition: max-width var(--ptoc-transition), opacity var(--ptoc-transition);
    white-space: nowrap;
}

/* Açık state — hover veya .ptoc-open */
.ptoc-wrapper:hover .ptoc-list-labels,
.ptoc-wrapper.ptoc-open .ptoc-list-labels {
    max-width: 280px;
    opacity: 1;
    pointer-events: auto;
}

/* ==================== HER SATIR ==================== */
.ptoc-item {
    display: flex;
    align-items: center;
    position: relative;
    min-height: 28px;
}

/* NOKTA */
.ptoc-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ptoc-dot);
    border: 2px solid transparent;
    flex-shrink: 0;
    margin: 0 auto;
    transition: all var(--ptoc-transition);
    cursor: pointer;
    position: relative;
    z-index: 1;
}

.ptoc-item.active .ptoc-dot,
.ptoc-item:hover .ptoc-dot {
    background: var(--ptoc-dot-active);
    transform: scale(1.3);
    border-color: rgba(242, 101, 34, 0.2);
    box-shadow: 0 0 0 4px rgba(242, 101, 34, 0.12);
}

/* ETİKET */
.ptoc-label {
    display: block;
    padding: 4px 10px 4px 12px;
    color: var(--ptoc-text);
    text-decoration: none;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.4;
    white-space: nowrap;
    transition: color var(--ptoc-transition), transform var(--ptoc-transition);
    transform: translateX(-6px);
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ptoc-wrapper:hover .ptoc-label,
.ptoc-wrapper.ptoc-open .ptoc-label {
    transform: translateX(0);
}

.ptoc-item.active .ptoc-label {
    color: var(--ptoc-text-active);
    font-weight: 600;
}

.ptoc-label:hover {
    color: var(--ptoc-text-active) !important;
}

/* Indent seviyeleri */
.ptoc-level-3 .ptoc-dot  { width: 6px; height: 6px; opacity: 0.7; }
.ptoc-level-3 .ptoc-label { font-size: 12px; padding-left: 20px; }
.ptoc-level-4 .ptoc-dot  { width: 5px; height: 5px; opacity: 0.5; }
.ptoc-level-4 .ptoc-label { font-size: 11px; padding-left: 28px; }

/* ==================== PROGRESS ==================== */
.ptoc-progress { display: none; }

/* ==================== MOBİL ==================== */
.ptoc-fab,
.ptoc-mobile-drawer { display: none; }

@media (max-width: 1200px) {
    .ptoc-wrapper { display: none; }
    .ptoc-fab {
        display: flex;
        position: fixed;
        bottom: 24px;
        right: 24px;
        width: 48px;
        height: 48px;
        border-radius: 50%;
        background: var(--ptoc-primary);
        color: #fff;
        border: none;
        box-shadow: 0 4px 16px rgba(242,101,34,0.35);
        cursor: pointer;
        z-index: 9001;
        align-items: center;
        justify-content: center;
        transition: var(--ptoc-transition);
    }
    .ptoc-fab:hover { transform: scale(1.1); }
    .ptoc-mobile-drawer {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 99990;
    }
    .ptoc-mobile-overlay {
        position: absolute;
        inset: 0;
        background: rgba(0,0,0,0.4);
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    .ptoc-mobile-content {
        position: absolute;
        bottom: 0; left: 0; right: 0;
        max-height: 65vh;
        background: #fff;
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
        overflow: hidden;
    }
    .ptoc-mobile-drawer.active .ptoc-mobile-overlay { opacity: 1; }
    .ptoc-mobile-drawer.active .ptoc-mobile-content { transform: translateY(0); }
    .ptoc-mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px 20px;
        border-bottom: 1px solid #f0f0f0;
        font-weight: 600;
    }
    .ptoc-mobile-close {
        width: 32px; height: 32px;
        border-radius: 50%;
        background: #f5f5f5;
        border: none;
        font-size: 20px;
        cursor: pointer;
        display: flex; align-items: center; justify-content: center;
    }
    .ptoc-mobile-list {
        max-height: calc(65vh - 60px);
        overflow-y: auto;
        padding: 8px 0 env(safe-area-inset-bottom, 16px);
    }
    .ptoc-mobile-list ul { list-style: none; margin: 0; padding: 0; }
    .ptoc-mobile-list a {
        display: block;
        padding: 13px 20px;
        color: #333;
        text-decoration: none;
        font-size: 15px;
        border-bottom: 1px solid #f5f5f5;
    }
    .ptoc-mobile-list a:active { background: rgba(242,101,34,0.08); }
    .ptoc-mobile-list .ptoc-level-3 a { padding-left: 36px; font-size: 14px; color: #555; }
    .ptoc-mobile-list .ptoc-level-4 a { padding-left: 52px; font-size: 13px; color: #777; }
}

@media print {
    .ptoc-wrapper, .ptoc-fab, .ptoc-mobile-drawer { display: none !important; }
}
