/* ============================================
   STUDY GRAPH VISUALIZATION CSS
   ============================================
   
   Styles for the interactive Bible Study graph
   visualization modal and floating toggle button.
*/

/* ==========================================
   GRAPH TOGGLE BUTTON (Bottom Right)
   ========================================== */

.study-graph-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #7c3aed 0%, #9d8fc9 100%);
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8) translateY(20px);
    transition: all 0.3s ease;
}

.study-graph-toggle.visible {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
}

.study-graph-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 28px rgba(124, 58, 237, 0.5);
}

.study-graph-toggle:active {
    transform: scale(0.95);
}

.study-graph-toggle svg {
    width: 24px;
    height: 24px;
}

/* Dark theme */
[data-theme="dark"] .study-graph-toggle {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
}

[data-theme="dark"] .study-graph-toggle:hover {
    box-shadow: 0 6px 28px rgba(139, 92, 246, 0.5);
}

/* Mobile responsiveness - hide on small screens */
@media (max-width: 1080px) {
    .study-graph-toggle {
        display: none !important;
    }
}

/* ==========================================
   GRAPH MODAL CONTAINER
   ========================================== */

.study-graph-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999; /* Above popup notes (10000+) and all other content */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.study-graph-modal.active {
    opacity: 1;
    visibility: visible;
}

.study-graph-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.study-graph-container {
    position: relative;
    width: 90vw;
    height: 85vh;
    max-width: 1400px;
    background: transparent;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

/* FinisherHeader animated background container */
.study-graph-bg-animation {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    border-radius: 20px;
    overflow: hidden;
}

.study-graph-bg-animation #finisher-canvas {
    border-radius: 20px;
}

.study-graph-modal.active .study-graph-container {
    transform: scale(1);
}

/* Light theme override */
[data-theme="light"] .study-graph-container {
    background: linear-gradient(135deg, #f8f9fc 0%, #eef1f8 100%);
}

/* ==========================================
   GRAPH HEADER
   ========================================== */

.study-graph-header {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 28px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .study-graph-header {
    background: rgba(255, 255, 255, 0.4);
    border-bottom: 1px solid rgba(124, 58, 237, 0.15);
}

.study-graph-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: white;
}

[data-theme="light"] .study-graph-title {
    color: #1e1e3f;
}

.study-graph-title svg {
    color: #a0c7ff;
}

[data-theme="light"] .study-graph-title svg {
    color: #7c3aed;
}

.study-graph-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.study-graph-zoom-btn,
.study-graph-close-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.study-graph-zoom-btn:hover,
.study-graph-close-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
}

.study-graph-close-btn {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.study-graph-close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

[data-theme="light"] .study-graph-zoom-btn,
[data-theme="light"] .study-graph-close-btn {
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(0, 0, 0, 0.03);
    color: rgba(0, 0, 0, 0.6);
}

[data-theme="light"] .study-graph-zoom-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #1f1f1f;
}

[data-theme="light"] .study-graph-close-btn {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

/* ==========================================
   GRAPH BODY / SVG AREA
   ========================================== */

.study-graph-body {
    flex: 1;
    position: relative;
    z-index: 10;
    overflow: hidden;
}

.study-graph-svg {
    width: 100%;
    height: 100%;
    cursor: grab;
}

.study-graph-svg:active {
    cursor: grabbing;
}

/* ==========================================
   LOADING STATE
   ========================================== */

.study-graph-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    color: rgba(255, 255, 255, 0.7);
}

[data-theme="light"] .study-graph-loading {
    color: rgba(0, 0, 0, 0.6);
}

/* Legacy study graph spinner - keeping for specialized inline use */
.study-graph-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(167, 139, 250, 0.2);
    border-top-color: #a78bfa;
    border-radius: 50%;
    animation: graphSpin 1s linear infinite;
}

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

.study-graph-loading p {
    margin: 0;
    font-size: 16px;
}

