/* ==========================================================================
   NOTIFORGE — VIEWS: ORTAK BİLEŞENLER & DETAY BLOK MODALLARI
   Genel kartlar, sekmeler, formlar, not/görev/kelime detay modal katmanları
   ve timeline spine blokları.
   ========================================================================== */

/* Genel Kartlar */
.card {
    background-color: var(--bg-secondary);
    border-radius: var(--r-lg);
    padding: 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Kütüphane & Ekleme Ekranları İçin Sekmeler (Tabs) */
.view-tabs {
    display: flex;
    background-color: var(--bg-secondary);
    padding: 4px;
    border-radius: var(--r-md);
    margin-bottom: 1.25rem;
    gap: 4px;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn.active {
    background-color: var(--accent);
    color: var(--bg-primary);
}

/* Form Elemanları (Ekleme Ekranı) */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    padding: 12px;
    border-radius: var(--r-sm);
    border: 1px solid var(--border);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
}

.form-control:focus {
    border-color: var(--accent);
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background-color: var(--accent);
    color: var(--bg-primary);
    border: none;
    border-radius: var(--r-sm);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
}

/* Rozetler (Badge) */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: var(--r-xs);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-period { background-color: rgba(56, 189, 248, 0.2); color: var(--accent-text); }
.badge-count { background-color: rgba(var(--success-rgb), 0.2); color: var(--success); }



/* Pop-up Modal Stilleri */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--overlay);
    backdrop-filter: blur(12px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 1rem;
}


.modal-card {
    background-color: var(--bg-secondary);
    border-radius: var(--r-xl);
    padding: 1.5rem;
    width: 100%;
    max-width: 750px;
    max-height: 88vh; /* Ekran yüksekliğinin en fazla %88'ini kaplasın */
    overflow-y: auto;  /* İçerik taşarsa modal içinde dikey kaydırma çubuğu çıksın 📜 */
    position: relative;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    -webkit-overflow-scrolling: touch; /* Mobilde yumuşak parmak kaydırması */
}
.modal-header-actions {
    position: absolute;
    top: 14px;
    right: 16px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
}

.modal-extra-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
}

.modal-action-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--accent-soft);
    border: 1px solid var(--border-strong);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    pointer-events: auto;
    position: relative;
    z-index: 101;
    transition: background .18s ease, color .18s ease, border-color .18s ease, transform .15s ease, box-shadow .15s ease;
}

.modal-action-btn svg,
.modal-close svg {
    pointer-events: none;
}

.modal-action-btn:hover {
    background: var(--accent-soft);
    color: var(--accent-text);
    transform: scale(1.06);
}

.modal-action-btn.active-pin {
    background: rgba(var(--warning-rgb), 0.16);
    border-color: rgba(var(--warning-rgb), 0.45);
    color: color-mix(in srgb, var(--warning) 62%, var(--text));
}

.modal-action-btn.active-pin:hover {
    background: rgba(var(--warning-rgb), 0.25);
    border-color: var(--warning);
}

.modal-action-btn.active-fav {
    background: rgba(var(--danger-rgb), 0.12);
    border-color: rgba(var(--danger-rgb), 0.35);
    color: var(--danger);
}

.modal-action-btn.active-fav:hover {
    background: rgba(var(--danger-rgb), 0.22);
    border-color: var(--danger);
}

.modal-action-btn.delete-btn:hover {
    background: rgba(var(--danger-rgb), 0.12);
    border-color: rgba(var(--danger-rgb), 0.3);
    color: var(--danger);
}

.modal-close {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--accent-soft);
    border: 1px solid var(--border-strong);
    color: var(--text-muted);
    font-size: 1.35rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    pointer-events: auto;
    position: relative;
    z-index: 101;
    transition: background .18s ease, color .18s ease, transform .15s ease;
}

.modal-close:hover {
    background: var(--accent-soft);
    color: var(--accent-text);
    transform: scale(1.06);
}

