/* SKS PDF Viewer 3.3 — viewer.css
   Geliştirici: Ümit GÜL */

/* WebView tam ekran için html/body kilidi — sadece overlay açıkken JS ekler */
html.sks-active, html.sks-active body {
    overflow: hidden !important;
    height: 100% !important;
    width: 100% !important;
    position: fixed !important;   /* iOS WebView scroll kaymasını önler */
    top: 0 !important;
    left: 0 !important;
}

#sks-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;  /* inset yerine explicit — eski WebView uyumu */
    width: 100%;
    height: 100%;
    z-index: 999999;
    flex-direction: column;
    background: #141414;
    color: #f0f0f0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    /* Çift tıklama zoom'u kapat */
    touch-action: pan-x pan-y;
}
#sks-overlay.sks-open { display: flex; }

/* ── Toolbar ── */
#sks-toolbar {
    flex: 0 0 auto;
    background: #1e1e1e;
    border-bottom: 1px solid #2c2c2c;
    padding-top: env(safe-area-inset-top, 0px);
    touch-action: manipulation;
}

.sks-row {
    display: flex;
    align-items: center;
    height: 48px;
    padding: 0 8px;
    gap: 6px;
    min-width: 0;
}

#sks-title {
    flex: 1 1 0;
    min-width: 0;
    font-size: 13px;
    font-weight: 600;
    color: #e0e0e0;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Buton — sabit boyut, asla kaymaz ── */
.sks-btn {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: #2a2a2a;
    color: #c8c8c8;
    cursor: pointer;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.12s;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;  /* çift tıklama zoom yok */
}
.sks-btn:active  { background: #383838; }
.sks-btn:disabled { opacity: 0.28; pointer-events: none; }

#sks-page {
    flex: 0 0 46px;
    font-size: 12px;
    font-weight: 600;
    color: #555;
    text-align: center;
    white-space: nowrap;
}

/* ── Arama satırı ── */
.sks-search-row {
    display: flex;
    align-items: center;
    height: 46px;
    padding: 0 8px 8px;
    gap: 6px;
}

.sks-input-wrap {
    flex: 1 1 0;
    min-width: 0;
    position: relative;
    display: flex;
    align-items: center;
}

.sks-search-icon {
    position: absolute;
    left: 9px;
    width: 15px;
    height: 15px;
    pointer-events: none;
    opacity: 0.4;
    flex-shrink: 0;
    z-index: 1;
}

#sks-search {
    width: 100%;
    height: 34px;
    background: #252525;
    border: 1.5px solid #333;
    border-radius: 9px;
    color: #f0f0f0;
    font-size: 14px;
    font-family: inherit;
    padding: 0 32px 0 30px;
    outline: none;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.15s;
}
#sks-search::placeholder { color: #444; }
#sks-search:focus        { border-color: #5c6bc0; }

/* Temizle butonu — input içinde sağda, sade */
.sks-clear {
    position: absolute;
    right: 7px;
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    background: #3a3a3a;
    color: #aaa;
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    display: none;           /* JS açar */
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    /* GÖLGESİZ */
    box-shadow: none;
    outline: none;
}
.sks-clear:active { background: #4a4a4a; }

#sks-badge {
    flex: 0 0 auto;
    min-width: 30px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-align: center;
    color: #555;
    white-space: nowrap;
}
#sks-badge.hit  { color: #9fa8da; }
#sks-badge.miss { color: #ef9a9a; }

/* ── PDF alanı ── */
#sks-stage {
    flex: 1 1 0;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 12px 10px calc(12px + env(safe-area-inset-bottom, 0px));
    background: #141414;
    /* Swipe sırasında yatay overflow gizle */
    overflow-x: hidden;
}

#sks-wrap {
    position: relative;
    line-height: 0;
    max-width: 100%;
    box-shadow: 0 2px 24px rgba(0,0,0,0.7);
    /* GPU katmanı — titreşim önleme */
    will-change: auto;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

#sks-canvas {
    display: block;
    max-width: 100%;
    height: auto;
    background: #fff;
    border-radius: 2px;
}

/* ── Loader ── */
#sks-loader {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 2.5px solid #2a2a2a;
    border-top-color: #5c6bc0;
    border-radius: 50%;
    animation: sks-spin 0.65s linear infinite;
    pointer-events: none;
    z-index: 10;
}
#sks-loader.on { display: block; }
@keyframes sks-spin { to { transform: rotate(360deg); } }

/* ── Highlight ── */
.sks-hl {
    position: absolute;
    pointer-events: none;
    border-radius: 2px;
    background: rgba(255, 213, 79, 0.38);
}
.sks-hl.cur {
    background: rgba(92, 107, 192, 0.60);
    outline: 1.5px solid rgba(92, 107, 192, 0.5);
}

/* Web'e özel butonlar — hover efekti */
.sks-web-btn:hover {
    background: #383838;
    color: #f0f0f0;
}
body.sks-lock, body.sks-lock * {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}
