/* ===== SERİ NUMARA TARAYICI - MOBİL UI ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a2e;
    --bg-card-hover: #222240;
    --accent: #00d4ff;
    --accent-glow: rgba(0, 212, 255, 0.3);
    --success: #00e676;
    --success-glow: rgba(0, 230, 118, 0.3);
    --error: #ff5252;
    --error-glow: rgba(255, 82, 82, 0.3);
    --warning: #ffab40;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b8;
    --text-muted: #6a6a80;
    --border: #2a2a40;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 8px 32px rgba(0,0,0,0.4);
}

* { margin:0; padding:0; box-sizing:border-box; }

html, body {
    height: 100%;
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

/* ===== GİRİŞ EKRANI ===== */
.user-login-screen {
    position: fixed; inset: 0;
    background: var(--bg-primary);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999; padding: 20px;
}
.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px 30px;
    width: 100%; max-width: 380px;
    text-align: center;
    box-shadow: var(--shadow);
}
.login-card .logo-icon { font-size: 64px; margin-bottom: 16px; }
.login-card h1 {
    font-size: 22px; font-weight: 800; margin-bottom: 6px;
    background: linear-gradient(135deg, var(--accent), #7c4dff);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.login-card p { font-size: 13px; color: var(--text-secondary); margin-bottom: 28px; }
.login-card input {
    width: 100%; padding: 16px 20px;
    background: var(--bg-primary); border: 2px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text-primary);
    font-size: 16px; font-family: 'Inter', sans-serif; font-weight: 600;
    outline: none; transition: border-color 0.3s; margin-bottom: 16px;
}
.login-card input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-glow); }
.login-card input::placeholder { color: var(--text-muted); font-weight: 400; }
.btn-login {
    width: 100%; padding: 16px;
    background: linear-gradient(135deg, var(--accent), #7c4dff);
    color: white; border: none; border-radius: var(--radius-sm);
    font-size: 16px; font-weight: 700; font-family: 'Inter', sans-serif;
    cursor: pointer; transition: transform 0.2s;
}
.btn-login:active { transform: scale(0.97); }

/* ===== ANA UYGULAMA ===== */
.app-container { display: none; height: 100%; flex-direction: column; }
.app-container.active { display: flex; }

/* ===== HEADER ===== */
.app-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 12px; background: var(--bg-secondary);
    border-bottom: 1px solid var(--border); z-index: 10; min-height: 48px;
    flex-wrap: wrap; gap: 4px;
}
.header-left { display: flex; align-items: center; gap: 8px; }
.user-badge {
    display: flex; align-items: center; gap: 5px;
    background: var(--bg-card); padding: 5px 10px;
    border-radius: 20px; font-size: 11px; font-weight: 600; color: var(--accent);
}
.header-right { display: flex; align-items: center; gap: 6px; }
.stat-badge {
    display: flex; align-items: center; gap: 4px;
    background: var(--bg-card); padding: 5px 10px;
    border-radius: 20px; font-size: 10px; font-weight: 700;
    color: var(--success); cursor: pointer;
}
.btn-icon {
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 10px; color: var(--text-secondary);
    font-size: 15px; cursor: pointer; transition: all 0.2s;
}
.btn-icon:active { transform: scale(0.9); background: var(--bg-card-hover); }