/* Not, Görev ve Kelime detayında içerik ve eylemleri tutarlı, taranabilir katmanlar halinde sunar. */
.note-modal-card,
.task-modal-card,
.word-modal-card {
    max-width: 860px;
    padding: 0;
    overflow: hidden;
    border-radius: var(--r-xl);
    background: var(--surface);
}

.task-modal-card {
    max-width: 720px;
}

.word-modal-card {
    max-width: 680px;
}

.note-modal-card #modal-body,
.task-modal-card #modal-body,
.word-modal-card #modal-body {
    max-height: 88vh;
    overflow-y: auto;
    padding: 28px 30px 34px;
}

.note-modal-card .modal-header-actions,
.task-modal-card .modal-header-actions,
.word-modal-card .modal-header-actions {
    top: 18px;
    right: 20px;
    z-index: 100;
}

.note-detail,
.task-detail,
.word-detail { display: flex; flex-direction: column; gap: 20px; }

.note-detail__header,
.task-detail__header,
.word-detail__header {
    position: static !important;
    top: auto !important;
    z-index: auto !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    padding: 2px 180px 16px 0;
    border-bottom: 1px solid var(--border);
    display: block !important;
    background: transparent;
    height: auto;
}

.note-detail__label, .note-ai-toolbar__eyebrow, .note-content-section__heading span {
    display: block;
    color: var(--text-muted);
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .09em;
}

.note-detail__header h3,
.task-detail__header h3,
.word-detail__header h3 {
    margin: 6px 0 10px;
    color: var(--accent-ink);
    font-family: var(--font-heading);
    font-size: clamp(1.35rem, 3vw, 1.85rem);
    line-height: 1.28;
}

.note-detail__header h3::first-letter { color: var(--accent-text); }

.note-detail-editable-title {
    cursor: text;
    outline: none !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    caret-color: var(--accent-text);
    word-break: break-word;
    padding: 0;
    margin: 6px 0 10px;
}

.note-detail-editable-title:empty:before {
    content: attr(data-placeholder);
    color: var(--text-muted);
    opacity: 0.5;
    pointer-events: none;
}

