  /* =========================================
           فونت‌های درخواستی
           ========================================= */
        @font-face {
            font-family: 'IRANSans';
            src: url('/assets/fonts/iransans-regular.woff') format('woff');
            font-weight: normal;
            font-style: normal;
            font-display: swap;
        }

        @font-face {
            font-family: 'Far_Yekan';
            src: url('/assets/fonts/Far_Yekan.ttf') format('truetype');
            font-weight: normal;
            font-style: normal;
            font-display: swap;
        }

        /* =========================================
           تنظیمات پایه
           ========================================= */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        html, body {
            overflow: hidden;
            height: 100vh;
        }

        body {
            font-family: 'IRANSans', sans-serif;
            background: #ffffff;
            display: flex;
            flex-direction: column;
            color: #333;
            position: relative;
        }

        /* =========================================
           نوتیفیکیشن مدرن کپی (Toast)
           ========================================= */
        .toast-notification {
            position: fixed;
            top: 25px;
            left: 50%;
            transform: translateX(-50%) translateY(-150%);
            background: rgba(16, 185, 129, 0.95);
            backdrop-filter: blur(12px);
            color: #fff;
            padding: 12px 24px;
            border-radius: 50px;
            display: flex;
            align-items: center;
            gap: 10px;
            box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
            z-index: 9999;
            opacity: 0;
            transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            font-weight: bold;
            font-size: 0.95rem;
            pointer-events: none;
        }

        .toast-notification.show {
            transform: translateX(-50%) translateY(0);
            opacity: 1;
        }

        .toast-notification svg {
            width: 22px;
            height: 22px;
            stroke: currentColor;
            stroke-width: 2.5;
            fill: none;
            stroke-linecap: round;
            stroke-linejoin: round;
        }

        /* =========================================
           هدر شناور
           ========================================= */
        header {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 25px 30px;
            background: transparent;
            z-index: 100;
            height: 85px;
        }

        .header-right {
            display: flex;
            align-items: center;
            gap: 24px;
        }

        .clean-icon {
            background: transparent;
            border: none;
            color: #334155;
            display: flex;
            justify-content: center;
            align-items: center;
            cursor: pointer;
            transition: all 0.3s ease;
            position: relative;
            z-index: 101;
        }

        .clean-icon svg {
            width: 28px;
            height: 28px;
            stroke: currentColor;
            transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }

        .clean-icon:hover {
            color: #4f46e5;
            transform: scale(1.15);
        }

        .premium-text {
            font-family: 'Far_Yekan', 'IRANSans', sans-serif;
            display: flex;
            align-items: center;
            gap: 8px;
            text-decoration: none;
            font-weight: 800;
            font-size: 1.05rem;
            color: #ffffff;
            background-color: #374151;
            padding: 8px 16px;
            border-radius: 20px;
            position: relative;
            z-index: 101;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            box-shadow: 0 4px 10px rgba(0,0,0,0.05);
        }

        .premium-text span {
            letter-spacing: 0.5px;
            transition: all 0.3s ease;
        }

        .premium-text svg {
            width: 20px;
            height: 20px;
            stroke: #ffffff;
            fill: transparent;
            stroke-width: 2;
            transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }

        .premium-text:hover {
            transform: translateY(-2px);
            background-color: #1f2937;
            box-shadow: 0 6px 15px rgba(0,0,0,0.1);
        }

        .premium-text:hover svg {
            transform: rotate(15deg) scale(1.1);
        }

        /* =========================================
           محیط چت
           ========================================= */
        .chat-container {
            position: absolute;
            top: 85px;
            bottom: 0;
            left: 0;
            right: 0;
            padding: 10px 20px 180px 20px; 
            display: flex;
            flex-direction: column;
            gap: 24px;
            overflow-y: auto;
            z-index: 10;
            max-width: 900px;
            margin: 0 auto;
            width: 100%;
            scroll-behavior: smooth;
        }

        .message-wrapper {
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            max-width: 90%;
            align-self: flex-start;
            width: 100%;
            animation: fadeIn 0.4s ease-out forwards;
        }

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

        .message-wrapper.ai {
            align-items: flex-start;
            align-self: flex-start;
        }

        /* پیام‌های کاربر - طراحی مدرن ۲۰۲۶ */
        .message-bubble {
            background: linear-gradient(145deg, #f8fafc, #ffffff);
            border: 1px solid rgba(226, 232, 240, 0.8);
            padding: 16px 22px;
            border-radius: 24px 24px 6px 24px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.02), inset 0 1px 0 rgba(255,255,255,1);
            color: #0f172a; 
            font-size: 1.05rem;
            line-height: 1.8;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
            word-wrap: break-word;
            white-space: pre-wrap;
            width: fit-content;
            max-width: 100%;
            position: relative;
        }

        .message-bubble:hover {
            box-shadow: 0 6px 25px rgba(0,0,0,0.04), inset 0 1px 0 rgba(255,255,255,1);
            transform: translateY(-2px);
            border-color: rgba(99, 102, 241, 0.2);
        }

        /* پیام هوش مصنوعی (بدون کادر) */
        .message-wrapper.ai .message-bubble {
            background: transparent;
            box-shadow: none;
            border: none;
            padding: 10px 0;
            color: #1f2937;
            cursor: text;
        }
        
        .message-wrapper.ai .message-bubble:hover {
            transform: none;
        }

        .message-actions {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-top: 10px;
            padding-right: 12px;
            opacity: 0.6;
            transition: opacity 0.3s ease;
            width: 100%;
        }

        .message-wrapper:hover .message-actions {
            opacity: 1;
        }

        .action-icon-btn {
            background: transparent;
            border: none;
            color: #94a3b8;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
            padding: 6px;
            border-radius: 50%;
        }

        .action-icon-btn:hover {
            color: #4f46e5;
            background: rgba(79, 70, 229, 0.08);
            transform: scale(1.1);
        }

        .action-icon-btn svg {
            width: 18px;
            height: 18px;
            stroke: currentColor;
            stroke-width: 2.2;
            fill: none;
            stroke-linecap: round;
            stroke-linejoin: round;
        }

        /* استایل خاص برای آیکون‌های لایک و رفرش و متن بازخورد */
        .feedback-text {
            font-size: 0.85rem;
            color: #10b981;
            font-weight: bold;
            opacity: 0;
            transform: translateX(10px);
            transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            margin-right: auto; /* هُل دادن به سمت چپ */
            pointer-events: none;
        }

        .feedback-text.show {
            opacity: 1;
            transform: translateX(0);
        }

        /* =========================================
           ویرایش درجا (Inline Edit) - UI مدرن و لیست
           ========================================= */
        .inline-edit-container {
            display: flex;
            flex-direction: column;
            gap: 12px;
            width: 100%;
            background: rgba(255, 255, 255, 0.8);
            backdrop-filter: blur(12px);
            border: 1px solid rgba(99, 102, 241, 0.3);
            padding: 16px;
            border-radius: 20px;
            box-shadow: 0 10px 30px rgba(99, 102, 241, 0.1);
            margin-top: 5px;
            animation: expandEdit 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
        }

        @keyframes expandEdit {
            from { opacity: 0; transform: scale(0.98) translateY(-10px); }
            to { opacity: 1; transform: scale(1) translateY(0); }
        }

        .inline-edit-textarea {
            width: 100%;
            min-height: 80px;
            border: none;
            background: transparent;
            font-family: inherit;
            font-size: 1.05rem;
            color: #0f172a;
            resize: vertical;
            outline: none;
            line-height: 1.7;
        }

        .modern-inline-actions {
            list-style: none;
            display: flex;
            justify-content: flex-end;
            gap: 14px;
            padding: 0;
            margin: 0;
            border-top: 1px solid rgba(0,0,0,0.05);
            padding-top: 12px;
        }

        .modern-inline-actions li {
            margin: 0;
            padding: 0;
        }

        .inline-icon-btn {
            background: rgba(255, 255, 255, 0.6);
            border: 1px solid rgba(0,0,0,0.05);
            border-radius: 50%;
            width: 44px;
            height: 44px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
        }

        /* رفع مشکل دیده نشدن آیکون‌های تیک و ضربدر */
        .inline-icon-btn svg {
            width: 22px;
            height: 22px;
            stroke-width: 2.5;
            fill: none;
            stroke: currentColor; /* این خط اضافه شد */
            stroke-linecap: round;
            stroke-linejoin: round;
        }

        .inline-icon-btn.cancel-btn {
            color: #ef4444;
        }

        .inline-icon-btn.cancel-btn:hover {
            background: #ef4444;
            color: white;
            box-shadow: 0 6px 16px rgba(239, 68, 68, 0.3);
            transform: scale(1.1);
        }

        .inline-icon-btn.confirm-btn {
            color: #10b981;
        }

        .inline-icon-btn.confirm-btn:hover {
            background: #10b981;
            color: white;
            box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
            transform: scale(1.1);
        }

        /* انیمیشن لودینگ پیام AI */
        .typing-indicator {
            display: flex;
            gap: 5px;
            padding: 10px 0 !important;
            align-items: center;
            height: 24px;
        }
        
        .typing-dot {
            width: 6px;
            height: 6px;
            background-color: #6366f1;
            border-radius: 50%;
            animation: typing 1.4s infinite ease-in-out both;
        }

        .typing-dot:nth-child(1) { animation-delay: -0.32s; }
        .typing-dot:nth-child(2) { animation-delay: -0.16s; }
        
        @keyframes typing {
            0%, 80%, 100% { transform: scale(0); opacity: 0.5; }
            40% { transform: scale(1); opacity: 1; }
        }

        /* =========================================
           مدال نمایش کامل پیام
           ========================================= */
        .message-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(255, 255, 255, 0.85);
            backdrop-filter: blur(15px);
            z-index: 2000;
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.3s ease;
        }

        .message-modal.active {
            opacity: 1;
            pointer-events: auto;
        }

        .modal-content {
            background: #fff;
            padding: 30px;
            border-radius: 20px;
            box-shadow: 0 10px 40px rgba(0,0,0,0.1);
            width: 90%;
            max-width: 600px;
            position: relative;
            transform: scale(0.9);
            transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            border: 1px solid rgba(79, 70, 229, 0.15);
        }

        .message-modal.active .modal-content {
            transform: scale(1);
        }

        .close-modal-btn {
            position: absolute;
            top: 15px;
            right: 15px;
            background: transparent;
            border: none;
            color: #9ca3af;
            cursor: pointer;
            transition: color 0.3s ease;
        }

        .close-modal-btn:hover {
            color: #ef4444;
        }

        .full-message-text {
            width: 100%;
            min-height: 150px;
            border: none;
            resize: none;
            font-family: inherit;
            font-size: 1.1rem;
            line-height: 1.6;
            color: #1f2937;
            outline: none;
            margin-top: 20px;
            background: transparent;
        }

        .modal-copy-btn {
            background: #4f46e5;
            color: #fff;
            border: none;
            padding: 10px 20px;
            border-radius: 10px;
            font-family: inherit;
            font-size: 1rem;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 8px;
            margin-top: 15px;
            transition: background 0.3s ease;
            width: 100%;
            justify-content: center;
        }

        /* =========================================
           منوی تمام‌صفحه
           ========================================= */
        .full-screen-menu {
            position: fixed;
            top: 0;
            right: 0;
            width: 100vw;
            height: 100vh;
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(40px);
            z-index: 1000;
            display: flex;
            flex-direction: column;
            transform: translateX(100%);
            transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
            overflow-y: auto;
            padding: 100px 40px 100px 40px;
        }

        .full-screen-menu.active { transform: translateX(0); }

        .close-menu-btn {
            position: absolute;
            top: 30px;
            right: 30px;
            background: transparent;
            border: none;
            color: #1f2937;
            cursor: pointer;
            transition: transform 0.3s ease;
            z-index: 10;
        }

        .close-menu-btn:hover { transform: rotate(90deg) scale(1.1); color: #ef4444; }
        .close-menu-btn svg { width: 36px; height: 36px; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }

        .menu-top-left {
            position: absolute;
            top: 35px;
            left: 35px;
            display: flex;
            gap: 20px;
            align-items: center;
            z-index: 10;
            height: 44px;
        }

        .default-icons {
            display: flex;
            gap: 20px;
            align-items: center;
            transition: opacity 0.3s ease, transform 0.3s ease;
        }

        .default-icons.hidden { opacity: 0; transform: scale(0.8); pointer-events: none; position: absolute; }
        .menu-action-icon { background: transparent; border: none; display: flex; justify-content: center; align-items: center; cursor: pointer; color: #1f2937; text-decoration: none; }
        .menu-action-icon svg { width: 28px; height: 28px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }

        .top-search-bar {
            display: flex;
            align-items: center;
            background: rgba(255, 255, 255, 0.85);
            backdrop-filter: blur(10px);
            border: 1px solid rgba(79, 70, 229, 0.2);
            border-radius: 30px;
            height: 44px;
            padding: 0 12px;
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
            width: 0;
            opacity: 0;
            overflow: hidden;
            transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
            position: absolute;
            left: 0;
            top: 50%;
            transform: translateY(-50%);
            pointer-events: none;
        }

        .top-search-bar.active { width: 300px; opacity: 1; pointer-events: auto; }
        .close-search-btn { background: transparent; border: none; color: #6b7280; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 5px; }
        .close-search-btn svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }

        .search-input-wrapper { flex: 1; position: relative; height: 100%; display: flex; align-items: center; margin: 0 10px; }
        .top-search-input { width: 100%; border: none; background: transparent; outline: none; font-family: 'IRANSans', sans-serif; font-size: 0.95rem; color: #1f2937; position: relative; z-index: 2; }

        .custom-placeholder {
            position: absolute;
            right: 0;
            top: 50%;
            transform: translateY(-50%);
            color: #9ca3af;
            font-size: 0.95rem;
            font-weight: 500;
            pointer-events: none;
            z-index: 1;
            transition: opacity 0.2s ease;
            white-space: nowrap;
        }

        .custom-placeholder .purple-text { color: #4f46e5; }
        .search-inner-icon { color: #4f46e5; display: flex; align-items: center; justify-content: center; padding: 5px; }
        .search-inner-icon svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }

        .menu-content-wrapper { max-width: 1000px; margin-right: 0; width: 100%; display: flex; flex-direction: column; flex: 1; gap: 20px; }
        .menu-items { list-style: none; width: 100%; padding: 0; }
        .menu-items li { margin: 10px 0; opacity: 0; transform: translateY(20px); transition: all 0.4s ease; }
        .full-screen-menu.active .menu-items li { opacity: 1; transform: translateY(0); }
        .full-screen-menu.active .menu-items li:nth-child(1) { transition-delay: 0.1s; }
        .full-screen-menu.active .menu-items li:nth-child(2) { transition-delay: 0.15s; }
        .full-screen-menu.active .menu-items li:nth-child(3) { transition-delay: 0.2s; }
        .full-screen-menu.active .menu-items .extra-items li { transition-delay: 0s; }

        .menu-items a, .menu-items button.toggle-more { background: none; border: none; text-decoration: none; font-size: 1.1rem; font-weight: bold; color: #1f2937; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; font-family: inherit; }
        .menu-items svg { width: 24px; height: 24px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }

        .extra-items { overflow: hidden; max-height: 0; transition: max-height 0.4s cubic-bezier(0.25, 1, 0.5, 1); }
        .extra-items.open { max-height: 200px; }
        .toggle-more { margin-top: 0 !important; color: #4f46e5 !important; }

        .conversations-section { border-top: 1px solid rgba(0,0,0,0.1); padding-top: 15px; opacity: 0; transform: translateY(20px); transition: all 0.4s ease 0.3s; display: flex; flex-direction: column; gap: 15px; flex: 1; }
        .full-screen-menu.active .conversations-section { opacity: 1; transform: translateY(0); }
        .conversations-header { display: flex; justify-content: space-between; align-items: center; }
        .conversations-header h3 { font-size: 1.1rem; color: #6b7280; font-weight: normal; }

        .empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: #9ca3af; margin-top: 40px; }
        .empty-state svg { width: 55px; height: 55px; stroke: #cbd5e1; stroke-width: 1.5; fill: none; }

        .new-chat-btn { background: #1f2937; color: #fff; border: none; padding: 12px 28px; border-radius: 50px; font-family: inherit; font-size: 1.05rem; font-weight: bold; display: flex; align-items: center; justify-content: center; width: fit-content; gap: 10px; cursor: pointer; margin-top: auto; align-self: flex-end; }
        .new-chat-btn svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2; fill: none; }

        /* =========================================
           کادر چت پایین صفحه
           ========================================= */
        .bottom-chat-panel {
            position: fixed;
            bottom: 25px;
            left: 50%;
            width: calc(100% - 40px);
            max-width: 900px;
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(35px);
            border: 1px solid rgba(0, 0, 0, 0.05);
            border-radius: 30px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 15px;
            padding: 15px 25px;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
            z-index: 50;
            transform: translate(-50%, 150%);
            animation: slideUpPanel 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards 0.3s;
        }

        @keyframes slideUpPanel { to { transform: translate(-50%, 0); } }

        .plus-icon-btn { background: rgba(79, 70, 229, 0.08); border: none; color: #4f46e5; cursor: pointer; display: flex; justify-content: center; align-items: center; flex-shrink: 0; padding: 8px; border-radius: 50%; }
        .plus-icon-btn svg { width: 24px; height: 24px; stroke: currentColor; stroke-width: 2.5; }

        .chat-input-field { flex: 1; min-width: 0; border: none; background: transparent; outline: none; padding: 0 10px; font-family: 'IRANSans', sans-serif; font-size: 1.1rem; color: #1f2937; }
        .chat-input-field::placeholder { color: #9ca3af; }

        .left-actions-group { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-shrink: 0; }
        .mic-icon-btn { background: transparent; border: none; color: #9ca3af; cursor: pointer; display: flex; justify-content: center; align-items: center; }
        .mic-icon-btn svg { width: 24px; height: 24px; stroke: currentColor; stroke-width: 2; fill: none; }

        .action-btn-container { position: relative; width: 48px; height: 48px; min-width: 48px; min-height: 48px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }

        .purple-circle-btn {
            position: absolute;
            inset: 0;
            margin: auto;
            width: 48px;
            height: 48px;
            min-width: 48px;
            min-height: 48px;
            border-radius: 50%;
            border: none;
            background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
            box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
        }

        .purple-circle-btn:hover { transform: scale(1.05); box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4); }
        
        .wave-btn { z-index: 2; }
        #sendBtn { z-index: 3; }

        .modern-wave { width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; gap: 2px; list-style: none; margin: 0; padding: 0; line-height: 0; direction: ltr; }
        .modern-wave li { display: block; width: 3px; background-color: #fff; border-radius: 3px; flex: 0 0 3px; }
        .modern-wave li:nth-child(1) { height: 6px; } .modern-wave li:nth-child(2) { height: 12px; } .modern-wave li:nth-child(3) { height: 18px; } .modern-wave li:nth-child(4) { height: 12px; } .modern-wave li:nth-child(5) { height: 6px; }

        .hidden-btn { opacity: 0; visibility: hidden; pointer-events: none; transform: scale(0.7); }
        #sendBtn svg { width: 22px; height: 22px; display: block; transition: all 0.3s ease; }

        /* =========================================
           ریسپانسیو موبایل
           ========================================= */
        @media (max-width: 768px) {
            header { padding: 20px 16px; height: 75px; }
            .chat-container { top: 75px; padding-bottom: 160px; }
            .header-right { gap: 16px; }
            .premium-text { font-size: 1rem; padding: 6px 14px; }
            .full-screen-menu { padding: 90px 20px 90px 20px; }
            .menu-top-left { top: 22px; left: 20px; height: 44px; }
            .top-search-bar.active { width: min(72vw, 260px); }
            .bottom-chat-panel { bottom: 15px; width: calc(100% - 30px); gap: 10px; padding: 12px 16px; border-radius: 24px; }
            .chat-input-field { font-size: 1rem; padding: 0 6px; }
        }
        @media (max-width: 420px) {
            .bottom-chat-panel { bottom: 12px; padding: 10px 14px; gap: 8px; width: calc(100% - 24px); }
        }