/* ===========================
   CSS Variables & Reset
   =========================== */
:root {
    /* Premium Sleek Dark Theme */
    --bg-primary: #12131a;
    --bg-secondary: #1a1b26;
    --bg-tertiary: #222436;
    --bg-hover: #2b2e46;
    --bg-active: #323654;
    --bg-card: #1f2132;

    --text-primary: #f0f0f7;
    --text-secondary: #a9a8c0;
    --text-muted: #6e7090;
    --text-placeholder: #525470;

    --accent: #7c6cf0;
    --accent-hover: #9080ff;
    --accent-glow: rgba(124, 108, 240, 0.2);
    --accent-soft: rgba(124, 108, 240, 0.08);

    --border: rgba(255, 255, 255, 0.05);
    --border-light: rgba(255, 255, 255, 0.08);

    --danger: #ff5e73;
    --danger-hover: #ff7588;
    --danger-soft: rgba(255, 94, 115, 0.08);

    --success: #10b981;
    --success-soft: rgba(16, 185, 129, 0.08);

    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.45);
    --shadow-glow: 0 0 24px var(--accent-glow);

    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 24px;

    --sidebar-width: 340px;
    --toolbar-height: 52px;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);

    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

/* Light Theme */
[data-theme="light"] {
    --bg-primary: #f5f5f7;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f0f0f2;
    --bg-hover: #e8e8ec;
    --bg-active: #dddde3;
    --bg-card: #ffffff;

    --text-primary: #1a1a2e;
    --text-secondary: #5a5a72;
    --text-muted: #8a8a9e;
    --text-placeholder: #b0b0c0;

    --accent: #6c5ce7;
    --accent-hover: #7c6cf0;
    --accent-glow: rgba(108, 92, 231, 0.2);
    --accent-soft: rgba(108, 92, 231, 0.08);

    --border: rgba(0, 0, 0, 0.06);
    --border-light: rgba(0, 0, 0, 0.1);

    --danger-soft: rgba(231, 76, 94, 0.08);
    --success-soft: rgba(52, 211, 153, 0.08);

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 20px var(--accent-glow);
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-main);
    background: var(--bg-primary);
    color: var(--text-primary);
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
    transition: background var(--transition), color var(--transition);
}

::selection {
    background: var(--accent);
    color: white;
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-active); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===========================
   Sidebar
   =========================== */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    transition: background var(--transition);
    z-index: 100;
    position: relative;
}

.sidebar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(to bottom, transparent, var(--accent-glow), transparent);
    opacity: 0.3;
    pointer-events: none;
}

.sidebar-header {
    padding: 18px 18px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.logo h1 {
    font-size: 1.1rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

/* Theme Toggle */
.btn-theme {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    min-height: 38px;
}

.btn-theme:hover { background: var(--bg-hover); color: var(--accent); }

/* Search */
.search-box {
    margin: 0 14px 10px;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-box input {
    width: 100%;
    padding: 10px 14px 10px 38px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.85rem;
    transition: var(--transition);
    outline: none;
}

.search-box input::placeholder { color: var(--text-placeholder); }
.search-box input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* Color Filter */
.color-filter {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 14px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.color-filter-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    padding: 0;
    color: var(--text-muted);
}

.color-filter-btn span {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: block;
}

.color-filter-btn:hover { transform: scale(1.15); }
.color-filter-btn.active { border-color: var(--accent); transform: scale(1.15); }
.color-filter-btn.active svg { color: var(--accent); }

/* New Note Button */
.btn-new-note {
    margin: 0 14px 12px;
    padding: 12px 16px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-main);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
    box-shadow: 0 4px 12px var(--accent-glow);
    min-height: 46px;
    position: relative;
    overflow: hidden;
}

.btn-new-note::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 200%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.5s;
}

.btn-new-note:hover::before { left: 100%; }
.btn-new-note:hover { transform: translateY(-1px); background: var(--accent-hover); box-shadow: 0 6px 16px var(--accent-glow); }
.btn-new-note:active { transform: translateY(0); }

/* Notes List */
.notes-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 10px;
}

