/**
 * @title: Ana Stil Dosyası
 * @description: Volferman Şifre Kasası - Koyu/Açık tema destekli modern arayüz stilleri
 * @company: OMRAR SOFTWARE LTD
 * @date: 2026-04
 * @version: 1.0.0
 */

/* ================================================
   TASARIM SİSTEMİ - DEĞIŞKENLER
   ================================================ */

:root {
    /* Yazı Tipleri */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Boyutlar */
    --header-height: 64px;
    --sidebar-width: 280px;
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
    --border-radius-xl: 20px;
    --border-radius-full: 9999px;

    /* Gölgeler */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.15);

    /* Geçişler */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 350ms ease;

    /* Vurgu Renkleri (Tema-bağımsız) */
    --accent-primary: #6366f1;
    --accent-primary-hover: #4f46e5;
    --accent-primary-light: rgba(99, 102, 241, 0.12);
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;
    --accent-danger-hover: #dc2626;
    --accent-info: #06b6d4;
}

/* ================================================
   KOYU TEMA (Varsayılan)
   ================================================ */

[data-theme="dark"] {
    --bg-primary: #0a0a0f;
    --bg-secondary: #111118;
    --bg-tertiary: #1a1a24;
    --bg-card: rgba(22, 22, 32, 0.75);
    --bg-card-hover: rgba(30, 30, 45, 0.85);
    --bg-input: rgba(255, 255, 255, 0.05);
    --bg-input-focus: rgba(255, 255, 255, 0.08);
    --bg-overlay: rgba(0, 0, 0, 0.65);
    --bg-glass: rgba(18, 18, 28, 0.85);
    --bg-glass-strong: rgba(18, 18, 28, 0.95);

    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-hover: rgba(255, 255, 255, 0.14);
    --border-color-focus: rgba(99, 102, 241, 0.5);

    --text-primary: #f0f0f5;
    --text-secondary: #a0a0b8;
    --text-tertiary: #6b6b82;
    --text-inverse: #0a0a0f;

    --scrollbar-track: rgba(255, 255, 255, 0.03);
    --scrollbar-thumb: rgba(255, 255, 255, 0.1);
    --scrollbar-thumb-hover: rgba(255, 255, 255, 0.2);
}

/* ================================================
   AÇIK TEMA
   ================================================ */

[data-theme="light"] {
    --bg-primary: #f5f5fa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #eeeef5;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-card-hover: rgba(255, 255, 255, 0.95);
    --bg-input: rgba(0, 0, 0, 0.04);
    --bg-input-focus: rgba(0, 0, 0, 0.06);
    --bg-overlay: rgba(0, 0, 0, 0.4);
    --bg-glass: rgba(255, 255, 255, 0.88);
    --bg-glass-strong: rgba(255, 255, 255, 0.96);

    --border-color: rgba(0, 0, 0, 0.08);
    --border-color-hover: rgba(0, 0, 0, 0.15);
    --border-color-focus: rgba(99, 102, 241, 0.5);

    --text-primary: #1a1a2e;
    --text-secondary: #555570;
    --text-tertiary: #8888a0;
    --text-inverse: #ffffff;

    --scrollbar-track: rgba(0, 0, 0, 0.03);
    --scrollbar-thumb: rgba(0, 0, 0, 0.12);
    --scrollbar-thumb-hover: rgba(0, 0, 0, 0.22);

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 8px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 20px -3px rgba(0, 0, 0, 0.1), 0 4px 8px -4px rgba(0, 0, 0, 0.06);
    --shadow-xl: 0 20px 30px -5px rgba(0, 0, 0, 0.12), 0 8px 12px -6px rgba(0, 0, 0, 0.06);
}

/* ================================================
   TEMEL SIFIRLAMA
   ================================================ */

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color var(--transition-slow), color var(--transition-slow);
}

/* Özel Kaydırma Çubuğu */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}
::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

/* ================================================
   THREE.JS ARKA PLAN
   ================================================ */

#three-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    opacity: 0.45;
    transition: opacity var(--transition-slow);
}

[data-theme="light"] #three-canvas {
    opacity: 0.2;
}

/* ================================================
   ÜST GEZİNME ÇUBUĞU
   ================================================ */

.app-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    z-index: 100;
    background: var(--bg-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-slow), border-color var(--transition-slow);
}

