/* ═══════════════════════════════════════════════════════════════════════════
   Online Notepad Style Sheet
   ═══════════════════════════════════════════════════════════════════════════ */

/* Toolbar Layout */
.fu-notepad-toolbar-panel {
    padding: 14px 16px !important;
    margin-bottom: 20px;
}

.fu-notepad-toolbar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.fu-toolbar-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 16px;
}

.fu-toolbar-row-bottom {
    border-top: 1px solid var(--fu-border, #e5e7eb);
    padding-top: 12px;
}

.fu-toolbar-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Ensure actions align to the left on the bottom shelf for a clean desktop editor feel */
.fu-actions-group {
    margin-right: auto;
}

/* Dropdown select menus styling */
.fu-notepad-toolbar select.fu-select {
    font-size: 13px !important;
    padding: 6px 24px 6px 10px !important;
    max-width: 160px;
    height: 34px !important;
}

/* Compact action buttons */
.fu-notepad-toolbar .fu-btn {
    font-size: 13px !important;
    padding: 6px 14px !important;
    height: 34px !important;
}

@media (max-width: 640px) {
    .fu-toolbar-row-top {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .fu-save-status-group {
        justify-content: flex-start;
    }
    .fu-toolbar-row-bottom {
        justify-content: flex-start;
    }
    .fu-toolbar-group {
        flex-wrap: wrap;
    }
}

/* Save Status Indicator */
.fu-save-status {
    display: flex;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--fu-text-muted, #6b7280);
    padding: 5px 12px;
    border-radius: 9999px;
    background-color: var(--fu-bg-dark, #fafafa);
    border: 1px solid var(--fu-border, #e5e7eb);
    height: 34px;
}

.fu-status-dot {
    width: 8px;
    height: 8px;
    background-color: #10b981; /* Emerald-500 */
    border-radius: 50%;
    margin-right: 6px;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

/* Pulse when saving */
.fu-save-status.saving .fu-status-dot {
    background-color: #f59e0b; /* Amber-500 */
    animation: fu-saving-pulse 1s infinite;
}

.fu-save-status.saving .fu-status-text {
    color: #b45309;
}

@keyframes fu-saving-pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.5);
    }
    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 6px rgba(245, 158, 11, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
    }
}

/* Notepad Editor Canvas - Distraction-Free Styling (No lines) */
.fu-notepad-editor-panel {
    padding: 0 !important;
    overflow: hidden;
}

.fu-notepad-container {
    padding: 16px;
}

.fu-notepad-textarea {
    width: 100%;
    min-height: 380px;
    max-height: 600px;
    border: 1px solid var(--fu-border, #e5e7eb);
    border-radius: 6px;
    padding: 18px;
    resize: vertical;
    outline: none;
    background-color: #ffffff;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.fu-notepad-textarea:focus {
    border-color: var(--fu-accent, #4f46e5);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02), 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Text Wrapping Classes */
.fu-notepad-textarea.wrap-off {
    white-space: pre !important;
    overflow-x: auto !important;
    word-wrap: normal !important;
}

.fu-notepad-textarea.wrap-on {
    white-space: pre-wrap !important;
    overflow-x: hidden !important;
}

/* Font Family Overrides */
.fu-notepad-textarea.font-sans {
    font-family: var(--fu-font-body), sans-serif !important;
}

.fu-notepad-textarea.font-serif {
    font-family: Georgia, Cambria, "Times New Roman", Times, serif !important;
}

.fu-notepad-textarea.font-mono {
    font-family: var(--fu-font-mono), monospace !important;
}

/* Font Size Spacings */
.fu-notepad-textarea.size-sm {
    font-size: 14px !important;
    line-height: 1.5 !important;
}

.fu-notepad-textarea.size-md {
    font-size: 17px !important;
    line-height: 1.6 !important;
}

.fu-notepad-textarea.size-lg {
    font-size: 21px !important;
    line-height: 1.6 !important;
}

/* Bottom Stats Bar */
.fu-notepad-stats-bar {
    display: flex;
    gap: 24px;
    padding: 12px 20px;
    background-color: var(--fu-bg-dark, #fafafa);
    border-top: 1px solid var(--fu-border, #e5e7eb);
    font-size: 13px;
    color: var(--fu-text-muted, #6b7280);
    font-weight: 500;
}

.fu-stat-item {
    display: flex;
    gap: 6px;
    align-items: center;
}

.fu-stat-value {
    font-weight: 700;
    color: var(--fu-text-main, #111827);
    font-family: var(--fu-font-mono, monospace);
}

/* Clear Confirmation Pulse */
.fu-btn.fu-btn-confirm {
    background-color: var(--fu-error, #ef4444) !important;
    color: #ffffff !important;
    border-color: var(--fu-error, #ef4444) !important;
    font-weight: 600 !important;
    animation: fu-confirm-pulse 1.5s infinite alternate;
}

@keyframes fu-confirm-pulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.03); }
}

/* ─── Print Styles ────────────────────────────────────────────────────────── */
@media print {
    /* Hide theme layout chrome, menus, footer, sidebars, comments, and headers completely */
    header, .site-header,
    footer, .site-footer,
    #left-sidebar, #right-sidebar, .sidebar,
    #comments,
    .entry-meta,
    .entry-header,
    .nav-links,
    .author-box,
    .fu-related-tools {
        display: none !important;
    }

    /* Hide notepad elements using high-specificity selectors to prevent conflicts */
    #fu-online-notepad .fu-notepad-toolbar-panel,
    #fu-online-notepad .fu-notepad-stats-bar,
    #fu-online-notepad .fu-privacy-badge {
        display: none !important;
    }

    /* Hide all sibling elements in the post content that are NOT the notepad */
    .entry-content > *:not(#fu-online-notepad) {
        display: none !important;
    }

    /* Force parent containers to expand cleanly with zero border and margins */
    body, html, #page, #primary, #main, article, .entry-content {
        background: #ffffff !important;
        color: #000000 !important;
        padding: 0 !important;
        margin: 0 !important;
        border: none !important;
        box-shadow: none !important;
        width: 100% !important;
        height: auto !important;
        display: block !important;
    }

    /* Format only the notepad wrapper and text area for clean printing */
    #fu-online-notepad {
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        box-shadow: none !important;
        width: 100% !important;
        display: block !important;
    }

    #fu-online-notepad .fu-tool,
    #fu-online-notepad .fu-notepad-editor-panel,
    #fu-online-notepad .fu-notepad-container {
        border: none !important;
        background: transparent !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
        display: block !important;
        width: 100% !important;
        height: auto !important;
    }

    #fu-notepad-textarea {
        border: none !important;
        outline: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        resize: none !important;
        background: transparent !important;
        font-family: inherit !important;
        color: #000000 !important;
    }
}
