/* =====================================================
   veri — GÜVENLİ VERİ KASASI STİLLERİ
   ===================================================== */
:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --bg: #f1f5f9;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --warning: #f59e0b;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.07);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 20px 40px rgba(0,0,0,0.15);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --transition: 0.18s ease;
}

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
  font-size: 14px;
}

/* KİLİT EKRANI (FERAH & MODERN BEYAZ TEMA) */
#lock-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  padding: 20px;
  background: radial-gradient(circle at 50% 0%, #e0e7ff 0%, #f1f5f9 60%, #e2e8f0 100%);
}

.lock-card {
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 20px;
  padding: 40px 32px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 20px 40px -15px rgba(79, 70, 229, 0.12), 0 0 15px rgba(0, 0, 0, 0.03);
}

.lock-icon { font-size: 3rem; margin-bottom: 12px; }
.lock-card h1 { color: #0f172a; font-size: 1.8rem; font-weight: 800; margin-bottom: 6px; letter-spacing: -0.02em; }
.lock-subtitle { color: #64748b; margin-bottom: 24px; font-size: 0.88rem; line-height: 1.5; }

#lock-screen input[type="password"] {
  width: 100%;
  padding: 12px 40px 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
}

#lock-screen input[type="password"]:focus {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

#lock-screen input::placeholder { color: #94a3b8; }

.google-btn {
  background: #ffffff !important;
  color: #1e293b !important;
  border: 1.5px solid #e2e8f0 !important;
  text-decoration: none;
  font-weight: 600;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.google-btn:hover { background: #f8fafc !important; border-color: #cbd5e1 !important; transform: translateY(-1px); }

#error-message {
  color: #dc2626;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-xs);
  padding: 8px 12px;
  margin-bottom: 14px;
  font-size: 0.85rem;
}

/* DÜZEN & PANEL (RESPONSIVE DÜZENLEME) */
#app { display: flex; height: 100vh; overflow: hidden; }

#form-panel {
  width: 380px;
  min-width: 340px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

/* MOBİL SEKMELER (VARSAYILAN OLARAK MASAÜSTÜNDE GİZLİ) */
.mobile-tabs {
  display: none;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 8px 12px;
  gap: 8px;
}

.mobile-tab-btn {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  background: var(--surface-alt);
  color: var(--text-muted);
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.88rem;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.mobile-tab-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.mobile-tab-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

@media (max-width: 900px) {
  #app {
    flex-direction: column;
    height: 100dvh;
    overflow: hidden;
  }

  .mobile-tabs {
    display: flex;
  }

  #form-panel {
    width: 100%;
    min-width: 100%;
    border-right: none;
    flex: 1;
    display: none; /* Mobilde varsayılan olarak gizli */
  }

  #list-panel {
    width: 100%;
    height: calc(100dvh - 55px);
    display: flex; /* Mobilde varsayılan olarak aktif */
  }

  #app.show-form #form-panel {
    display: flex;
    height: calc(100dvh - 55px);
    overflow: hidden;
  }

  #app.show-form #list-panel {
    display: none;
  }
}

.panel-header { padding: 18px 20px; border-bottom: 1px solid var(--border); }
.panel-header h2 { font-size: 1.05rem; font-weight: 700; }
.panel-body { 
  flex: 1; 
  overflow-y: auto; 
  padding: 20px 20px 110px 20px; 
  scrollbar-width: none; /* Firefox için scrollbar gizleme */
  -ms-overflow-style: none; /* IE ve Edge için scrollbar gizleme */
}
.panel-body::-webkit-scrollbar {
  display: none; /* Chrome, Safari ve Opera için scrollbar gizleme */
}

.form-group { margin-bottom: 12px; }
label { display: block; font-size: 0.78rem; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; text-transform: uppercase; }
label .required { color: var(--danger); }

input[type="text"], input[type="password"], input[type="email"], input[type="url"], input[type="tel"], input[type="search"], textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface-alt);
  color: var(--text);
  font-size: 0.88rem;
  outline: none;
}

input:focus, textarea:focus { border-color: var(--primary); background: var(--surface); }