.note-item {
    padding: 16px 16px 16px 20px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    margin-bottom: 8px;
    border: 1px solid var(--border);
    border-left: 5px solid var(--note-color, var(--border));
    background: color-mix(in srgb, var(--note-color, var(--accent)) 6%, var(--bg-secondary));
    position: relative;
    animation: slideIn 0.3s ease forwards;
    box-shadow: var(--shadow-sm);
}

.note-item:hover { 
    background: color-mix(in srgb, var(--note-color, var(--accent)) 12%, var(--bg-secondary));
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    border-color: color-mix(in srgb, var(--note-color, var(--accent)) 20%, var(--border-light));
}

.note-item.active { 
    background: color-mix(in srgb, var(--note-color, var(--accent)) 18%, var(--bg-secondary)); 
    border-color: var(--note-color, var(--accent));
    box-shadow: 0 4px 18px color-mix(in srgb, var(--note-color, var(--accent)) 15%, transparent);
}

.note-item-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.note-item-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.note-item-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    letter-spacing: -0.01em;
}

.note-item-pin {
    color: var(--accent);
    flex-shrink: 0;
    opacity: 0.9;
}

.note-item-preview {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 8px;
    padding-left: 22px;
    line-height: 1.4;
}

.note-item-date {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    padding-left: 22px;
    display: block;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 10px 14px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.footer-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px 6px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    min-height: 38px;
    min-width: 0;
    white-space: nowrap;
}

.footer-btn svg { flex-shrink: 0; }

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

/* ===========================
   Settings Panel
   =========================== */
.settings-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-light);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 0 18px 18px;
    z-index: 50;
    transform: translateY(100%);
    transition: transform var(--transition-slow);
    box-shadow: 0 -8px 32px rgba(0,0,0,0.3);
    max-height: 85vh;
    overflow-y: auto;
}

.settings-panel.open { transform: translateY(0); }

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0 12px;
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    z-index: 1;
}

.settings-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.settings-close {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 36px;
}

.settings-close:hover { background: var(--bg-hover); color: var(--text-primary); }

.settings-group {
    margin-bottom: 18px;
}

.settings-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Font Options */
.font-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.font-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 6px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
}

.font-option:hover { border-color: var(--text-muted); }

.font-option.active {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
}

.font-preview {
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1;
    color: var(--text-primary);
}

.font-option.active .font-preview { color: var(--accent); }

.font-name {
    font-size: 0.65rem;
    font-weight: 500;
}

/* Font Size Slider */
.settings-slider {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-tertiary);
    border-radius: 10px;
    outline: none;
    border: none;
    cursor: pointer;
}

.settings-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 0 8px var(--accent-glow);
    transition: var(--transition);
}

.settings-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 0 14px var(--accent-glow);
}

.settings-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: none;
    box-shadow: 0 0 8px var(--accent-glow);
}

/* Accent Color Options */
.accent-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.accent-option {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    padding: 0;
    background: var(--dot-color);
    position: relative;
}

.accent-option:hover { transform: scale(1.15); }

.accent-option.active {
    border-color: var(--text-primary);
    box-shadow: 0 0 12px var(--dot-color);
}

.accent-option.active::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

/* Theme Options */
.theme-options {
    display: flex;
    gap: 8px;
}

.theme-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    min-height: 44px;
}

.theme-option:hover { border-color: var(--text-muted); }

.theme-option.active {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
}


/* ===========================
   Sidebar Overlay (Mobil)
   =========================== */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 99;
}

.sidebar-overlay.show { display: block; }

/* ===========================
   Mobile FAB
   =========================== */
.mobile-fab {
    display: none;
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 200;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    padding: 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
}

.mobile-fab:hover { background: var(--bg-hover); }

/* ===========================
   Main Content
   =========================== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    position: relative;
    background: var(--bg-primary);
    transition: background var(--transition);
}

.main-content::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 1px 1px, var(--border) 1px, transparent 0);
    background-size: 32px 32px;
    opacity: 0.25;
    pointer-events: none;
}

/* Empty State - Karşılama Ekranı */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; /* Ortaya hizala */
    height: 100%;
    padding: 40px;
    text-align: center;
    position: relative;
    z-index: 1;
    background: radial-gradient(circle at 50% 50%, rgba(124, 108, 240, 0.15) 0%, rgba(236, 72, 153, 0.06) 45%, transparent 75%);
}