.note-ai-toolbar {
    padding: 10px 12px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--r-md);
    background: linear-gradient(115deg, var(--accent-soft) 0%, var(--surface) 76%);
    margin-bottom: 10px;
}
.note-ai-toolbar.is-processing { opacity: .62; pointer-events: none; }
.note-ai-toolbar__heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.note-ai-toolbar__state { padding: 2px 7px; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--text-muted); font-size: .65rem; font-weight: 700; }
.note-ai-toolbar__actions { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.note-ai-toolbar .ai-tool-btn {
    display: flex; align-items: center; justify-content: center; gap: 4px;
    min-height: 34px; padding: 5px 6px; border-radius: var(--r-sm);
    border: 1px solid var(--border-strong); background: rgba(var(--surface-rgb), .85);
    color: var(--accent-ink); font-size: .72rem; font-weight: 800; cursor: pointer;
    white-space: nowrap;
    transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.note-ai-toolbar .ai-tool-btn:hover { transform: translateY(-1px); background: var(--surface); border-color: #91ac98; box-shadow: 0 2px 6px rgba(var(--accent-rgb), 0.08); }

.note-content-section { padding-top: 2px; }
.note-content-section__heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 12px; }
.note-content-section__heading strong { display: block; margin-top: 3px; color: var(--accent-ink); font-size: .9rem; }
.note-content-section__heading small { color: var(--text-faint); font-size: .7rem; }

/* 🔗 CONNECTED CARDS & TIMELINE SPINE CONTAINER */
.blocks-timeline {
    position: relative;
    padding-left: 24px;
    margin-top: 6px;
}

.blocks-timeline::before {
    content: '';
    position: absolute;
    top: 18px;
    bottom: 20px;
    left: 8px;
    width: 2px;
    background: linear-gradient(180deg, var(--accent-soft-2) 0%, var(--accent-soft-2) 50%, var(--accent-soft-2) 100%);
    border-radius: 2px;
    z-index: 1;
}

/* 📄 BLOCK CARD STYLING */
.note-modal-card .note-block-card {
    position: relative;
    background: var(--surface) !important;
    padding: 10px 14px 12px 14px !important;
    margin-bottom: 8px !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--r-md) !important;
    box-shadow: 0 1px 4px rgba(42, 63, 46, 0.025);
    font-size: 0.84rem;
    transition: border-color .2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow .2s cubic-bezier(0.16, 1, 0.3, 1), transform .2s cubic-bezier(0.16, 1, 0.3, 1);
}

.note-modal-card .note-block-card:hover {
    border-color: var(--border-strong) !important;
    box-shadow: 0 4px 14px rgba(42, 63, 46, 0.05);
}

.note-modal-card .note-block-card .markdown-content {
    font-size: 0.84rem !important;
    line-height: 1.6 !important;
}

.note-modal-card .note-block-card p {
    font-size: 0.84rem !important;
    line-height: 1.6 !important;
    margin: 0 0 5px 0;
}
.note-modal-card .note-block-card p:last-child {
    margin-bottom: 0;
}

.note-modal-card .note-block-card ul,
.note-modal-card .note-block-card ol {
    margin: 3px 0 5px 0;
    padding-left: 18px;
    font-size: 0.84rem;
}

.note-modal-card .note-block-card li {
    font-size: 0.84rem !important;
    line-height: 1.55 !important;
    margin-bottom: 3px;
}

.note-modal-card .note-block-card h1,
.note-modal-card .note-block-card h2,
.note-modal-card .note-block-card h3,
.note-modal-card .note-block-card h4 {
    font-size: 0.94rem;
    font-weight: 700;
    margin: 5px 0 3px 0;
    line-height: 1.35;
    color: var(--accent-ink);
}

.note-modal-card .note-block-card blockquote {
    margin: 6px 0 8px 0;
    padding: 6px 12px;
    background: var(--accent-soft);
    border-left: 3px solid #709775;
    border-radius: var(--r-xs);
    color: var(--accent-ink);
    font-size: 0.82rem;
    line-height: 1.5;
}
.note-modal-card .note-block-card blockquote p {
    margin: 0;
    font-size: 0.82rem !important;
}

.note-modal-card .note-block-card strong {
    color: var(--accent-ink);
    font-weight: 700;
}

/* 💡 NOT DETAYI - AI İPUCU & ANLAM KUTUSU */
.note-ai-insight-box {
    background: rgba(var(--warning-rgb), 0.09);
    border: 1px solid rgba(var(--warning-rgb), 0.22);
    border-radius: var(--r-sm);
    padding: 12px 14px;
    margin-top: 10px;
    font-size: 0.85rem;
    font-weight: 500;
    color: color-mix(in srgb, var(--warning) 62%, var(--text));
    line-height: 1.6;
}

.note-ai-insight-box p {
    margin: 0 0 8px 0;
    line-height: 1.6;
    color: color-mix(in srgb, var(--warning) 62%, var(--text));
}

.note-ai-insight-box p:last-child {
    margin-bottom: 0;
}

.note-ai-insight-box strong,
.note-ai-insight-box b {
    color: color-mix(in srgb, var(--warning) 62%, var(--text));
    font-weight: 700;
}

.note-ai-insight-box ul,
.note-ai-insight-box ol {
    margin: 6px 0 8px 0;
    padding-left: 20px;
}

.note-ai-insight-box li {
    margin-bottom: 5px;
    line-height: 1.55;
    color: color-mix(in srgb, var(--warning) 62%, var(--text));
}

.note-ai-insight-box li:last-child {
    margin-bottom: 0;
}

.note-ai-insight-box code {
    background: rgba(var(--warning-rgb), 0.16);
    color: color-mix(in srgb, var(--warning) 62%, var(--text));
    padding: 2px 6px;
    border-radius: var(--r-xs);
    font-size: 0.85em;
    font-family: monospace;
    border: 1px solid rgba(var(--warning-rgb), 0.22);
}

.note-ai-insight-box .wikilink-badge {
    background: rgba(var(--warning-rgb), 0.18);
    color: color-mix(in srgb, var(--warning) 62%, var(--text));
    border: 1px solid rgba(var(--warning-rgb), 0.35);
    padding: 1px 7px;
    border-radius: var(--r-xs);
    cursor: pointer;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s ease;
}

.note-ai-insight-box .wikilink-badge:hover {
    background: rgba(var(--warning-rgb), 0.32);
    border-color: var(--warning);
    color: color-mix(in srgb, #451a03 62%, var(--text));
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(var(--warning-rgb), 0.2);
}

.note-ai-insight-box .wikilink-badge:active {
    transform: translateY(0);
}

/* 🔘 SPINE NODE (Düğüm Noktası ve Sürükleme Tutamacı) */
.block-spine-node {
    position: absolute;
    left: -24px;
    top: 14px;
    width: 18px;
    height: 18px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spine-dot {
    width: 14px;
    height: 14px;
    background: var(--surface);
    border: 2px solid #62826e;
    border-radius: 50%;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.spine-dot .dot-indicator {
    width: 4px;
    height: 4px;
    background: var(--accent);
    border-radius: 50%;
    transition: all 0.18s ease;
}

.spine-dot:hover {
    transform: scale(1.3);
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: 0 2px 6px rgba(var(--accent-rgb), 0.25);
}

.spine-dot:active {
    cursor: grabbing;
    transform: scale(1.15);
    background: var(--accent);
}
.spine-dot:active .dot-indicator {
    background: var(--surface);
}

/* 🏷️ BLOCK HEADER ROW */
.block-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    min-height: 24px;
}

.block-type-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    background: rgba(var(--accent-rgb), 0.06);
    border: 1px solid rgba(var(--accent-rgb), 0.12);
    padding: 2px 7px;
    border-radius: var(--r-xs);
    letter-spacing: 0.02em;
    user-select: none;
}

/* ⚡ HOVER QUICK ACTIONS BAR */
.block-quick-actions {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    opacity: 0;
    transform: translateY(-2px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    pointer-events: none;
}

.note-block-card:hover .block-quick-actions,
.note-block-card:focus-within .block-quick-actions,
.block-quick-actions.is-active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.btn-ai-trigger {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.12), rgba(var(--accent-rgb), 0.06));
    border: 1px solid rgba(var(--accent-rgb), 0.25);
    color: var(--accent-text);
    border-radius: var(--r-xs);
    padding: 3px 8px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 800;
    transition: all 0.16s ease;
}

.btn-ai-trigger:hover {
    background: rgba(var(--accent-rgb), 0.2);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.btn-edit-block, .btn-delete-block, .btn-move-block {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 24px !important;
    height: 24px !important;
    background: transparent !important;
    border: 1px solid transparent !important;
    border-radius: var(--r-xs) !important;
    cursor: pointer !important;
    padding: 0 !important;
    color: var(--text-muted) !important;
    transition: all 0.16s ease !important;
}

.btn-move-block:hover {
    background: rgba(var(--info-rgb), 0.1) !important;
    border-color: rgba(var(--info-rgb), 0.25) !important;
    color: var(--info) !important;
}

.btn-edit-block:hover {
    background: rgba(var(--accent-rgb), 0.1) !important;
    border-color: rgba(var(--accent-rgb), 0.2) !important;
    color: var(--accent-text) !important;
}

.btn-delete-block:hover {
    background: rgba(var(--danger-rgb), 0.1) !important;
    border-color: rgba(var(--danger-rgb), 0.2) !important;
    color: var(--danger) !important;
}

/* 📦 Move & Merge Modal Option Cards */
.move-option-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-md);
    cursor: pointer;
    transition: all 0.18s ease;
    user-select: none;
}

