/* --- Smart Text Editor Styles --- */
#smart-text-wrapper {
    position: absolute;
    z-index: 2000;
    pointer-events: none;
    /* Container doesn't block, children do */
    transform-origin: top left;
}

#smart-input {
    pointer-events: auto;
    background: transparent;
    border: 2px dashed rgba(59, 130, 246, 0.4);
    padding: 4px 8px;
    /* Comfortable padding */
    outline: none;
    min-width: 60px;
    min-height: 1.5em;
    /* Ensure visible even when empty */
    white-space: pre-wrap;
    /* Important for multiline */
    word-break: break-word;
    /* Ensure wrapping */
    overflow: visible;
    color: #1e293b;
    font-family: 'Outfit', sans-serif;
    line-height: 1.5;
    display: inline-block;
    position: relative;
    cursor: text;
    border-radius: 4px;
    /* Slight roundness */
}

/* Placeholder styling */
#smart-input:empty:before {
    content: attr(placeholder);
    color: rgba(148, 163, 184, 0.6);
    /* Slate 400 */
    position: absolute;
    pointer-events: none;
}

/* RTL Support in input */
#smart-input[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

#smart-input[dir="ltr"] {
    direction: ltr;
    text-align: left;
}

#smart-text-toolbar {
    pointer-events: auto;
    position: absolute;
    top: -55px;
    /* Position above */
    left: 0;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 6px 10px;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.05);
    display: flex;
    gap: 8px;
    align-items: center;
    white-space: nowrap;
    animation: fadeIn 0.15s ease-out;
    transform-origin: bottom left;
    border: 1px solid rgba(255, 255, 255, 0.4);
    z-index: 2001;
    /* Ensure above everything */
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.smart-tool-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.smart-tool-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
    transform: translateY(-1px);
}

.smart-tool-btn:active {
    transform: translateY(0);
}

.smart-tool-btn.active {
    background: #e0f2fe;
    color: #3b82f6;
}

/* Confirm Button Special Styling */
.smart-tool-btn.highlight-btn {
    color: #22c55e;
    background: #f0fdf4;
    border: 1px solid #dcfce7;
}

.smart-tool-btn.highlight-btn:hover {
    background: #22c55e;
    color: white;
    border-color: #22c55e;
    box-shadow: 0 4px 6px -1px rgba(34, 197, 94, 0.3);
}

.toolbar-separator {
    width: 1px;
    height: 20px;
    background: #cbd5e1;
    margin: 0 6px;
}

.color-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.color-dot:hover {
    transform: scale(1.15);
}

.color-dot.active {
    border-color: white;
    box-shadow: 0 0 0 2px #3b82f6, 0 4px 8px -2px rgba(0, 0, 0, 0.2);
    transform: scale(1.1);
}

.font-size-display {
    font-size: 14px;
    font-weight: 700;
    min-width: 28px;
    text-align: center;
    color: #334155;
    font-feature-settings: "tnum";
    padding: 0 4px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}