/* ==========================================
   EMPTY STATE
   ========================================== */

.study-graph-empty {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
}

[data-theme="light"] .study-graph-empty {
    color: rgba(0, 0, 0, 0.4);
}

.study-graph-empty svg {
    opacity: 0.5;
}

.study-graph-empty p {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
}

[data-theme="light"] .study-graph-empty p {
    color: rgba(0, 0, 0, 0.6);
}

.study-graph-empty span {
    font-size: 14px;
}

/* ==========================================
   LEGEND
   ========================================== */

.study-graph-legend {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    padding: 16px 28px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .study-graph-legend {
    background: rgba(255, 255, 255, 0.4);
    border-top: 1px solid rgba(124, 58, 237, 0.15);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 400;
}

[data-theme="light"] .legend-item {
    color: rgba(0, 0, 0, 0.5);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.legend-main {
    background: #a0c7ff;
    width: 12px;
    height: 12px;
}

.legend-note {
    background: #d4e4ff;
    width: 9px;
    height: 9px;
}

.legend-reference {
    background: rgba(212, 228, 255, 0.5);
    width: 7px;
    height: 7px;
}

.legend-general {
    background: #9ca3af;
    width: 9px;
    height: 9px;
}

[data-theme="light"] .legend-main {
    background: #7c3aed;
}

[data-theme="light"] .legend-note {
    background: #9d8fc9;
}

[data-theme="light"] .legend-reference {
    background: rgba(157, 143, 201, 0.6);
}

[data-theme="light"] .legend-general {
    background: #6b7280;
}

/* ==========================================
   D3.JS GRAPH NODES
   ========================================== */

.graph-node {
    cursor: pointer;
    /* Smooth opacity transition for hover dimming effect */
    transition: opacity 0.3s ease !important;
}

.graph-node:hover {
    cursor: grab;
}

.graph-node:active {
    cursor: grabbing;
    /* No transition during drag for instant cursor following */
    transition: none !important;
}

/* Ensure no transitions on transform (for dragging) but allow opacity */
.graph-node *,
.graph-link {
    transition: opacity 0.3s ease, stroke 0.3s ease, stroke-opacity 0.3s ease !important;
}

/* All nodes use BibliaTech theme colors */
.node-circle {
    fill: #a0c7ff;
}

.node-circle.node-study {
    fill: #a0c7ff;
}

.node-circle.node-note {
    fill: #d4e4ff;
}

.node-circle.node-passage {
    fill: #a5b4fc;
}

.node-circle.node-reference {
    fill: rgba(212, 228, 255, 0.5);
}

/* Light theme - purple tones */
[data-theme="light"] .node-circle {
    fill: #7c3aed;
}

[data-theme="light"] .node-circle.node-study {
    fill: #7c3aed;
}

[data-theme="light"] .node-circle.node-note {
    fill: #9d8fc9;
}

[data-theme="light"] .node-circle.node-passage {
    fill: #9b8bc2;
}

[data-theme="light"] .node-circle.node-reference {
    fill: rgba(157, 143, 201, 0.6);
}

/* Unavailable nodes - book not in current translation */
/* Uses greyed out styling with reduced opacity (NOT pink/red) */
.node-circle.node-unavailable {
    fill: rgba(160, 199, 255, 0.15);
    cursor: not-allowed;
    opacity: 0.4;
}

[data-theme="light"] .node-circle.node-unavailable {
    fill: rgba(124, 58, 237, 0.1);
    opacity: 0.4;
}

/* Node labels - clean typography */
.node-label {
    fill: rgba(255, 255, 255, 0.9);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    pointer-events: none;
    font-weight: 400;
}

[data-theme="light"] .node-label {
    fill: rgba(30, 30, 60, 0.85);
}

/* Labels for unavailable nodes - reduced opacity */
.node-unavailable .node-label {
    fill: rgba(255, 255, 255, 0.3);
}

[data-theme="light"] .node-unavailable .node-label {
    fill: rgba(30, 30, 60, 0.3);
}

/* Graph edges/links - BibliaTech themed */
.graph-link {
    stroke: rgba(160, 199, 255, 0.15);
    stroke-width: 1px;
}

[data-theme="light"] .graph-link {
    stroke: rgba(124, 58, 237, 0.15);
}

/* Edges connected to unavailable nodes - much more subtle */
.graph-link.link-unavailable {
    stroke: rgba(160, 199, 255, 0.05);
}

[data-theme="light"] .graph-link.link-unavailable {
    stroke: rgba(124, 58, 237, 0.05);
}

/* ==========================================
   RESPONSIVE ADJUSTMENTS
   ========================================== */

@media (max-width: 1200px) {
    .study-graph-container {
        width: 95vw;
        height: 90vh;
    }
    
    .study-graph-legend {
        gap: 20px;
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .study-graph-modal,
    .study-graph-toggle {
        display: none !important;
    }
}

/* ==========================================
   FOLDER BUTTON IN HEADER
   ========================================== */

.study-graph-folder-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-right: 8px;
}

.study-graph-folder-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.study-graph-folder-btn:active {
    transform: translateY(0);
}

.folder-btn-text {
    white-space: nowrap;
}

[data-theme="dark"] .study-graph-folder-btn {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
}

/* ==========================================
   FOLDER CREATION DIALOG
   ========================================== */

.folder-creation-dialog {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    background: white;
    border-radius: 16px;
    padding: 24px;
    min-width: 320px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: folderDialogIn 0.2s ease;
}

@keyframes folderDialogIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

[data-theme="dark"] .folder-creation-dialog {
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.folder-dialog-content h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}

[data-theme="dark"] .folder-dialog-content h3 {
    color: #e4e4e7;
}

.folder-dialog-field {
    margin-bottom: 20px;
}

.folder-dialog-field label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
}

[data-theme="dark"] .folder-dialog-field label {
    color: #94a3b8;
}

.folder-dialog-field input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.folder-dialog-field input:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.folder-dialog-field input.error {
    border-color: #ef4444;
    animation: shake 0.3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

[data-theme="dark"] .folder-dialog-field input {
    background: #0e1324;
    border-color: #334155;
    color: #e4e4e7;
}

[data-theme="dark"] .folder-dialog-field input:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.folder-color-picker {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.folder-color-option {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.folder-color-option:hover {
    transform: scale(1.1);
}

.folder-color-option.selected {
    border-color: #1a1a1a;
    box-shadow: 0 0 0 2px white, 0 2px 8px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .folder-color-option.selected {
    border-color: white;
    box-shadow: 0 0 0 2px #1a1a1a, 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Color wheel picker for edit dialog */
.folder-color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.folder-color-wheel {
    width: 48px;
    height: 48px;
    padding: 0;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background: none;
}

.folder-color-wheel::-webkit-color-swatch-wrapper {
    padding: 0;
    border-radius: 50%;
}

.folder-color-wheel::-webkit-color-swatch {
    border: 3px solid #e2e8f0;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.folder-color-wheel::-moz-color-swatch {
    border: 3px solid #e2e8f0;
    border-radius: 50%;
}

.folder-color-wheel:hover {
    transform: scale(1.05);
}

.folder-color-wheel:focus {
    outline: none;
}

[data-theme="dark"] .folder-color-wheel::-webkit-color-swatch {
    border-color: #334155;
}

[data-theme="dark"] .folder-color-wheel::-moz-color-swatch {
    border-color: #334155;
}

.folder-color-hex {
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 13px;
    color: #64748b;
    background: #f1f5f9;
    padding: 6px 10px;
    border-radius: 6px;
}

[data-theme="dark"] .folder-color-hex {
    color: #94a3b8;
    background: #1e293b;
}

/* Preset color buttons */
.folder-color-presets {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.folder-color-preset {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.folder-color-preset:hover {
    transform: scale(1.15);
}

.folder-color-preset.selected {
    border-color: #1a1a1a;
    box-shadow: 0 0 0 2px white;
}

[data-theme="dark"] .folder-color-preset.selected {
    border-color: white;
    box-shadow: 0 0 0 2px #1a1a1a;
}

.folder-dialog-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

.folder-dialog-cancel {
    padding: 10px 20px;
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #64748b;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.folder-dialog-cancel:hover {
    background: #f1f5f9;
}

[data-theme="dark"] .folder-dialog-cancel {
    border-color: #334155;
    color: #94a3b8;
}

[data-theme="dark"] .folder-dialog-cancel:hover {
    background: rgba(255, 255, 255, 0.05);
}

.folder-dialog-create {
    padding: 10px 20px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.folder-dialog-create:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* ==========================================
   FOLDER NODE STYLES
   ========================================== */

/* Folder nodes use their custom color from inline style set by JavaScript */
.node-folder circle,
.node-circle.node-folder {
    cursor: pointer;
}

/* Folder drop target - keep folder's own color, just make it pop */
.folder-drop-target circle,
circle.folder-drop-target {
    stroke: #fff !important;
    stroke-width: 4px !important;
    filter: drop-shadow(0 0 12px currentColor) drop-shadow(0 0 24px currentColor) brightness(1.2);
    animation: folderPulse 0.4s ease infinite alternate;
}

[data-theme="dark"] .folder-drop-target circle,
[data-theme="dark"] circle.folder-drop-target {
    stroke: #fff !important;
    filter: drop-shadow(0 0 16px currentColor) drop-shadow(0 0 32px currentColor) brightness(1.3);
}

/* Bible Study node drop target */
.main-drop-target,
circle.main-drop-target {
    stroke: #fff !important;
    stroke-width: 4px !important;
    filter: drop-shadow(0 0 16px #7c3aed) drop-shadow(0 0 32px #7c3aed) brightness(1.2);
    animation: folderPulse 0.4s ease infinite alternate;
}

[data-theme="dark"] .main-drop-target,
[data-theme="dark"] circle.main-drop-target {
    filter: drop-shadow(0 0 20px #a0c7ff) drop-shadow(0 0 40px #a0c7ff) brightness(1.3);
}

@keyframes folderPulse {
    from { transform: scale(1); }
    to { transform: scale(1.15); }
}

/* Plus sign on folder drop target */
.folder-drop-plus {
    font-size: 18px !important;
    font-weight: bold !important;
    fill: white !important;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

.folder-label {
    font-weight: 500 !important;
}

/* Legend folder dot */
.legend-dot.legend-folder {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

/* ==========================================
   TRASH ZONE FOR NODE DELETION
   ========================================== */

.graph-trash-zone {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(239, 68, 68, 0.15);
    border: 2px dashed rgba(239, 68, 68, 0.4);
    border-radius: 12px;
    color: #ef4444;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8);
    transition: all 0.3s ease;
    z-index: 100;
}

.graph-trash-zone.visible {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.graph-trash-zone.active {
    background: rgba(239, 68, 68, 0.4);
    border-color: #ef4444;
    border-style: solid;
    transform: scale(1.15);
}

.graph-trash-zone svg {
    width: 20px;
    height: 20px;
}

[data-theme="light"] .graph-trash-zone {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}

[data-theme="light"] .graph-trash-zone.active {
    background: rgba(239, 68, 68, 0.25);
    border-color: #ef4444;
}

/* ==========================================
   FOLDER DELETE CONFIRMATION DIALOG
   ========================================== */

.folder-delete-confirmation {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.folder-delete-confirmation.visible {
    opacity: 1;
}

.folder-delete-dialog {
    background: #ffffff;
    border-radius: 16px;
    padding: 32px;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.2s ease;
}

.folder-delete-confirmation.visible .folder-delete-dialog {
    transform: scale(1);
}

[data-theme="dark"] .folder-delete-dialog {
    background: #1f2937;
    border: 1px solid #374151;
}

.folder-delete-icon {
    margin-bottom: 16px;
    color: #ef4444;
}

.folder-delete-dialog h3 {
    margin: 0 0 12px 0;
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
}

[data-theme="dark"] .folder-delete-dialog h3 {
    color: #f3f4f6;
}

.folder-delete-dialog p {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #6b7280;
    line-height: 1.5;
}

[data-theme="dark"] .folder-delete-dialog p {
    color: #9ca3af;
}

.folder-delete-dialog p strong {
    color: #374151;
}

[data-theme="dark"] .folder-delete-dialog p strong {
    color: #e5e7eb;
}

.folder-delete-warning {
    color: #dc2626 !important;
    font-weight: 500;
    margin-top: 12px !important;
}

.folder-delete-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    justify-content: center;
}

.folder-delete-cancel {
    padding: 10px 24px;
    background: #f3f4f6;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
}

.folder-delete-cancel:hover {
    background: #e5e7eb;
}

[data-theme="dark"] .folder-delete-cancel {
    background: #374151;
    color: #e5e7eb;
}

[data-theme="dark"] .folder-delete-cancel:hover {
    background: #4b5563;
}

.folder-delete-confirm {
    padding: 10px 24px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.folder-delete-confirm:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-1px);
}

/* ==========================================
   NOTE INFO PANEL (in-graph side panel)
   ========================================== */

.study-graph-note-panel {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 380px;
    max-width: 45vw;
    background: white;
    border-left: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.08);
    z-index: 10;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    transform: translateX(110%);
    transition: transform 0.25s cubic-bezier(.4, 0, .2, 1);
}
.study-graph-note-panel.open {
    transform: translateX(0);
}
[data-theme="dark"] .study-graph-note-panel {
    background: #1e1e2e;
    border-color: rgba(255, 255, 255, 0.06);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.3);
}

.study-graph-note-panel-close {
    position: sticky;
    top: 0;
    z-index: 2;
    width: 28px;
    height: 28px;
    margin-left: auto;
    margin-right: 16px;
    margin-top: 12px;
    flex-shrink: 0;
    border-radius: 50%;
    border: none;
    background: rgba(107, 91, 149, 0.08);
    color: #6b5b95;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}
.study-graph-note-panel-close:hover {
    background: #6b5b95;
    color: white;
}
[data-theme="dark"] .study-graph-note-panel-close {
    background: rgba(160, 199, 255, 0.1);
    color: #a0c7ff;
}
[data-theme="dark"] .study-graph-note-panel-close:hover {
    background: #a0c7ff;
    color: #1a1a1a;
}

/* Verse reference — bottom-right of note section */
.sg-note-panel-ref {
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b5b95;
    text-align: right;
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid rgba(107, 91, 149, 0.08);
    font-family: 'Crimson Text', Georgia, serif;
    opacity: 0.8;
}
[data-theme="dark"] .sg-note-panel-ref {
    color: #a0c7ff;
    border-color: rgba(160, 199, 255, 0.08);
}

/* Author badge */
.sg-note-panel-author {
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b5b95;
    padding: 8px 24px 0;
    opacity: 0.7;
}
[data-theme="dark"] .sg-note-panel-author {
    color: #a0c7ff;
}

/* Scripture toggle — minimal, clean */
.sg-scripture-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid rgba(107, 91, 149, 0.18);
    border-radius: 6px;
    color: #6b5b95;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    margin: 14px 24px 4px;
}
.sg-scripture-toggle:hover {
    background: rgba(107, 91, 149, 0.06);
    border-color: rgba(107, 91, 149, 0.3);
}
.sg-scripture-toggle svg {
    transition: transform 0.2s ease;
    opacity: 0.6;
}
.sg-scripture-toggle.expanded svg {
    transform: rotate(180deg);
}
[data-theme="dark"] .sg-scripture-toggle {
    border-color: rgba(160, 199, 255, 0.18);
    color: #a0c7ff;
}
[data-theme="dark"] .sg-scripture-toggle:hover {
    background: rgba(160, 199, 255, 0.06);
}

/* Scripture content (collapsible) */
.sg-scripture-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    background: rgba(107, 91, 149, 0.04);
    border-radius: 6px;
    margin: 0 24px;
}
.sg-scripture-content.expanded {
    max-height: 350px;
    padding: 12px;
    margin-bottom: 8px;
    overflow-y: auto;
}
[data-theme="dark"] .sg-scripture-content {
    background: rgba(160, 199, 255, 0.04);
}

.sg-scripture-text {
    color: #333;
    line-height: 1.7;
    font-size: 0.9rem;
    font-family: 'Crimson Text', Georgia, serif;
}
[data-theme="dark"] .sg-scripture-text {
    color: #d1d5db;
}

.sg-verse-num {
    font-weight: 700;
    color: #6b5b95;
    font-size: 0.7rem;
    vertical-align: super;
    margin-right: 2px;
}
[data-theme="dark"] .sg-verse-num {
    color: #a0c7ff;
}

.sg-scripture-loading {
    text-align: center;
    color: #999;
    font-size: 0.85rem;
    font-style: italic;
}

/* Note section */
.sg-note-panel-section {
    padding: 16px 24px 24px;
}

.sg-note-panel-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}
[data-theme="dark"] .sg-note-panel-title {
    color: #e5e7eb;
}

.sg-note-panel-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b5b95;
    margin-bottom: 8px;
    opacity: 0.8;
}
[data-theme="dark"] .sg-note-panel-label {
    color: #a0c7ff;
}

.sg-note-panel-body {
    color: #374151;
    line-height: 1.75;
    font-size: 0.9rem;
    white-space: pre-wrap;
    word-wrap: break-word;
}
[data-theme="dark"] .sg-note-panel-body {
    color: #d1d5db;
}

/* Hint for double-click */
.sg-note-panel-hint {
    font-size: 0.7rem;
    color: #9ca3af;
    text-align: center;
    padding: 12px 24px 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    margin-top: auto;
}
[data-theme="dark"] .sg-note-panel-hint {
    color: #6b7280;
    border-color: rgba(255, 255, 255, 0.04);
}

/* Mobile: full width panel */
@media (max-width: 768px) {
    .study-graph-note-panel {
        width: 100%;
        max-width: 100vw;
    }
}

/* Multi-passage navigation arrows */
.sg-passage-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px 4px;
}

.sg-passage-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(107, 91, 149, 0.2);
    background: transparent;
    color: #6b5b95;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}
.sg-passage-nav-btn:hover {
    background: rgba(107, 91, 149, 0.1);
    border-color: rgba(107, 91, 149, 0.4);
}
[data-theme="dark"] .sg-passage-nav-btn {
    border-color: rgba(160, 199, 255, 0.2);
    color: #a0c7ff;
}
[data-theme="dark"] .sg-passage-nav-btn:hover {
    background: rgba(160, 199, 255, 0.1);
}

.sg-passage-indicator {
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
    text-align: center;
    font-family: 'Crimson Text', Georgia, serif;
    min-width: 120px;
}
[data-theme="dark"] .sg-passage-indicator {
    color: #e5e7eb;
}

.sg-passage-count {
    display: block;
    font-size: 0.65rem;
    font-weight: 500;
    color: #9ca3af;
    margin-top: 1px;
}
[data-theme="dark"] .sg-passage-count {
    color: #6b7280;
}

/* Scripture section wrapper */
.sg-scripture-section {
    border-top: 1px solid rgba(0, 0, 0, 0.04);
}
[data-theme="dark"] .sg-scripture-section {
    border-color: rgba(255, 255, 255, 0.04);
}