.move-option-card:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.08);
}

.move-option-card.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
    background: var(--surface);
    border-color: var(--border);
    transform: none !important;
    box-shadow: none !important;
}

.move-option-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.move-option-content {
    flex: 1;
    min-width: 0;
}

.move-option-title {
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--text-primary);
}

.move-option-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
    line-height: 1.35;
}

.move-option-arrow {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 700;
}


/* 💊 FLOATING AI PILL MENU */
.block-floating-ai-pill {
    position: absolute;
    top: -12px;
    right: 10px;
    z-index: 40;
    background: rgba(var(--surface-rgb), 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(var(--accent-rgb), 0.28);
    border-radius: var(--r-xl);
    padding: 4px 6px;
    box-shadow: 0 8px 24px rgba(42, 63, 46, 0.15), 0 2px 6px rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    gap: 4px;
    animation: aiPillSlide 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes aiPillSlide {
    from { opacity: 0; transform: translateY(-4px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.ai-pill-badge {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--accent-text);
    padding: 2px 6px;
    letter-spacing: 0.02em;
    user-select: none;
    border-right: 1px solid var(--border);
    margin-right: 2px;
}

.block-floating-ai-pill .inline-ai-action-btn,
.block-floating-ai-pill .inline-ai-split-btn {
    background: var(--surface);
    border: 1px solid var(--border-strong);
    padding: 3px 8px;
    border-radius: var(--r-xl);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-ink);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.14s ease;
}

.block-floating-ai-pill .inline-ai-action-btn:hover,
.block-floating-ai-pill .inline-ai-split-btn:hover {
    background: var(--accent-soft);
    border-color: #91ac98;
    color: var(--accent-ink);
    transform: translateY(-1px);
}

.block-floating-ai-pill .close-floating-ai-btn {
    background: none;
    border: none;
    color: var(--text-faint);
    cursor: pointer;
    font-weight: 800;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.14s ease;
}

.block-floating-ai-pill .close-floating-ai-btn:hover {
    color: var(--text);
}

/* 🌿 DRAFT & AI PROCESSING STATUS */
.block-draft-preview {
    margin-top: 8px;
    background: rgba(var(--success-rgb), 0.05);
    border: 1px solid rgba(var(--success-rgb), 0.35);
    padding: 10px 12px;
    border-radius: var(--r-sm);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.block-draft-preview .draft-title {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--success);
    display: flex;
    align-items: center;
    gap: 4px;
}

.block-draft-preview .draft-content {
    font-size: 0.88rem;
    color: var(--text-primary);
    line-height: 1.5;
    background: var(--surface);
    padding: 8px 10px;
    border-radius: var(--r-sm);
    border: 1px solid var(--border);
}

.block-processing-badge {
    margin-top: 6px;
    background: linear-gradient(135deg, rgba(var(--ai-rgb), 0.08), rgba(var(--success-rgb), 0.06));
    border: 1px solid rgba(var(--ai-rgb), 0.25);
    color: color-mix(in srgb, var(--ai) 62%, var(--text));
    padding: 8px 12px;
    border-radius: var(--r-sm);
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    animation: processing-pulse 2s ease-in-out infinite;
}

@keyframes processing-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.65; }
}

.block-ai-spinner {
    display: inline-block;
    width: 13px;
    height: 13px;
    border: 2px solid rgba(109, 40, 217, 0.25);
    border-top-color: var(--ai);
    border-radius: 50%;
    animation: spin-badge 0.8s linear infinite;
    flex-shrink: 0;
}

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

.note-modal-card #add-block-container > div:first-child { gap: 10px !important; }
.note-modal-card #btn-show-add-block, .note-modal-card #btn-show-ai-add-block { min-height: 40px; border-radius: var(--r-sm) !important; }

/* 📸 & 🎙️ MANUEL BLOK MEDYA BUTONLARI & KAYIT ÇUBUĞU */
.add-block-media-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--accent-soft);
    border: 1px solid var(--border-strong);
    color: var(--accent-ink);
    padding: 5px 9px;
    border-radius: var(--r-sm);
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.16s ease;
}
.add-block-media-btn:hover {
    background: var(--accent-soft);
    border-color: #91ac98;
    color: var(--accent-ink);
    transform: translateY(-1px);
}