.empty-state-icon {
    width: 120px; /* Boyut biraz büyütüldü */
    height: 120px;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    margin-bottom: 32px;
    border: 1px solid var(--accent); /* Renkli çerçeve */
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4), 0 0 35px rgba(124, 108, 240, 0.35); /* Çok daha canlı ışıma */
    animation: float 5s ease-in-out infinite;
    position: relative;
}

.empty-state-icon::after {
    content: '';
    position: absolute;
    inset: -12px;
    border-radius: calc(var(--radius-xl) + 12px);
    background: linear-gradient(135deg, var(--accent), #ec4899);
    opacity: 0.25; /* Parlaklık artırıldı */
    filter: blur(12px);
    z-index: -1;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(1.5deg); }
}

.empty-state h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 2.2rem;
    font-weight: 300;
    margin-bottom: 24px; /* Boşluk artırıldı */
    color: var(--text-primary);
    letter-spacing: -0.04em;
    line-height: 1.2;
}

.empty-state p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    max-width: 380px;
    line-height: 1.7;
    margin-bottom: 22px; /* Butona yaklaştırıldı */
}



.btn-create-first {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 36px;
    background: linear-gradient(135deg, var(--accent), #9080ff);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-main);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 8px 24px rgba(124, 108, 240, 0.35), 0 0 30px rgba(124, 108, 240, 0.15);
    min-height: 52px;
}

.btn-create-first:hover { 
    transform: translateY(-3px); 
    box-shadow: 0 12px 28px rgba(124, 108, 240, 0.5), 0 0 40px rgba(124, 108, 240, 0.25);
}

.btn-create-first:active {
    transform: translateY(-1px);
}

/* ===========================
   Editor
   =========================== */
.editor-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    z-index: 1;
    animation: fadeIn 0.25s ease;
}

/* Editor Top Bar */
.editor-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
    transition: background var(--transition);
    min-height: 52px;
}

.btn-back {
    display: none !important; /* Masaüstünde kesin olarak gizle, çakışmayı önle */
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 8px 12px 8px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    min-height: 40px;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-family: var(--font-main);
    font-size: 0.85rem;
    font-weight: 500;
}

.btn-back-text {
    display: inline-block;
    font-size: 0.85rem;
}

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

.editor-topbar-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    min-height: 38px;
}

.btn-icon:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-icon.pinned { color: var(--accent); }
.btn-delete:hover { background: var(--danger-soft); color: var(--danger); }

/* Color Bar */
.editor-color-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
    transition: background var(--transition);
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}

.color-dot {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2.5px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    padding: 0;
    flex-shrink: 0;
}

.color-dot:hover { transform: scale(1.2); }
.color-dot.active { border-color: var(--text-primary); box-shadow: 0 0 10px rgba(0,0,0,0.2); transform: scale(1.15); }

/* Title */
.editor-title {
    padding: 20px 24px 6px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 1.6rem;
    font-weight: 700;
    outline: none;
    letter-spacing: -0.03em;
    line-height: 1.3;
    transition: color var(--transition);
}

.editor-title::placeholder { color: var(--text-placeholder); }

/* Body */
.editor-body {
    flex: 1;
    padding: 8px 24px 24px;
    overflow-y: auto;
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.8;
    outline: none;
    min-height: 120px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    transition: color var(--transition);
}

.editor-body:empty::before {
    content: attr(data-placeholder);
    color: var(--text-placeholder);
    pointer-events: none;
}

.editor-body b, .editor-body strong { font-weight: 700; }
.editor-body i, .editor-body em { font-style: italic; color: var(--accent-hover); }
.editor-body u { text-decoration-color: var(--accent); text-underline-offset: 3px; }

.editor-body h1, .editor-body h2, .editor-body h3 {
    font-weight: 700;
    margin: 12px 0 6px;
    line-height: 1.3;
}