/* ===== KAMERA ===== */
.camera-section { flex: 1; position: relative; background: #000; overflow: hidden; }
.camera-section video { width: 100%; height: 100%; object-fit: cover; }
.camera-section canvas { display: none; }

/* Tarama çerçevesi */
.scan-guide {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 88%; height: 70px;
    border: 3px solid var(--accent); border-radius: 12px;
    box-shadow: 0 0 0 9999px rgba(0,0,0,0.5), 0 0 30px var(--accent-glow);
    pointer-events: none; transition: border-color 0.3s, box-shadow 0.3s;
}
.scan-guide::before {
    content: 'Seri numarayı çerçeveye hizalayın';
    position: absolute; bottom: -28px; left: 50%; transform: translateX(-50%);
    white-space: nowrap; font-size: 11px; color: var(--text-secondary);
    text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}
.scan-guide.scanning {
    border-color: var(--warning);
    box-shadow: 0 0 0 9999px rgba(0,0,0,0.5), 0 0 30px rgba(255,171,64,0.4);
    animation: pulse-border 1s infinite;
}
.scan-guide.success {
    border-color: var(--success);
    box-shadow: 0 0 0 9999px rgba(0,0,0,0.5), 0 0 40px var(--success-glow);
}
.scan-guide.error {
    border-color: var(--error);
    box-shadow: 0 0 0 9999px rgba(0,0,0,0.5), 0 0 30px var(--error-glow);
}
@keyframes pulse-border { 0%,100%{opacity:1} 50%{opacity:0.6} }

/* ===== SON OKUNAN (kamera altında) ===== */
.last-seri-container {
    position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
    background: rgba(0,0,0,0.8); backdrop-filter: blur(10px);
    border: 1px solid var(--border); border-radius: 30px;
    padding: 8px 20px; z-index: 5;
    display: flex; align-items: center; gap: 8px;
    opacity: 0; transition: opacity 0.3s;
}
.last-seri-container.visible { opacity: 1; }
.last-seri-label { font-size: 10px; color: var(--text-muted); font-weight: 600; }
.last-seri-no {
    font-size: 16px; font-weight: 900; color: var(--success);
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    letter-spacing: 2px;
}

/* ===== HIZLI BİLDİRİM (BÜYÜK & YEŞİL) ===== */
.quick-notification {
    position: absolute; top: 20%; left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    z-index: 999; padding: 20px 30px; border-radius: 20px;
    font-size: 22px; font-weight: 800; white-space: nowrap;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
    opacity: 0; pointer-events: none; max-width: 90%;
    text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.6);
}
.quick-notification.visible { transform: translate(-50%, -50%) scale(1); opacity: 1; }
.quick-notification .notification-icon { font-size: 40px; line-height: 1; }
.quick-notification.success { background: rgba(0, 230, 118, 0.95); border: 2px solid #00e676; color: #000; backdrop-filter: blur(10px); }
.quick-notification.error { background: rgba(255, 82, 82, 0.95); border: 2px solid #ff5252; color: #fff; backdrop-filter: blur(10px); }
.quick-notification.warning { background: rgba(255, 171, 64, 0.95); border: 2px solid #ffab40; color: #000; backdrop-filter: blur(10px); }
.quick-notification.info { background: rgba(0, 212, 255, 0.95); border: 2px solid #00d4ff; color: #000; backdrop-filter: blur(10px); }
.quick-notification.duplicate { background: rgba(255, 82, 82, 0.95); border: 2px solid #ff5252; color: #fff; backdrop-filter: blur(10px); font-size: 18px; }

/* ===== OTOMATİK TARAMA BADGE ===== */
.auto-mode-badge {
    position: absolute; top: 50px; left: 50%; transform: translateX(-50%);
    background: rgba(0,230,118,0.2); border: 1px solid var(--success);
    color: var(--success); padding: 4px 14px; border-radius: 20px;
    font-size: 11px; font-weight: 700; z-index: 5;
    display: none; cursor: pointer; animation: pulse-badge 2s infinite;
}
.auto-mode-badge.active { display: block; }
.auto-mode-badge.paused { background: rgba(255,171,64,0.2); border-color: var(--warning); color: var(--warning); }
@keyframes pulse-badge { 0%,100%{opacity:1} 50%{opacity:0.7} }

/* ===== OCR STATUS ===== */
.ocr-status {
    position: absolute; bottom: 50px; left: 50%; transform: translateX(-50%);
    color: var(--warning); font-size: 12px; font-weight: 600;
    text-shadow: 0 1px 4px rgba(0,0,0,0.8); z-index: 5;
}

/* ===== HIZLI GİRİŞ VE ÇEKİM ALANI ===== */
.fast-action-panel {
    position: absolute; bottom: 20px; left: 15px; right: 15px;
    background: rgba(26, 26, 46, 0.85); backdrop-filter: blur(12px);
    border: 1px solid var(--border); border-radius: 20px;
    padding: 16px; z-index: 15;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    display: flex; flex-direction: column; gap: 12px;
}
#fastSeriInput {
    width: 100%; padding: 16px;
    background: var(--bg-primary); border: 2px solid var(--border);
    border-radius: 12px; color: var(--accent);
    font-size: 20px; font-weight: 800; font-family: 'JetBrains Mono', 'Courier New', monospace;
    text-align: center; outline: none; letter-spacing: 2px;
}
#fastSeriInput:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-glow); }
#fastSeriInput::placeholder { color: var(--text-muted); font-size: 16px; font-family: 'Inter', sans-serif; letter-spacing: normal; font-weight: 500; }
.btn-fast-capture {
    width: 100%; padding: 18px;
    background: linear-gradient(135deg, var(--success), #00c853);
    color: #000; border: none; border-radius: 12px;
    font-size: 18px; font-weight: 900; font-family: 'Inter', sans-serif;
    cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
    box-shadow: 0 6px 20px rgba(0, 230, 118, 0.4);
    transition: transform 0.15s, box-shadow 0.15s;
}
.btn-fast-capture:active { transform: scale(0.96); box-shadow: 0 2px 10px rgba(0, 230, 118, 0.4); }

/* ===== TARAMA DURUMU ===== */
.scan-status {
    position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
    background: rgba(0,0,0,0.7); backdrop-filter: blur(8px);
    border: 1px solid var(--border); color: var(--text-muted);
    padding: 5px 16px; border-radius: 20px;
    font-size: 11px; font-weight: 700; z-index: 5;
}
.scan-status.active {
    color: var(--success); border-color: var(--success);
    background: rgba(0,230,118,0.15);
    animation: pulse-badge 2s infinite;
}

/* ===== GEÇMİŞ PANELİ ===== */
.history-panel {
    position: fixed; inset: 0; background: var(--bg-primary);
    z-index: 100; transform: translateX(100%);
    transition: transform 0.3s ease; display: flex; flex-direction: column;
}
.history-panel.open { transform: translateX(0); }
.panel-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px; background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}
.panel-header h2 { font-size: 18px; font-weight: 700; }
.panel-toolbar {
    display: flex; gap: 8px; padding: 10px 16px;
    background: var(--bg-secondary); border-bottom: 1px solid var(--border);
}
.panel-toolbar input {
    flex: 1; padding: 10px 14px; background: var(--bg-card);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    color: var(--text-primary); font-size: 14px; font-family: 'Inter', sans-serif; outline: none;
}
.panel-toolbar input:focus { border-color: var(--accent); }
.btn-export {
    padding: 10px 14px;
    background: linear-gradient(135deg, #00c853, #00e676);
    color: #000; border: none; border-radius: var(--radius-sm);
    font-size: 12px; font-weight: 700; font-family: 'Inter', sans-serif;
    cursor: pointer; white-space: nowrap;
}
.history-list {
    flex: 1; overflow-y: auto; padding: 8px 16px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}
.history-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 14px; background: var(--bg-card);
    border-radius: var(--radius-sm); margin-bottom: 6px;
    border: 1px solid var(--border);
}
.history-item .seri {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-weight: 700; font-size: 14px; color: var(--accent); letter-spacing: 1px;
}
.history-item .meta { font-size: 10px; color: var(--text-muted); text-align: right; }
.history-item .meta .user { color: var(--text-secondary); font-weight: 600; }

/* ===== SAFE AREA ===== */
@supports (padding-top: env(safe-area-inset-top)) {
    .app-header { padding-top: calc(8px + env(safe-area-inset-top)); }
    .fast-action-panel { margin-bottom: calc(10px + env(safe-area-inset-bottom)); }
}