.header-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 24px;
    max-width: 1800px;
    margin: 0 auto;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: default;
    user-select: none;
}

.logo svg {
    width: 28px;
    height: 28px;
    color: var(--accent-primary);
    filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.35));
}

.logo-text {
    font-size: 1.05rem;
    color: var(--text-secondary);
    letter-spacing: -0.02em;
}

.logo-text strong {
    color: var(--text-primary);
    font-weight: 700;
}

/* Arama Kutusu */
.header-center {
    flex: 1;
    max-width: 480px;
    margin: 0 32px;
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--text-tertiary);
    pointer-events: none;
    transition: color var(--transition-fast);
}

.search-input {
    width: 100%;
    padding: 10px 14px 10px 42px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-full);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.875rem;
    outline: none;
    transition: all var(--transition-base);
}

.search-input::placeholder {
    color: var(--text-tertiary);
}

.search-input:focus {
    background: var(--bg-input-focus);
    border-color: var(--border-color-focus);
    box-shadow: 0 0 0 3px var(--accent-primary-light);
}

.search-input:focus ~ .search-icon,
.search-input:focus + .search-icon {
    color: var(--accent-primary);
}

.search-shortcut {
    position: absolute;
    right: 12px;
    padding: 2px 8px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-tertiary);
    font-family: inherit;
    font-size: 0.7rem;
    pointer-events: none;
}

/* Sağ Bölüm */
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* Kullanıcı Bilgisi */
.header-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 12px;
    border-left: 1px solid var(--border-color);
    margin-left: 4px;
}

.user-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

#btn-logout {
    background: transparent;
}

#btn-logout:hover {
    color: var(--accent-danger);
    background: rgba(239, 68, 68, 0.08);
}

/* ================================================
   BUTONLAR
   ================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius-md);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
    text-decoration: none;
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-primary-hover));
    color: #fff;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 18px rgba(99, 102, 241, 0.45);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-ghost:hover {
    background: var(--bg-input);
    color: var(--text-primary);
    border-color: var(--border-color-hover);
}

.btn-danger {
    background: linear-gradient(135deg, var(--accent-danger), var(--accent-danger-hover));
    color: #fff;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 18px rgba(239, 68, 68, 0.45);
}

.btn-danger-ghost {
    background: transparent;
    color: var(--accent-danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger-ghost:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.35);
}

/* Simge Butonu */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: var(--border-radius-md);
    background: var(--bg-input);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-base);
}

.icon-btn svg {
    width: 20px;
    height: 20px;
}

.icon-btn:hover {
    background: var(--bg-input-focus);
    color: var(--text-primary);
    transform: scale(1.05);
}

.icon-btn-sm {
    width: 32px;
    height: 32px;
}

.icon-btn-sm svg {
    width: 16px;
    height: 16px;
}

/* Tema Geçiş Butonu */
#theme-toggle {
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .theme-icon-light {
    display: none;
}

[data-theme="light"] .theme-icon-dark {
    display: none;
}

/* ================================================
   ANA YAPI
   ================================================ */

.app-main {
    display: flex;
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
    position: relative;
    z-index: 1;
}

/* ================================================
   SOL KENAR ÇUBUĞU
   ================================================ */

.sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background: var(--bg-glass);
    backdrop-filter: blur(16px) saturate(150%);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    border-right: 1px solid var(--border-color);
    padding: 20px 12px;
    overflow-y: auto;
    z-index: 50;
    transition: background var(--transition-slow), border-color var(--transition-slow), transform var(--transition-base);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px 16px;
}

.sidebar-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
}

.category-list {
    list-style: none;
}

.category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    margin-bottom: 2px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all var(--transition-base);
    user-select: none;
}

.category-item:hover {
    background: var(--bg-input);
}

.category-item.active {
    background: var(--accent-primary-light);
}

.category-item.active .category-name {
    color: var(--accent-primary);
    font-weight: 600;
}

.category-item.active .category-icon {
    color: var(--accent-primary);
}

.category-info {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

.category-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--text-tertiary);
    transition: color var(--transition-fast);
}

.category-name {
    font-size: 0.875rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color var(--transition-fast);
}

.category-badge {
    flex-shrink: 0;
    min-width: 24px;
    padding: 2px 8px;
    background: var(--bg-input);
    border-radius: var(--border-radius-full);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-align: center;
}

.category-item.active .category-badge {
    background: var(--accent-primary);
    color: #fff;
}