.editor-body h1 { font-size: 1.5em; }
.editor-body h2 { font-size: 1.3em; }
.editor-body h3 { font-size: 1.1em; }

.editor-body ul, .editor-body ol { padding-left: 24px; margin: 8px 0; }
.editor-body li { margin-bottom: 4px; }

.editor-body img {
    max-width: 100%;
    border-radius: var(--radius-sm);
    margin: 8px 0;
    box-shadow: var(--shadow-sm);
}

.editor-body a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Status Bar */
.editor-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
    font-size: 0.72rem;
    color: var(--text-muted);
    transition: background var(--transition);
}

.save-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--success);
    font-weight: 500;
}

.save-indicator.saving { color: var(--accent); }

.char-count {
    font-family: var(--font-mono);
    font-size: 0.7rem;
}

/* Toolbar (Bottom) */
.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 8px 12px;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
    overflow-x: auto;
    transition: background var(--transition);
    -webkit-overflow-scrolling: touch;
}

.toolbar-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 9px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
    flex-shrink: 0;
}

.toolbar-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.toolbar-btn.active { background: var(--accent-soft); color: var(--accent); }

.toolbar-divider {
    width: 1px;
    height: 24px;
    background: var(--border);
    margin: 0 4px;
    flex-shrink: 0;
}

/* ===========================
   Modals
   =========================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    padding: 16px;
}

.modal-overlay.show { opacity: 1; visibility: visible; }

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    transform: scale(0.92) translateY(10px);
    transition: transform var(--transition-slow);
    box-shadow: var(--shadow-lg);
}

.modal-overlay.show .modal { transform: scale(1) translateY(0); }

.modal-icon {
    width: 52px;
    height: 52px;
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
}

.modal-icon.danger { background: var(--danger-soft); color: var(--danger); }

.modal h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 6px; }
.modal p { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.5; margin-bottom: 20px; }

.modal-input {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.88rem;
    outline: none;
    transition: var(--transition);
    margin-bottom: 10px;
}

.modal-input::placeholder { color: var(--text-placeholder); }
.modal-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* Modal Tabs */
.modal-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 14px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: 3px;
}

.modal-tab {
    flex: 1;
    padding: 8px 12px;
    background: none;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.modal-tab.active { background: var(--accent); color: white; }
.modal-tab:not(.active):hover { color: var(--text-primary); }

.modal-tab-content { display: none; }
.modal-tab-content.active { display: block; }

/* File Upload */
.file-upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px;
    border: 2px dashed var(--border-light);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 10px;
}

.file-upload-area:hover { border-color: var(--accent); color: var(--accent); }
.file-upload-area span { font-size: 0.82rem; }

.file-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
}

.file-preview img {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
}

.file-preview span {
    font-size: 0.8rem;
    color: var(--text-secondary);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Modal Actions */
.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 18px;
}

.btn-modal-cancel {
    padding: 10px 22px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    min-height: 44px;
}

.btn-modal-cancel:hover { background: var(--bg-hover); }

.btn-modal-confirm {
    padding: 10px 22px;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-family: var(--font-main);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    min-height: 44px;
}

.btn-modal-confirm:hover { background: var(--accent-hover); }
.btn-modal-confirm.danger { background: var(--danger); }
.btn-modal-confirm.danger:hover { background: var(--danger-hover); }

/* ===========================
   Toast
   =========================== */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(60px);
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 12px 22px;
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    opacity: 0;
    transition: all var(--transition-slow);
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-message { font-size: 0.85rem; font-weight: 500; color: var(--text-primary); }
.toast-icon { font-size: 1.1rem; }

/* ===========================
   Print Styles
   =========================== */