.password-wrapper { position: relative; display: flex; align-items: center; }
.password-wrapper input { padding-right: 60px; }

.toggle-password { position: absolute; right: 30px; cursor: pointer; color: var(--text-muted); }
.generate-password { position: absolute; right: 8px; cursor: pointer; color: var(--warning); }

.section-divider { display: flex; align-items: center; gap: 10px; margin: 14px 0; color: var(--text-muted); font-size: 0.72rem; font-weight: 600; text-transform: uppercase; }
.section-divider::before, .section-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.fields-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.fields-grid .form-group.full-width { grid-column: 1 / -1; }

.form-actions { display: flex; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }

/* BUTONLAR */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 9px 16px; border: none; border-radius: var(--radius-xs); font-size: 0.88rem; font-weight: 600; cursor: pointer; flex: 1; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--surface-alt); color: var(--text-muted); border: 1.5px solid var(--border); }

.btn-icon { background: none; border: none; cursor: pointer; padding: 6px; border-radius: var(--radius-xs); width: 32px; height: 34px; display: inline-flex; align-items: center; justify-content: center; color: var(--text-muted); }
.btn-icon:hover { background: var(--bg); color: var(--text); }
.btn-icon-sm { background: none; border: none; cursor: pointer; padding: 4px; border-radius: var(--radius-xs); color: var(--text-muted); }

/* LİSTE */
#list-panel { flex: 1; display: flex; flex-direction: column; background: var(--bg); height: 100%; overflow: hidden; }
.list-header { display: flex; align-items: center; gap: 10px; padding: 12px 18px; background: var(--surface); border-bottom: 1px solid var(--border); }
.search-wrapper { flex: 1; position: relative; display: flex; align-items: center; }
.search-wrapper svg { position: absolute; left: 10px; color: var(--text-muted); }
#search-input { padding-left: 34px; border-radius: var(--radius-sm); }

#password-list { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; align-content: flex-start; height: 0; }
.empty-state { text-align: center; padding: 50px 20px; color: var(--text-muted); margin: auto; }
.empty-icon { font-size: 2.5rem; margin-bottom: 10px; }

.password-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius); }
.password-item:hover { border-color: #c7d2e0; box-shadow: var(--shadow-sm); }
.item-avatar { width: 38px; height: 38px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 1rem; font-weight: 700; color: #fff; flex-shrink: 0; }
.item-info { flex: 1; min-width: 0; cursor: pointer; }
.item-account { font-size: 0.9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-username { font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-badges { display: flex; gap: 4px; margin-top: 4px; }
.field-badge { font-size: 0.75rem; background: var(--primary-light); padding: 1px 4px; border-radius: 4px; }

/* MODAL & TOAST */
/* GÜNCELLENMİŞ KOD */
#view-modal-overlay,
#change-master-modal-overlay { 
  position: fixed; 
  inset: 0; 
  background: rgba(15, 23, 42, 0.55); 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  z-index: 1000; 
  backdrop-filter: blur(4px); 
}

#view-modal,
.modal-box { 
  background: var(--surface); 
  border-radius: var(--radius); 
  width: 100%; 
  max-width: 460px; 
  max-height: 85vh; 
  overflow-y: auto; 
}
.modal-header { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 10; }
.modal-avatar { width: 40px; height: 40px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; }

#view-fields-container { padding: 16px; }
.view-field { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-alt); border: 1px solid var(--border); margin-bottom: 6px; }
.view-field-label { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; min-width: 110px; }
.view-field-value-wrap { flex: 1; display: flex; align-items: center; gap: 6px; min-width: 0; }
.view-field-value { flex: 1; font-size: 0.88rem; word-break: break-all; }
.view-field-value.masked { font-size: 1rem; letter-spacing: 0.1em; color: var(--text-muted); }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #1e293b; color: #fff; padding: 8px 18px; border-radius: 999px; font-size: 0.85rem; z-index: 9999; }
.hidden { display: none !important; }

/* Form ekranı açıkken mobil Yeni Ekleyin butonunu gizle */
#app.show-form #tab-form-btn {
  display: none !important;
}