.block-image-preview-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-sm);
    padding: 4px 8px;
    margin-bottom: 8px;
}
.block-image-preview-badge img {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: var(--r-xs);
}
.block-image-preview-badge .btn-remove-preview {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-weight: 800;
    font-size: 0.8rem;
    padding: 2px 4px;
}

.block-voice-recording-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: color-mix(in srgb, #ff0000 8%, var(--surface));
    border: 1px solid color-mix(in srgb, #fa0505 32%, var(--surface));
    padding: 8px 12px;
    border-radius: var(--r-sm);
    margin-bottom: 8px;
    animation: fadeIn 0.2s ease;
}
.block-recording-pulse {
    width: 10px;
    height: 10px;
    background: var(--danger);
    border-radius: 50%;
    display: inline-block;
    animation: recordPulse 1s infinite alternate;
}
@keyframes recordPulse {
    from { opacity: 0.4; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1.2); }
}

@media (max-width: 620px) {
    .modal-overlay { padding: 0; align-items: end; }
    .note-modal-card,
    .task-modal-card,
    .word-modal-card { border-radius: 22px 22px 0 0; max-height: 94vh; width: 100%; max-width: 100%; }
    .note-modal-card #modal-body,
    .task-modal-card #modal-body,
    .word-modal-card #modal-body { max-height: 94vh; padding: 24px 16px 28px; }
    .note-modal-card .modal-header-actions,
    .task-modal-card .modal-header-actions,
    .word-modal-card .modal-header-actions { top: 14px; right: 14px; gap: 6px; }
    .note-modal-card .note-detail__header,
    .task-modal-card .task-detail__header,
    .word-modal-card .word-detail__header { padding: 2px 145px 16px 0; }
    .modal-action-btn, .modal-close { width: 32px; height: 32px; font-size: 1.25rem; }
    .note-ai-toolbar__actions { display: flex; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; gap: 6px; }
    .note-ai-toolbar__actions::-webkit-scrollbar { display: none; }
    .note-ai-toolbar .ai-tool-btn { flex: 1 0 auto; font-size: .7rem; padding: 6px 10px; }
    .note-content-section__heading small { display: none; }
    .block-quick-actions { opacity: 1 !important; transform: translateY(0) !important; pointer-events: auto !important; }
    .blocks-timeline { padding-left: 20px; }
    .block-spine-node { left: -20px; }
}
.modal-card::-webkit-scrollbar {
    width: 6px;
}