/* Kategori Sağ Taraf (Badge + Sil Butonu) */
.category-right {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.category-delete-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 0;
    height: 26px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    opacity: 0;
    overflow: hidden;
    padding: 0;
    transition: all var(--transition-fast);
}

.category-delete-btn svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

.category-item:hover .category-delete-btn {
    opacity: 1;
    width: 26px;
}

.category-delete-btn:hover {
    color: var(--accent-danger);
    background: rgba(239, 68, 68, 0.1);
}

/* ================================================
   İÇERİK ALANI
   ================================================ */

.content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 24px 32px;
    max-width: 1400px;
}

/* İstatistik Kartları */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    transition: all var(--transition-base);
}

.stat-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-color-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius-md);
    background: color-mix(in srgb, var(--stat-color) 12%, transparent);
    flex-shrink: 0;
}

.stat-icon svg {
    width: 22px;
    height: 22px;
    color: var(--stat-color);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.03em;
}

.stat-label {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

/* ================================================
   KİMLİK BİLGİLERİ KARTLARI
   ================================================ */

.credentials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 16px;
}

.credential-card {
    position: relative;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    cursor: pointer;
    transition: all var(--transition-base);
    animation: fadeSlideUp 0.35s ease forwards;
    opacity: 0;
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.credential-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-color-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 14px;
}

.card-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
}

.card-category-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 6px currentColor;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.credential-card:hover .card-actions {
    opacity: 1;
}

.card-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: var(--border-radius-sm);
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.card-action-btn svg {
    width: 15px;
    height: 15px;
}

.card-action-btn:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

.card-action-btn.favorite-active {
    color: var(--accent-warning);
}

.card-action-btn.btn-delete:hover {
    color: var(--accent-danger);
    background: rgba(239, 68, 68, 0.08);
}

/* Kart İçerik Alanları */
.card-url {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 14px;
    font-size: 0.78rem;
    color: var(--text-tertiary);
    overflow: hidden;
}

.card-url svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

.card-url span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-fields {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.card-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-input);
    border-radius: var(--border-radius-sm);
    transition: background var(--transition-fast);
}

.card-field:hover {
    background: var(--bg-input-focus);
}

.card-field-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex: 1;
}

.card-field-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
    margin-bottom: 1px;
}

.card-field-value {
    font-size: 0.84rem;
    color: var(--text-primary);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-field-value.masked {
    font-family: monospace;
    letter-spacing: 2px;
}

.card-field-copy {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
    margin-left: 8px;
}

.card-field-copy svg {
    width: 14px;
    height: 14px;
}

.card-field-copy:hover {
    background: var(--accent-primary-light);
    color: var(--accent-primary);
}

.card-field-copy.copied {
    color: var(--accent-success);
}

/* Kart Alt Bilgi */
.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.card-category-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: var(--border-radius-full);
    font-size: 0.7rem;
    font-weight: 600;
}

.card-category-tag svg {
    width: 12px;
    height: 12px;
}

.card-date {
    font-size: 0.7rem;
    color: var(--text-tertiary);
}

/* ================================================
   YÜKLEME VE BOŞ DURUM
   ================================================ */

.loading-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-tertiary);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
    color: var(--text-tertiary);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 20px;
    opacity: 0.4;
}

.empty-state h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.88rem;
    max-width: 360px;
}

.hidden {
    display: none !important;
}

/* ================================================
   MODAL
   ================================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-overlay);
    backdrop-filter: blur(6px);
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    width: 90%;
    max-width: 640px;
    max-height: 90vh;
    background: var(--bg-glass-strong);
    backdrop-filter: blur(24px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-sm {
    max-width: 460px;
}

.modal-xs {
    max-width: 400px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
}

.modal-header-danger {
    background: rgba(239, 68, 68, 0.06);
}

.modal-header-danger h2 {
    color: var(--accent-danger);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}

/* ================================================
   FORM
   ================================================ */

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group label.checkbox-label {
    display: inline-flex;
    margin-bottom: 0;
}

.required {
    color: var(--accent-danger);
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="url"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.875rem;
    outline: none;
    transition: all var(--transition-base);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--border-color-focus);
    box-shadow: 0 0 0 3px var(--accent-primary-light);
    background: var(--bg-input-focus);
}

.form-group select option {
    background: var(--bg-card);
    color: var(--text-primary);
}