@media print {
    .sidebar, .mobile-fab, .sidebar-overlay,
    .editor-toolbar, .editor-topbar, .editor-color-bar,
    .editor-status, .toast, .modal-overlay { display: none !important; }

    .main-content { background: white !important; }
    .main-content::before { display: none !important; }

    .editor-container { animation: none !important; }
    .editor-title { color: #000 !important; padding: 20px 0 8px !important; }
    .editor-body { color: #000 !important; padding: 8px 0 !important; }
    .editor-body a { color: #0066cc !important; }
    .editor-body img { max-width: 80% !important; }
}

/* ===========================
   Responsive - Mobile
   =========================== */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        height: 100dvh;
        transform: translateX(-100%);
        z-index: 300;
        box-shadow: var(--shadow-lg);
        transition: transform var(--transition-slow);
    }

    .sidebar.open { transform: translateX(0); }

    .mobile-fab { display: flex; }
    .btn-back { display: none !important; }
    .btn-back-text { display: none !important; }

    .editor-title { padding: 16px 18px 4px; font-size: 1.3rem; }
    .editor-body { padding: 6px 18px 20px; }
    .editor-status { padding: 8px 18px; }

    .editor-topbar-actions {
        gap: 2px !important;
    }
    
    .editor-topbar-actions .btn-icon {
        min-width: 32px !important;
        min-height: 32px !important;
        padding: 6px !important;
    }

    .btn-quick-new {
        width: 32px !important;
        height: 32px !important;
        margin-right: 2px !important;
    }

    .editor-toolbar {
        padding: 6px 8px;
        padding-bottom: max(6px, env(safe-area-inset-bottom));
    }

    .editor-color-bar { 
        padding: 8px 14px; 
        margin-top: 10px !important; /* Hamburger butonunun altına binmeyi önle */
    }
}


@media (max-width: 480px) {
    :root { --sidebar-width: 300px; }
    .logo h1 { font-size: 1rem; }
    .editor-title { font-size: 1.2rem; }
}

/* ===========================
   Animations
   =========================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-8px); }
    to { opacity: 1; transform: translateX(0); }
}

.note-item:nth-child(1) { animation-delay: 0s; }
.note-item:nth-child(2) { animation-delay: 0.03s; }
.note-item:nth-child(3) { animation-delay: 0.06s; }
.note-item:nth-child(4) { animation-delay: 0.09s; }
.note-item:nth-child(5) { animation-delay: 0.12s; }
.note-item:nth-child(6) { animation-delay: 0.15s; }
.note-item:nth-child(7) { animation-delay: 0.18s; }
.note-item:nth-child(8) { animation-delay: 0.21s; }

/* ===========================
   Context Menu (Sağ Tık)
   =========================== */
.context-menu {
    position: fixed;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    z-index: 10000;
    display: none;
    flex-direction: column;
    min-width: 150px;
    animation: fadeIn 0.15s ease-out;
}

.context-menu-item {
    background: none;
    border: none;
    color: var(--text-primary);
    padding: 8px 12px;
    font-family: var(--font-main);
    font-size: 0.8rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.context-menu-item:hover {
    background: var(--bg-hover);
}

.context-menu-item.danger {
    color: var(--danger);
}

.context-menu-item.danger:hover {
    background: var(--danger-soft);
}

/* Welcome Badge */
.welcome-badge {
    background: var(--accent-soft);
    color: var(--accent);
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 800; /* Daha kalın ve belirgin */
    letter-spacing: 0.12em; /* Geniş harf aralığı */
    text-transform: uppercase;
    margin-bottom: 24px;
    border: 1.5px solid var(--accent); /* Renk vurgusu belirginleştirildi */
    box-shadow: 0 4px 14px var(--accent-glow);
    display: inline-block;
}

/* Hızlı Yeni Not Butonu */
.btn-quick-new {
    background: var(--accent-soft) !important;
    color: var(--accent) !important;
    border-radius: 50% !important;
    width: 36px;
    height: 36px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: all var(--transition) !important;
    box-shadow: 0 4px 12px var(--accent-glow) !important;
    border: 1px solid rgba(124, 108, 240, 0.25) !important;
    margin-right: 6px;
}

.btn-quick-new:hover {
    transform: scale(1.1);
    background: var(--accent) !important;
    color: white !important;
    box-shadow: 0 6px 16px var(--accent-glow) !important;
}

.btn-quick-new svg {
    stroke-width: 2.5px;
}




