/**
 * Formatting Toolbar Styles
 * סגנונות לסרגל העיצוב החדש
 */

.formatting-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    margin: 0;
    width: 100%;
    border-radius: 0;
    border: 1px solid;
    border-left: none;
    border-right: none;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    flex-wrap: nowrap;
    position: sticky;
    top: 60px;
    z-index: 1500;
}

/* Hide formatting toolbar in document view */
.editor-container.document-layout .formatting-toolbar {
    display: none;
}

/* מצב בהיר */
.formatting-toolbar.light {
    background: rgba(248, 250, 252, 0.95);
    border-color: rgba(226, 232, 240, 0.8);
    color: #334155;
}

/* מצב כהה */
.formatting-toolbar.dark {
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(71, 85, 105, 0.8);
    color: #e2e8f0;
}

/* תמיכה ב-RTL */
.formatting-toolbar.rtl {
    direction: rtl;
}

.formatting-toolbar.ltr {
    direction: ltr;
}

/* שורת הכלים */
.toolbar-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1;
    flex-wrap: wrap;
}

/* כפתורי הפעולה הועברו לבר העליון */

/* כפתורי סרגל הכלים */
.toolbar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
    position: relative;
}

.formatting-toolbar.light .toolbar-btn {
    color: #475569;
}

.formatting-toolbar.dark .toolbar-btn {
    color: #cbd5e1;
}

.toolbar-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.formatting-toolbar.light .toolbar-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

.formatting-toolbar.dark .toolbar-btn:hover {
    background: rgba(139, 92, 246, 0.2);
    color: #a855f7;
}

.toolbar-btn:active {
    transform: translateY(0);
}

/* כפתור פעיל */
.toolbar-btn.active {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* תפריטים נפתחים */
.toolbar-select {
    padding: 6px 12px;
    border: 1px solid;
    border-radius: 6px;
    background: transparent;
    font-size: 14px;
    cursor: pointer;
    min-width: 120px;
    transition: all 0.2s ease;
}

.formatting-toolbar.light .toolbar-select {
    border-color: rgba(203, 213, 225, 0.8);
    color: #475569;
    background: rgba(255, 255, 255, 0.8);
}

.formatting-toolbar.dark .toolbar-select {
    border-color: rgba(71, 85, 105, 0.8);
    color: #e2e8f0;
    background: rgba(51, 65, 85, 0.8);
}

.toolbar-select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* מפרידים */
.toolbar-separator {
    width: 1px;
    height: 24px;
    margin: 0 4px;
}

.formatting-toolbar.light .toolbar-separator {
    background: rgba(203, 213, 225, 0.6);
}

.formatting-toolbar.dark .toolbar-separator {
    background: rgba(71, 85, 105, 0.6);
}

/* בוחר צבעים */
.color-picker-container {
    position: relative;
}

.color-dropdown {
    position: absolute;
    top: 100%;
    z-index: 1000;
    margin-top: 8px;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(20px);
}

.formatting-toolbar.light .color-dropdown {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(226, 232, 240, 0.8);
}

.formatting-toolbar.dark .color-dropdown {
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(71, 85, 105, 0.8);
}

/* RTL positioning for dropdown */
.formatting-toolbar.rtl .color-dropdown {
    right: 0;
}

.formatting-toolbar.ltr .color-dropdown {
    left: 0;
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
}

.color-option {
    width: 24px;
    height: 24px;
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.color-option:hover {
    transform: scale(1.1);
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* אנימציות */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.formatting-toolbar {
    animation: fadeIn 0.3s ease-out;
}

/* Responsive Design */
@media (max-width: 768px) {
    .formatting-toolbar {
        padding: 8px 12px;
        gap: 6px;
    }

    .toolbar-btn {
        width: 32px;
        height: 32px;
    }

    .toolbar-select {
        min-width: 100px;
        font-size: 13px;
    }

    .color-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* אפקטים חזותיים */
.formatting-toolbar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
        rgba(99, 102, 241, 0.05) 0%,
        rgba(139, 92, 246, 0.05) 50%,
        rgba(236, 72, 153, 0.05) 100%);
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.formatting-toolbar:hover::before {
    opacity: 1;
}

/* ContentEditable עם Placeholder */
.text-editor[contenteditable="true"] {
    outline: none;
    position: relative;
    font-family: 'Heebo', 'Segoe UI', Tahoma, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #000000;
}

/* Old placeholder - replaced by editor-placeholder-overlay in main.css */
/* .text-editor[contenteditable="true"].empty::before - REMOVED */

/* סגנונות לטקסט מעוצב */
.text-editor[contenteditable="true"] div {
    margin-bottom: 0;
}

.text-editor[contenteditable="true"] div:last-child {
    margin-bottom: 0;
}

/* הדגשת בחירה - צבע כחול */
.text-editor[contenteditable="true"]::selection {
    background: rgba(30, 58, 95, 0.2);
}

.text-editor[contenteditable="true"] *::selection {
    background: rgba(30, 58, 95, 0.2);
}