.form-group textarea {
    resize: vertical;
    min-height: 60px;
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b6b82' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-group input[type="color"] {
    width: 100%;
    height: 42px;
    padding: 4px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background: var(--bg-input);
    cursor: pointer;
}

.form-group-sm {
    max-width: 160px;
}

/* Giriş Alanları + Aksiyon */
.input-with-action {
    display: flex;
    gap: 4px;
}

.input-with-action input {
    flex: 1;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.copy-btn,
.toggle-visibility-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    border: 1px solid var(--border-color);
    border-left: none;
    background: var(--bg-input);
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.toggle-visibility-btn {
    border-radius: 0;
}

.copy-btn {
    border-top-right-radius: var(--border-radius-sm);
    border-bottom-right-radius: var(--border-radius-sm);
}

.copy-btn:hover,
.toggle-visibility-btn:hover {
    background: var(--accent-primary-light);
    color: var(--accent-primary);
}

.copy-btn svg,
.toggle-visibility-btn svg {
    width: 16px;
    height: 16px;
}

/* Checkbox */
.form-check {
    margin-top: 8px;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-secondary);
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '';
    width: 5px;
    height: 10px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg) translateY(-1px);
}

/* Form Bölüm Başlığı */
.form-section {
    margin-bottom: 16px;
    padding: 16px;
    background: var(--bg-input);
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
}

.form-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.form-section-header h3 {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
}

.field-presets {
    display: flex;
    gap: 6px;
}

.preset-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-tertiary);
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.preset-btn svg {
    width: 13px;
    height: 13px;
}

.preset-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: var(--accent-primary-light);
}

.preset-btn.active {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: var(--accent-primary-light);
}

.credential-field {
    margin-bottom: 8px;
}

.credential-field .form-row {
    gap: 10px;
}

.credential-field .form-group {
    margin-bottom: 0;
}

/* ================================================
   DETAY PANELİ (Sağdan Açılır)
   ================================================ */

.detail-panel {
    position: fixed;
    top: var(--header-height);
    right: 0;
    width: 420px;
    height: calc(100vh - var(--header-height));
    background: var(--bg-glass-strong);
    backdrop-filter: blur(20px);
    border-left: 1px solid var(--border-color);
    z-index: 90;
    display: flex;
    flex-direction: column;
    animation: slideInRight 0.3s ease;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.15);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.detail-panel.hidden {
    display: none !important;
}

.detail-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.detail-panel-header h2 {
    font-size: 1rem;
    font-weight: 700;
}

.detail-panel-body {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.detail-panel-footer {
    display: flex;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}

.detail-panel-footer .btn {
    flex: 1;
    justify-content: center;
}

/* Detay Bilgi Blokları */
.detail-url {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    background: var(--bg-input);
    border-radius: var(--border-radius-sm);
    margin-bottom: 20px;
    font-size: 0.84rem;
    color: var(--accent-info);
    word-break: break-all;
}

.detail-url svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.detail-url a {
    color: inherit;
    text-decoration: none;
}

.detail-url a:hover {
    text-decoration: underline;
}

.detail-field-group {
    margin-bottom: 14px;
}

.detail-field {
    padding: 14px 16px;
    background: var(--bg-input);
    border-radius: var(--border-radius-md);
    margin-bottom: 10px;
    transition: background var(--transition-fast);
}

.detail-field:hover {
    background: var(--bg-input-focus);
}

.detail-field-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.detail-field-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
}

.detail-field-actions {
    display: flex;
    gap: 2px;
}

.detail-field-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-all;
}

.detail-notes {
    margin-top: 20px;
    padding: 14px 16px;
    background: var(--bg-input);
    border-radius: var(--border-radius-md);
    border-left: 3px solid var(--accent-primary);
}

.detail-notes-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
    margin-bottom: 6px;
}

.detail-notes-content {
    font-size: 0.84rem;
    color: var(--text-secondary);
    line-height: 1.5;
    white-space: pre-wrap;
}

.detail-meta {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.detail-meta-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* ================================================
   TOAST BİLDİRİMLER
   ================================================ */

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: var(--bg-glass-strong);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-lg);
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--text-primary);
    pointer-events: auto;
    animation: toastIn 0.3s ease forwards;
    min-width: 280px;
}

.toast.toast-exit {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(40px);
    }
}

.toast svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.toast-success svg {
    color: var(--accent-success);
}

