/* Navigation Styles */

/* ===================================
   Custom Fonts - גופנים מותאמים אישית
   =================================== */

@font-face {
    font-family: 'Neta';
    src: url('../../fonts/Reisinger-Neta-web/Reisinger-Neta-Medium.woff2') format('woff2'),
         url('../../fonts/Reisinger-Neta-web/Reisinger-Neta-Medium.woff') format('woff'),
         url('../../fonts/Reisinger-Neta-web/Reisinger-Neta-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

/* ===================================
   NEW: Google Docs Style Header
   רקע אפור על כל העמוד, לוגו על הרקע
   פאנל לבן עם מסגרת לכפתורים
   =================================== */

/* Top Navigation Bar - Full Width Gray Background */
.top-nav {
    position: sticky;
    top: 0;
    z-index: 2000;
    background: #e2e8f0; /* רקע אפור כמו גוגל דוקס */
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 20px;
    min-height: 60px;
    transition: all 0.3s ease;
}

.top-nav.scrolled {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Logo - sits on gray background */
.nav-logo {
    font-family: 'Neta', 'Heebo', sans-serif;
    font-size: 1.4rem;
    font-weight: 500;
    color: #1e3a5f;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.nav-logo:hover {
    background: rgba(30, 58, 95, 0.08);
}

.nav-logo-img {
    height: 36px;
    width: auto;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.nav-logo:hover .nav-logo-img {
    transform: scale(1.05);
}

/* ===================================
   NEW: White Button Panel
   פאנל לבן עם מסגרת אפורה לכפתורים
   =================================== */

.nav-button-panel {
    flex: 1;
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 6px 12px;
    gap: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    min-height: 44px;
    overflow: visible; /* מאפשר לתפריטים נפתחים להופיע */
    min-width: 0; /* מאפשר לפאנל להתכווץ */
    position: relative; /* עוגן לתפריטים נפתחים */
}

/* Document name section - after logo - with complete box */
.nav-document-section {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-left: 8px;
    flex-shrink: 0;
    box-sizing: border-box;
    min-height: 38px;
}

/* Formatting section - after document name */
.nav-formatting-section {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 8px;
    border-left: 1px solid #e2e8f0;
    margin-left: 8px;
    flex-shrink: 1;
    min-width: 0; /* מאפשר התכווצות מלאה */
    overflow: hidden; /* חותך תוכן שיוצא מהגבול */
    box-sizing: border-box; /* כולל padding ו-border בחישוב הרוחב */
}

/* Action buttons section - pushed to end (left in RTL) */
.nav-actions-section {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-right: auto; /* דחיפה לצד שמאל (ב-RTL) */
    padding-right: 8px;
    border-right: 1px solid #e2e8f0;
    flex-shrink: 0;
}

/* 🆕 Docs-lite: כלי-העיצוב המשניים מוסתרים בסרגל-הראשי בלבד.
   הם נשארים ב-DOM (display:none) ולכן לוגיקת ה-overflow הקיימת משכפלת אותם לתפריט "עוד עיצוב".
   הסקופ ל-#formattingDropdownMenu בלבד — השכפול בתוך #formattingOverflowMenu לא מושפע ומוצג כרגיל. */
#formattingDropdownMenu .docs-lite-secondary {
    display: none !important;
}

/* Overflow menu for formatting when not enough space */
.nav-formatting-overflow {
    position: relative;
    display: flex;
    align-items: center;
    margin-right: 4px;
    flex-shrink: 0;
}

.nav-overflow-btn {
    padding: 8px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    color: #6b7280;
    display: flex; /* Docs-lite: תמיד מוצג — תפריט "עוד עיצוב" (תמיד יש docs-lite-secondary מוסתר) */
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    transition: all 0.2s ease;
}

.nav-overflow-btn:hover {
    background: rgba(30, 58, 95, 0.1);
    color: #1e3a5f;
}

.nav-overflow-btn.active {
    background: rgba(30, 58, 95, 0.15);
    color: #1e3a5f;
}

.nav-overflow-menu {
    position: absolute;
    top: 100%;
    left: 50%; /* מרכוז מתחת לכפתור */
    transform: translateX(-50%);
    margin-top: 8px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 6px 12px;
    display: none;
    flex-direction: row; /* שורה אופקית */
    flex-wrap: nowrap;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    z-index: 3000;
    max-width: calc(100vw - 20px); /* לא יצא מהמסך */
}

.nav-overflow-menu.show {
    display: flex;
}

/* Overflow menu separators - vertical for horizontal layout */
.overflow-separator {
    width: 1px;
    height: 24px;
    background: #e2e8f0;
    margin: 0 6px;
    flex-shrink: 0;
}

/* Overflow menu formatting buttons */
.nav-overflow-menu .formatting-tool-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.nav-overflow-menu .formatting-tool-icon:hover {
    background: rgba(30, 58, 95, 0.1);
    color: #1e3a5f;
}

/* Overflow menu selects */
.nav-overflow-menu .font-family-select,
.nav-overflow-menu .font-size-select {
    padding: 4px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: white;
    color: #374151;
    font-size: 13px;
    font-family: 'Galil', sans-serif;
    letter-spacing: normal;
    cursor: pointer;
    transition: all 0.15s ease;
    height: 32px;
    flex-shrink: 0;
}

.nav-overflow-menu .font-family-select {
    min-width: 90px;
}

.nav-overflow-menu .font-size-select {
    width: 55px;
}

.nav-overflow-menu .font-family-select:hover,
.nav-overflow-menu .font-size-select:hover {
    border-color: #1e3a5f;
}

/* User dropdown - outside the panel, mirrors the logo */
.nav-user-section {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.nav-tabs {
    display: flex;
    align-items: center;
    gap: 0;
    margin-left: 320px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-btn {
    padding: 8px;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Galil', sans-serif;
    letter-spacing: normal;
    font-size: 1rem;
    color: #6b7280;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    width: 32px;
    height: 32px;
}

.nav-btn:hover {
    background: rgba(30, 58, 95, 0.1);
    color: #1e3a5f;
    border-radius: 6px;
}

/* Disabled state for undo/redo buttons */
.nav-btn:disabled,
.nav-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.nav-btn:disabled:hover,
.nav-btn.disabled:hover {
    background: transparent;
    color: inherit;
}

.nav-tab {
    padding: 12px 24px;
    text-decoration: none;
    color: #64748b;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
    position: relative;
}

.nav-tab:hover {
    color: #1e3a5f;
    background: rgba(30, 58, 95, 0.05);
}

.nav-tab.active {
    color: #1e3a5f;
    background: rgba(30, 58, 95, 0.1);
}

.nav-tab.active::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    background: #1e3a5f;
    border-radius: 2px;
}

/* Document Tab - inside nav-document-section */
.nav-document-section .document-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0; /* ללא padding - הסקציה מספקת */
    background: transparent;
    border: none;
    border-radius: 0;
    cursor: pointer;
    font-size: 0.9rem;
    color: #374151;
    position: relative;
    max-width: 250px;
    min-width: auto;
    box-shadow: none;
    transition: all 0.2s ease;
}

.nav-document-section .document-tab:hover {
    background: transparent;
    color: #1e3a5f;
}

/* Document Tab (Chrome-style) - legacy for other uses */
.document-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #374151;
    position: relative;
    max-width: 300px;
    min-width: 180px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}

.document-tab:hover {
    background: #f8fafc;
    border-color: #1e3a5f;
    color: #1e3a5f;
}

.document-tab .fas.fa-file-alt {
    color: #1e3a5f;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.document-tab #currentDocumentTitle {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-weight: 500;
}

.document-tab .save-status-indicator {
    font-size: 0.7rem;
    margin-left: 4px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.document-tab .save-status-indicator.saved {
    color: #10b981;
}

.document-tab .save-status-indicator.unsaved {
    color: #f59e0b;
}

.document-tab .save-status-indicator.saving {
    color: #1e3a5f;
    animation: pulse 1s infinite;
}

.document-tab .edit-icon {
    font-size: 0.7rem;
    opacity: 0;
    transition: opacity 0.2s ease;
    color: #6b7280;
    flex-shrink: 0;
}

.document-tab:hover .edit-icon {
    opacity: 1;
}

.document-tab #documentTitleInput {
    background: white;
    border: 2px solid #1e3a5f;
    color: #374151;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    outline: none;
    width: 200px;
    text-align: right;
    direction: rtl;
}

.document-tab #documentTitleInput:focus {
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

/* User Dropdown Menu */
.user-dropdown {
    position: relative;
    display: inline-block;
}

.user-dropdown-toggle {
    padding: 4px;
    border: none;
    background: transparent;
    border-radius: 20px;
    cursor: pointer;
    font-family: 'Galil', sans-serif;
    letter-spacing: normal;
    font-size: 0.85rem;
    color: #374151;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.user-dropdown-toggle:hover {
    background: rgba(30, 58, 95, 0.1);
    color: #1e3a5f;
}

.user-dropdown-toggle .dropdown-arrow {
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

.user-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    min-width: 180px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    direction: rtl;
}

.user-dropdown.open .user-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: #374151;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f1f5f9;
    direction: rtl;
    text-align: right;
}

.user-dropdown-item:last-child {
    border-bottom: none;
}

.user-dropdown-item:hover {
    background: #f8fafc;
    color: #1e3a5f;
}

.user-dropdown-item.logout:hover {
    background: #fef2f2;
    color: #dc2626;
}

.user-dropdown-item i {
    width: 16px;
    text-align: center;
}

/* כותרת הדרופדאון - שם המשתמש */
.user-dropdown-header {
    padding: 12px 16px 8px 16px;
    border-bottom: 1px solid #f1f5f9;
    color: #374151;
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
    direction: rtl;
}

/* מפריד בסרגל הניווט */
.nav-separator {
    width: 1px;
    height: 16px;
    background: #d1d5db;
    margin: 0 6px;
}

/* בחירת גופן/גודל בניווט */
.nav-select {
    padding: 6px 8px;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Galil', sans-serif;
    letter-spacing: normal;
    font-size: 0.85rem;
    color: #6b7280;
    transition: all 0.2s;
    min-width: 50px;
    height: 32px;
    display: flex;
    align-items: center;
}

.nav-select:hover {
    background: rgba(30, 58, 95, 0.1);
    color: #1e3a5f;
}

.nav-select:focus {
    outline: none;
    background: rgba(30, 58, 95, 0.1);
    color: #1e3a5f;
}

/* דרופדאון עיצוב */
.formatting-dropdown-container {
    position: relative;
    display: inline-block;
}

/* ===================================
   NEW: Inline Formatting Toolbar
   סרגל עיצוב משולב בתוך הפאנל הלבן
   =================================== */

/* פס כלים אופקי - כעת בתוך הפאנל הלבן */
.formatting-toolbar-horizontal {
    display: flex !important;
    align-items: center;
    flex-direction: row;
    gap: 4px;
    background: transparent;
    direction: rtl;
    white-space: nowrap;
    box-sizing: border-box;
    flex-wrap: nowrap;
    overflow: visible;
    /* הוסרו: position, top, left, right, width, height, transform, opacity, visibility */
    /* הסרגל כעת inline בתוך nav-formatting-section */
}

/* מצב פתוח של הפס האופקי - תמיד מוצג בעיצוב החדש */
.formatting-toolbar-horizontal.show {
    display: flex !important;
}

/* דחיפת התוכן למטה - כבר לא נחוץ בעיצוב החדש */
body.formatting-toolbar-open .editor-container {
    margin-top: 0;
    height: calc(100vh - 60px);
    transition: margin-top 0.3s ease, height 0.3s ease;
}

/* הסרת החץ - לא נחוץ בעיצוב החדש */
.formatting-toolbar-horizontal::before {
    display: none;
}

/* כפתורי אייקונים בסרגל */
.formatting-toolbar-horizontal .formatting-tool-icon,
.formatting-toolbar-horizontal .formatting-tool {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.15s ease;
    font-size: 14px;
    flex-shrink: 0;
    margin: 0;
    position: relative;
}

.formatting-tool-icon:hover {
    background: linear-gradient(135deg, #1e3a5f, #2d4a6f);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(30, 58, 95, 0.3);
}

.formatting-tool-icon:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(30, 58, 95, 0.3);
}

/* בחירת פונט וגודל טקסט */
.formatting-toolbar-horizontal .font-family-select,
.formatting-toolbar-horizontal .font-size-select {
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.9);
    color: #374151;
    font-size: 13px;
    font-family: 'Galil', sans-serif;
    letter-spacing: normal;
    cursor: pointer;
    transition: all 0.15s ease;
    height: 34px;
    flex-shrink: 0;
    margin: 0;
    box-sizing: border-box;
}

