/* ===== GLOBAL SCROLL KONTROL ===== */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden; /* scroll sadece .main-content'te */
}

/* ===== APP ===== */
.app-container {
    display: flex;
    height: 100vh;
    height: 100dvh;
}

/* ===== SIDEBAR ===== */
.modern-sidebar {
    background: var(--t-sidebar, #1e293b);
    color: #fff;
    height: 100vh;
    position: fixed;
    top: 0; left: 0;
    display: flex;
    flex-direction: column;
    z-index: 9999;
    transition: width 0.25s ease;
    overflow: hidden;
}
.modern-sidebar.expanded { width: 260px; }
.modern-sidebar.collapsed { width: 64px; }

/* Header */
.sidebar-header {
    display: flex;
    align-items: center;
    height: 56px;
    padding: 0 12px;
    background: var(--t-sidebar-head, #0f172a);
    flex-shrink: 0;
    gap: 8px;
    box-sizing: border-box;
}
.sidebar-header .logo-text-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.sidebar-header .logo-text {
    font-weight: 900;
    font-size: 1.15rem;
    letter-spacing: 2px;
    white-space: nowrap;
    line-height: 1;
    background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.85) 40%, var(--t-sidebar-active, #93c5fd) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: 'Segoe UI', 'Inter', system-ui, sans-serif;
}
.sidebar-header .logo-sub {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 3px;
    color: rgba(255,255,255,0.55);
    line-height: 1;
}
.sidebar-header .menu-toggle-btn {
    width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    background: none; border: none; color: #fff;
    font-size: 20px; cursor: pointer;
    border-radius: 6px; flex-shrink: 0;
}
.sidebar-header .menu-toggle-btn:hover {
    background: rgba(255,255,255,0.1);
}

/* Search */
.sidebar-search {
    padding: 10px;
    flex-shrink: 0;
}
.sidebar-search input {
    width: 100%;
    padding: 9px 12px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    color: #fff;
    font-size: 0.88rem;
    outline: none;
}
.sidebar-search input::placeholder { color: rgba(255,255,255,0.4); }
.sidebar-search input:focus {
    border-color: var(--t-sidebar-active, #38bdf8);
    background: rgba(255,255,255,0.12);
}

/* Nav */
.nav-links {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
    scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { width: 0; display: none; }
.modern-sidebar.expanded .nav-links { scrollbar-width: thin; scrollbar-color: transparent transparent; }
.modern-sidebar.expanded .nav-links::-webkit-scrollbar { width: 3px; display: block; }
.modern-sidebar.expanded .nav-links::-webkit-scrollbar-track { background: transparent; }
.modern-sidebar.expanded .nav-links::-webkit-scrollbar-thumb { background: transparent; border-radius: 20px; }
.modern-sidebar.expanded .nav-links:hover { scrollbar-color: rgba(255,255,255,0.08) transparent; }
.modern-sidebar.expanded .nav-links:hover::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); }
.modern-sidebar.expanded .nav-links:hover::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.18); }
.nav-links.scroll-active { scrollbar-color: rgba(255,255,255,0.12) transparent !important; }
.nav-links.scroll-active::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12) !important; }

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    height: 44px;
    text-decoration: none;
    color: rgba(255,255,255,0.85);
    font-size: 0.92rem;
    font-weight: 500;
    border-radius: 8px;
    margin: 2px 6px;
    transition: background 0.15s;
    white-space: nowrap;
    overflow: hidden;
}
.sidebar-link:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}
.sidebar-link.active {
    background: var(--t-sidebar-active, #0ea5e9);
    color: #fff;
}
.sidebar-link .link-icon {
    width: 28px; min-width: 28px;
    font-size: 18px;
    text-align: center;
    flex-shrink: 0;
}
.sidebar-link .link-text {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Collapsed: center icons only */
.modern-sidebar.collapsed .sidebar-link {
    justify-content: center;
    padding: 0; gap: 0;
}

/* Sidebar Footer */
.sidebar-footer {
    flex-shrink: 0;
    padding: 8px 0;
    border-top: 1px solid rgba(255,255,255,0.08);
    margin-top: auto;
}

.sidebar-admin-switch { color: #93c5fd !important; }
.sidebar-admin-switch:hover { background: rgba(99,102,241,0.15) !important; }

.sidebar-footer .logout-link {
    color: #fca5a5 !important;
}
.sidebar-footer .logout-link:hover {
    background: rgba(239,68,68,0.2) !important;
    color: #fecaca !important;
}

/* Mesaj badge */
.sidebar-badge {
    background: #ef4444;
    color: white;
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 800;
    margin-left: auto;
    animation: badgePulse 2s ease-in-out infinite;
}

.sidebar-badge-mini {
    position: absolute;
    top: 4px; right: 6px;
    background: #ef4444;
    color: white;
    width: 16px; height: 16px;
    border-radius: 50%;
    font-size: 0.6rem;
    font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    animation: badgePulse 2s ease-in-out infinite;
}

.sidebar-link.has-badge {
    position: relative;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ===== MAIN ===== */
.main-content {
    flex: 1;
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;  /* TEK scroll container */
    overflow-x: hidden;
    transition: margin-left 0.25s ease;
    min-width: 0;
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--t-accent, #6366f1) 20%, transparent) transparent;
}
.main-content::-webkit-scrollbar { width: 5px; }
.main-content::-webkit-scrollbar-track { background: transparent; }
.main-content::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--t-accent, #6366f1) 20%, transparent); border-radius: 20px; }
.main-content::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--t-accent, #6366f1) 40%, transparent); }
.main-content.pushed      { margin-left: 260px; }
.main-content.mini-pushed  { margin-left: 64px; }
.main-content.no-sidebar   { margin-left: 0; }

/* ===== OVERLAY ===== */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
    animation: sidebarOverlayIn 0.25s ease;
}
.sidebar-overlay.closing {
    animation: sidebarOverlayOut 0.22s ease forwards;
}
@keyframes sidebarOverlayIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes sidebarOverlayOut { from { opacity: 1; } to { opacity: 0; } }

/* ===== MOBILE PILL (floating draggable) ===== */
.mobile-pill {
    display: none;
}

/* ===== MOBILE ===== */
@media (max-width: 767px) {
    .modern-sidebar.collapsed {
        width: 0 !important;
    }

    .modern-sidebar.expanded {
        width: 280px !important;
    }

    .main-content.pushed,
    .main-content.mini-pushed {
        margin-left: 0 !important;
        width: 100%;
        max-width: 100vw;
    }

    /* Floating pill */
    .mobile-pill {
        display: flex;
        position: fixed;
        left: 10px; top: 12px;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        padding: 0;
        background: linear-gradient(135deg, #4f46e5, #6366f1);
        color: white;
        border: none;
        border-radius: 50%;
        cursor: pointer;
        z-index: 9000;
        box-shadow: 0 4px 16px rgba(99,102,241,0.4);
        touch-action: none;
        transition: box-shadow 0.2s;
        user-select: none;
    }
    .pill-hamburger {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px; height: 44px;
        font-size: 18px;
        flex-shrink: 0;
    }
    /* Snap animasyonu */
    .mobile-pill.snapping {
        transition: left 0.25s cubic-bezier(0.16,1,0.3,1), top 0.25s cubic-bezier(0.16,1,0.3,1);
    }
}

/* ═══ EĞİTİM ENGELİ OVERLAY ═══ */
.egitim-engel-overlay {
    position: fixed; inset: 0; z-index: 8000;
    background: linear-gradient(135deg, rgba(15,23,42,0.92), rgba(30,41,59,0.95));
    backdrop-filter: blur(12px);
    display: flex; align-items: center; justify-content: center;
    padding: 20px; animation: engelFadeIn 0.4s ease;
}

.engel-card {
    background: white; border-radius: 24px;
    max-width: 460px; width: 100%;
    box-shadow: 0 25px 80px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.1);
    animation: engelSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.engel-header {
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 50%, #3b82f6 100%);
    padding: 32px 28px 24px; text-align: center; position: relative;
}

.engel-header::after {
    content: ''; position: absolute; bottom: -1px; left: 0; right: 0; height: 20px;
    background: white; border-radius: 20px 20px 0 0;
}

.engel-shield { font-size: 3rem; margin-bottom: 8px; filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2)); }

.engel-header h2 {
    margin: 0 0 6px; font-size: 1.35rem; font-weight: 800;
    color: white; text-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.engel-header p {
    margin: 0; color: rgba(255,255,255,0.85); font-size: 0.88rem;
    font-weight: 500; line-height: 1.5;
}

.engel-body { padding: 20px 28px 8px; }

.engel-timeline { display: flex; flex-direction: column; align-items: stretch; }

.timeline-step {
    display: flex; align-items: center; gap: 14px; padding: 8px 0;
}

.timeline-dot {
    width: 42px; height: 42px; border-radius: 14px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border: 1.5px solid #e2e8f0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.timeline-content { display: flex; flex-direction: column; gap: 1px; }
.timeline-content strong { font-size: 0.9rem; color: #1e293b; font-weight: 700; }
.timeline-content span { font-size: 0.8rem; color: #64748b; }

.timeline-line {
    width: 2px; height: 16px; margin-left: 20px;
    background: linear-gradient(to bottom, #2563eb, #3b82f6);
    border-radius: 2px; opacity: 0.3;
}

.engel-footer { padding: 16px 28px 28px; text-align: center; }

.engel-alert {
    display: flex; align-items: center; gap: 8px; justify-content: center;
    padding: 10px 14px; border-radius: 10px;
    background: #fef2f2; border: 1px solid #fecaca;
    color: #dc2626; font-weight: 700; font-size: 0.85rem;
    margin-bottom: 16px;
}

.engel-btn {
    padding: 14px 36px; border: none; border-radius: 14px;
    font-weight: 800; font-size: 0.95rem; cursor: pointer; color: white;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    width: 100%;
}

.engel-btn.primary {
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    box-shadow: 0 4px 20px rgba(37,99,235,0.3);
}

.engel-btn.primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(37,99,235,0.4);
}

.engel-btn.destek {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    box-shadow: 0 4px 20px rgba(245,158,11,0.3);
}

.engel-btn.destek:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(245,158,11,0.4);
}

@keyframes engelFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes engelSlideUp { from { opacity: 0; transform: translateY(30px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }

@media (max-width: 600px) {
    .engel-card { border-radius: 18px; }
    .engel-header { padding: 24px 20px 20px; }
    .engel-shield { font-size: 2.5rem; }
    .engel-header h2 { font-size: 1.1rem; }
    .engel-body { padding: 16px 20px 4px; }
    .engel-footer { padding: 12px 20px 24px; }
}