.toast-error svg {
    color: var(--accent-danger);
}

.toast-info svg {
    color: var(--accent-info);
}

/* ================================================
   DUYARLI TASARIM
   ================================================ */

/* Hamburger Menü Butonu (Mobilde görünür) */
.btn-hamburger {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: var(--border-radius-md);
    background: var(--bg-input);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-base);
    flex-shrink: 0;
}

.btn-hamburger svg {
    width: 22px;
    height: 22px;
}

.btn-hamburger:hover {
    background: var(--bg-input-focus);
    color: var(--text-primary);
}

/* Sidebar Arka Plan Örtüsü (Mobil) */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 49;
    background: var(--bg-overlay);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.sidebar-backdrop.visible {
    opacity: 1;
}

/* --- TABLET (≤ 1100px) --- */
@media (max-width: 1100px) {
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .credentials-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

/* --- MOBİL MENÜ (≤ 900px) --- */
@media (max-width: 900px) {
    /* Hamburger butonu göster */
    .btn-hamburger {
        display: flex;
    }

    /* Header düzenlemesi */
    .header-nav {
        padding: 0 12px;
        gap: 8px;
    }

    .header-center {
        margin: 0 8px;
        flex: 1;
        min-width: 0;
    }

    .search-shortcut {
        display: none;
    }

    .search-input {
        padding: 8px 12px 8px 38px;
        font-size: 0.84rem;
    }

    /* Header kullanıcı bilgisi - sadece çıkış ikonu göster */
    .header-user .user-name {
        display: none;
    }

    .header-user {
        border-left: none;
        padding-left: 0;
        margin-left: 0;
    }

    /* Sidebar - çekmece (drawer) olarak davranır */
    .sidebar {
        transform: translateX(-100%);
        z-index: 55;
        box-shadow: none;
        transition: transform var(--transition-base), background var(--transition-slow), border-color var(--transition-slow);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 8px 0 30px rgba(0, 0, 0, 0.3);
    }

    /* Sidebar açıkken backdrop göster */
    .sidebar.open ~ .sidebar-backdrop,
    .sidebar-backdrop.visible {
        display: block;
    }

    /* İçerik - tam genişlik */
    .content {
        margin-left: 0;
        padding: 20px 16px;
    }

    /* Kartlar - tek sütun */
    .credentials-grid {
        grid-template-columns: 1fr;
    }

    /* Detay paneli - tam genişlik */
    .detail-panel {
        width: 100%;
    }
}

/* --- KÜÇÜK MOBİL (≤ 600px) --- */
@media (max-width: 600px) {
    /* Header */
    .header-nav {
        padding: 0 10px;
        gap: 6px;
    }

    /* Logo metnini gizle, sadece ikon göster */
    .logo-text {
        display: none;
    }

    /* Yeni Kayıt butonunda metin gizle, sadece + ikonu göster */
    #btn-add-credential span {
        display: none;
    }

    #btn-add-credential {
        padding: 10px 12px;
    }

    /* İstatistik kartları */
    .stats-row {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stat-card {
        padding: 14px;
    }

    .stat-value {
        font-size: 1.2rem;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
    }

    .stat-icon svg {
        width: 18px;
        height: 18px;
    }

    /* İçerik alanı */
    .content {
        padding: 14px 10px;
    }

    /* Kartlar */
    .credential-card {
        padding: 16px;
    }

    .card-actions {
        opacity: 1;
    }

    .card-title {
        font-size: 0.88rem;
    }

    /* Modallar */
    .modal {
        width: 95%;
        max-height: 92vh;
        border-radius: var(--border-radius-lg);
    }

    .modal-header,
    .modal-body {
        padding-left: 16px;
        padding-right: 16px;
    }

    .modal-footer {
        padding: 12px 16px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .field-presets {
        flex-wrap: wrap;
    }

    .preset-btn {
        font-size: 0.72rem;
        padding: 4px 8px;
    }

    /* Sidebar düzeni */
    .sidebar {
        width: 85vw;
        max-width: 320px;
    }
}

/* --- ÇOK KÜÇÜK EKR. (≤ 380px) --- */
@media (max-width: 380px) {
    .stats-row {
        grid-template-columns: 1fr;
    }

    .header-center {
        display: none;
    }

    .sidebar {
        width: 100vw;
        max-width: 100vw;
    }
}