.formatting-toolbar-horizontal .font-family-select {
    min-width: 110px;
}

.formatting-toolbar-horizontal .font-size-select {
    min-width: 60px;
}

.formatting-toolbar-horizontal .font-family-select:hover,
.formatting-toolbar-horizontal .font-size-select:hover {
    border-color: #1e3a5f;
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

.formatting-toolbar-horizontal .font-family-select:focus,
.formatting-toolbar-horizontal .font-size-select:focus {
    outline: none;
    border-color: #1e3a5f;
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

/* מפרידים בסרגל */
.formatting-toolbar-horizontal .toolbar-separator {
    display: inline-block;
    width: 1px;
    height: 24px;
    background: linear-gradient(to bottom, transparent, #d1d5db, transparent);
    margin: 0 8px;
    opacity: 0.6;
    flex-shrink: 0;
    align-self: center;
    vertical-align: middle;
}

/* אפקטי כניסה לכפתורים */
.formatting-toolbar-horizontal.show .formatting-tool-icon,
.formatting-toolbar-horizontal.show .formatting-tool {
    animation: slideInFromTop 0.2s ease forwards;
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* עיצוב הכפתורים לפי סדר */
.formatting-tool-icon:nth-child(1) { animation-delay: 0.05s; }
.formatting-tool-icon:nth-child(2) { animation-delay: 0.1s; }
.formatting-tool-icon:nth-child(3) { animation-delay: 0.15s; }
.formatting-tool-icon:nth-child(4) { animation-delay: 0.2s; }

.formatting-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: none;
    border: none;
    color: #374151;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    direction: rtl;
    text-align: right;
    width: 100%;
    font-family: 'Galil', sans-serif;
    letter-spacing: normal;
}

.formatting-dropdown-item:last-child {
    border-bottom: none;
}

.formatting-dropdown-item:hover {
    background: #f8fafc;
    color: #1e3a5f;
}

.formatting-dropdown-item i {
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

.formatting-dropdown-arrow {
    transition: transform 0.2s ease;
}

.formatting-dropdown-container.open .formatting-dropdown-arrow {
    transform: rotate(180deg);
}

/* קטגוריות בדרופדאון */
.formatting-category {
    margin-bottom: 8px;
}

.formatting-category:last-child {
    margin-bottom: 0;
}

.category-header {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 8px 16px 4px 16px;
    text-align: right;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 4px;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
}

.formatting-category:first-child .category-header {
    border-radius: 12px 12px 0 0;
    margin-top: -1px;
}

/* עיצוב מיוחד לכפתורים בקטגוריות */
.formatting-category .formatting-dropdown-item {
    margin: 2px 8px;
    border-radius: 6px;
    font-size: 0.85rem;
    padding: 10px 12px;
    transition: all 0.15s ease;
    position: relative;
}

.formatting-category .formatting-dropdown-item:hover {
    background: linear-gradient(135deg, #1e3a5f, #2d4a6f);
    color: white;
    transform: translateX(-2px);
    box-shadow: 0 2px 8px rgba(30, 58, 95, 0.3);
}

.formatting-category .formatting-dropdown-item:hover i {
    color: white;
    transform: scale(1.1);
}

.formatting-category .formatting-dropdown-item i {
    width: 18px;
    text-align: center;
    flex-shrink: 0;
    transition: all 0.15s ease;
    margin-left: 8px;
}

/* אפקטים מיוחדים לפי קטגוריה */
.formatting-category:nth-child(1) .formatting-dropdown-item:hover {
    background: linear-gradient(135deg, #10b981, #059669);
}

.formatting-category:nth-child(2) .formatting-dropdown-item:hover {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.formatting-category:nth-child(3) .formatting-dropdown-item:hover {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.formatting-category:nth-child(4) .formatting-dropdown-item:hover {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.formatting-category:nth-child(5) .formatting-dropdown-item:hover {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
}

.formatting-category:nth-child(6) .formatting-dropdown-item:hover {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
}

.formatting-category:nth-child(7) .formatting-dropdown-item:hover {
    background: linear-gradient(135deg, #84cc16, #65a30d);
}

.formatting-category:nth-child(8) .formatting-dropdown-item:hover {
    background: linear-gradient(135deg, #f97316, #ea580c);
}

/* סרגל גלילה מותאם אישית */
.formatting-dropdown-menu::-webkit-scrollbar {
    width: 6px;
}

.formatting-dropdown-menu::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.formatting-dropdown-menu::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #1e3a5f, #2d4a6f);
    border-radius: 3px;
}

.formatting-dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #162d4a, #1e3a5f);
}

/* אנימציות כניסה לכפתורים */
.formatting-dropdown-menu.show .formatting-dropdown-item {
    animation: slideInRight 0.15s ease forwards;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* הורה לכפתורים לפי סדר */
.formatting-dropdown-item:nth-child(1) { animation-delay: 0.05s; }
.formatting-dropdown-item:nth-child(2) { animation-delay: 0.1s; }
.formatting-dropdown-item:nth-child(3) { animation-delay: 0.15s; }
.formatting-dropdown-item:nth-child(4) { animation-delay: 0.2s; }

/* ריחוף על כותרת הקטגוריה */
.category-header:hover {
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    color: #475569;
}

/* אווטאר המשתמש */
.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e3a5f, #2d4a6f);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
    text-transform: uppercase;
}

.user-dropdown-toggle:hover .user-avatar {
    background: linear-gradient(135deg, #162d4a, #1e3a5f);
    box-shadow: 0 2px 8px rgba(30, 58, 95, 0.3);
}

/* ======================================== */
/* Download Dropdown Menu */
/* ======================================== */

.download-dropdown {
    position: relative;
    display: inline-block;
}

.download-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 8px;
    min-width: 180px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(-10px);
    transition: all 0.2s ease;
    padding: 6px 0;
}

.download-dropdown.open .download-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.download-menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: #374151;
    font-size: 14px;
    cursor: pointer;
    text-align: right;
    direction: rtl;
    transition: all 0.15s ease;
}

.download-menu button:hover {
    background: rgba(30, 58, 95, 0.1);
    color: #1e3a5f;
}

.download-menu button i {
    width: 16px;
    text-align: center;
    font-size: 14px;
}

.download-menu button i.fa-file-alt {
    color: #6b7280;
}

.download-menu button:hover i.fa-file-alt {
    color: #1e3a5f;
}

.download-menu button i.fa-file-word {
    color: #2563eb;
}

.download-menu button i.fa-file-pdf {
    color: #dc2626;
}

.download-menu button i.fa-print {
    color: #6b7280;
}

.download-menu button:hover i.fa-print {
    color: #1e3a5f;
}

.download-menu-separator {
    height: 1px;
    background: #e2e8f0;
    margin: 6px 0;
}

/* ===================================
   NEW: Responsive Styles for New Header
   =================================== */

/* Hide some formatting buttons on smaller screens */
@media (max-width: 1400px) {
    /* הסתרת רשימות והזחה */
    .nav-formatting-section .formatting-tool-icon:nth-child(n+10) {
        display: none;
    }
    /* כפתור overflow נשלט ע"י JavaScript */
}

@media (max-width: 1200px) {
    /* הסתרת יישור */
    .nav-formatting-section .formatting-tool-icon:nth-child(n+7) {
        display: none;
    }

    .nav-formatting-section .toolbar-separator:nth-child(n+3) {
        display: none;
    }

    /* הסתרת כפתורים פחות חיוניים */
    .nav-actions-section .nav-btn[title*="היסטוריה"] {
        display: none;
    }
}

@media (max-width: 1000px) {
    .nav-formatting-section .formatting-tool-icon:nth-child(n+5) {
        display: none;
    }

    .nav-formatting-section .toolbar-separator:nth-child(n+2) {
        display: none;
    }

    /* הסתרת בחירת פונט וגודל */
    .nav-formatting-section .font-family-select,
    .nav-formatting-section .font-size-select {
        display: none;
    }
}

@media (max-width: 800px) {
    /* הסתרת סקציית העיצוב, שימוש ב-overflow */
    .nav-formatting-section .formatting-toolbar-horizontal {
        display: none !important;
    }
    /* כפתור overflow נשלט ע"י JavaScript */

    .nav-button-panel {
        padding: 4px 8px;
        gap: 2px;
    }

    .nav-document-section {
        padding-left: 6px;
        margin-left: 4px;
    }

    /* הקטנת כפתורים */
    .nav-actions-section .nav-btn {
        padding: 6px;
        min-width: 28px;
    }

    /* הסתרת כפתורים נוספים */
    .nav-actions-section .ai-history-dropdown {
        display: none;
    }
}

@media (max-width: 600px) {
    .top-nav {
        padding: 4px 8px;
        gap: 6px;
    }

    .nav-logo span {
        display: none;
    }

    .nav-logo-img {
        height: 28px;
    }

    .nav-document-section #currentDocumentTitle {
        max-width: 80px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* הסתרת סקציית עיצוב - אבל שמירה על דרופדאון הניקוי */
    .nav-formatting-section {
        border-left: none;
        padding: 0;
        margin-left: 0;
    }

    .nav-formatting-section .formatting-toolbar-horizontal {
        display: none !important;
    }

    /* הסתרת כפתורים נוספים */
    .nav-actions-section .nav-separator {
        display: none;
    }

    .nav-actions-section .download-dropdown .fa-caret-down {
        display: none;
    }
}

@media (max-width: 480px) {
    .nav-button-panel {
        padding: 2px 4px;
    }

    .nav-document-section {
        border-left: none;
        padding-left: 4px;
        margin-left: 2px;
    }

    .nav-document-section #currentDocumentTitle {
        max-width: 60px;
    }

    /* הצגת רק כפתורים הכרחיים */
    .nav-actions-section .nav-btn:not([onclick*="saveText"]):not([onclick*="toggleDownloadMenu"]) {
        display: none;
    }

    .nav-user-section {
        border-left: none;
        padding-left: 4px;
        margin-left: 2px;
    }

    .user-dropdown .dropdown-arrow {
        display: none;
    }
}

/* ===================================
   Toggle Button for Formatting Panel
   כפתור פתיחה/סגירה של העיצוב
   =================================== */

.nav-formatting-toggle {
    padding: 6px 10px;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 12px;
    transition: all 0.2s ease;
}

.nav-formatting-toggle:hover {
    background: rgba(30, 58, 95, 0.1);
    border-color: #1e3a5f;
    color: #1e3a5f;
}

.nav-formatting-toggle.active {
    background: rgba(30, 58, 95, 0.1);
    border-color: #1e3a5f;
    color: #1e3a5f;
}

.nav-formatting-toggle .fa-chevron-down {
    font-size: 10px;
    transition: transform 0.2s ease;
}

.nav-formatting-toggle.active .fa-chevron-down {
    transform: rotate(180deg);
}