.modal-card::-webkit-scrollbar-thumb {
    background: var(--surface-3);
    border-radius: var(--r-sm);
}


/* 📄 RAW CONTENT (HAM VERİ) BUTONU & MODAL STİLLERİ */
.block-raw-content-action {
    display: flex;
    align-items: center;
}

.btn-open-raw-modal {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--accent-ink);
    padding: 5px 10px;
    border-radius: var(--r-sm);
    cursor: pointer;
    font-size: 0.76rem;
    font-weight: 700;
    transition: all 0.16s ease;
    user-select: none;
}

.btn-open-raw-modal:hover {
    background: var(--accent-soft);
    border-color: var(--border-strong);
    color: var(--accent-text);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(var(--accent-rgb), 0.08);
}

.btn-open-raw-modal .raw-btn-icon {
    font-size: 0.8rem;
}

.btn-open-raw-modal .raw-btn-label {
    font-size: 0.76rem;
    font-weight: 700;
}

.btn-open-raw-modal .raw-btn-count {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}

.btn-open-raw-modal .raw-btn-arrow {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text-muted);
    transition: transform 0.16s ease;
}

.btn-open-raw-modal:hover .raw-btn-arrow {
    transform: translate(1px, -1px);
    color: var(--accent-text);
}

.btn-copy-raw-modal:hover {
    background: rgba(var(--accent-rgb), 0.18) !important;
}

