/* ============================================
   RESET & BASE STYLES - GLASS MORPHISM VERSION
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Inter', system-ui, sans-serif;
    background: linear-gradient(135deg, #0a0a0f 0%, #0f0f1a 100%);
    min-height: 100vh;
    direction: ltr;
    overflow-x: hidden;
    color: #e5e5e5;
}

/* ============================================
   LIGHT MODE
   ============================================ */

body.light-mode {
    background: linear-gradient(135deg, #f0f0f5 0%, #e0e0e8 100%);
    color: #1a1a2e !important;
}

body.light-mode .chat-container {
    background: rgba(255,255,255,0.85);
    border: 1px solid rgba(109,40,217,0.2);
}

body.light-mode .chat-header {
    background: rgba(255,255,255,0.6);
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

body.light-mode .chat-header h1 {
    background: linear-gradient(135deg, #6d28d9, #8b5cf6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

body.light-mode .chat-header p {
    color: #444 !important;
    opacity: 1;
}

body.light-mode .ai-message {
    background: rgba(255,255,255,0.85);
    color: #1a1a2e !important;
    border-left: 3px solid #6d28d9;
}

body.light-mode .user-message {
    background: rgba(109,40,217,0.12);
    color: #6d28d9 !important;
    border: 1px solid rgba(109,40,217,0.3);
}

body.light-mode .welcome-msg {
    background: rgba(255,255,240,0.85) !important;
    color: #1a1a2e !important;
    border-left: 3px solid #6d28d9;
}

body.light-mode .welcome-section {
    background: rgba(109,40,217,0.05);
    color: #1a1a2e !important;
}

body.light-mode .welcome-section strong {
    color: #6d28d9;
    opacity: 1;
}

body.light-mode .welcome-header {
    color: #6d28d9;
    opacity: 1;
}

body.light-mode .welcome-footer {
    color: #555;
}

body.light-mode .chat-input-area {
    background: rgba(240,240,245,0.7);
    border-top: 1px solid rgba(0,0,0,0.08);
}

body.light-mode .input-wrapper {
    background: rgba(255,255,255,0.8);
    border: 1px solid rgba(109,40,217,0.2);
}

body.light-mode .chat-input-area input,
body.light-mode .message-input {
    background: transparent;
    color: #1a1a2e !important;
}

body.light-mode .message-input::placeholder {
    color: #888;
}

body.light-mode .chat-input-area button {
    background: rgba(109,40,217,0.15);
    border: 1px solid rgba(109,40,217,0.3);
    color: #6d28d9;
}

body.light-mode .chat-input-area button:hover {
    background: #6d28d9;
    color: white;
}

body.light-mode .action-sidebar {
    background: rgba(255,255,255,0.8);
    border: 1px solid rgba(109,40,217,0.2);
}

body.light-mode .action-btn {
    background: rgba(109,40,217,0.1);
    color: #6d28d9;
}

body.light-mode .action-btn:hover {
    background: #6d28d9;
    color: white;
}

body.light-mode .chat-sidebar {
    background: rgba(255,255,255,0.88);
    border: 1px solid rgba(109,40,217,0.2);
}

body.light-mode .sidebar-header {
    border-bottom: 1px solid rgba(109,40,217,0.15);
}

body.light-mode .sidebar-header h3 {
    color: #6d28d9;
    opacity: 1;
}

body.light-mode .chat-list-item {
    background: rgba(109,40,217,0.06);
    color: #1a1a2e !important;
}

body.light-mode .chat-list-item:hover {
    background: rgba(109,40,217,0.12);
}

body.light-mode .chat-list-item.active {
    background: linear-gradient(135deg, #6d28d9, #8b5cf6);
    color: white !important;
}

body.light-mode .new-chat-btn {
    background: rgba(109,40,217,0.15);
    color: #6d28d9;
    border-color: rgba(109,40,217,0.3);
}

body.light-mode .new-chat-btn:hover {
    background: #6d28d9;
    color: white;
}

body.light-mode .typing-indicator {
    background: rgba(255,255,255,0.8);
    color: #6d28d9;
}

body.light-mode .footer {
    background: rgba(240,240,245,0.6);
    color: #555;
}

body.light-mode .menu-toggle {
    background: rgba(109,40,217,0.15);
    border-color: rgba(109,40,217,0.3);
    color: #6d28d9;
}

body.light-mode .menu-toggle:hover {
    background: #6d28d9;
    color: white;
}

body.light-mode .upload-preview-area {
    background: rgba(240,240,245,0.8);
}

body.light-mode .preview-item {
    background: rgba(0,0,0,0.1);
}

body.light-mode .copy-msg-btn,
body.light-mode .download-msg-btn {
    background: rgba(109,40,217,0.15);
    border-color: rgba(109,40,217,0.3);
    color: #6d28d9;
}

body.light-mode .copy-msg-btn:hover,
body.light-mode .download-msg-btn:hover {
    background: rgba(109,40,217,0.25);
}

body.light-mode .main-logo-3d {
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1))
            drop-shadow(0 0 8px rgba(109,40,217,0.2));
}

body.light-mode .sidebar-logo {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1))
            drop-shadow(0 0 4px rgba(109,40,217,0.15));
}

/* دکمه‌های هامبورگر */
.menu-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(45,212,191,0.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(45,212,191,0.3);
    color: #2dd4bf;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.menu-toggle:hover {
    transform: scale(1.05);
    background: rgba(45,212,191,0.25);
    color: white;
}

.action-toggle {
    left: auto;
    right: 20px;
}

.app-wrapper {
    display: flex;
    height: 100vh;
    width: 100%;
    position: relative;
    z-index: 1;
}

/* Chat Sidebar - کشویی از چپ */
.chat-sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 280px;
    height: 100vh;
    background: rgba(10,10,15,0.8);
    backdrop-filter: blur(16px);
    border-right: 1px solid rgba(45,212,191,0.15);
    display: flex;
    flex-direction: column;
    z-index: 1002;
    transition: left 0.3s ease;
}

.chat-sidebar.open {
    left: 0;
}

/* Action Sidebar - کشویی از راست */
.action-sidebar {
    position: fixed;
    top: 0;
    right: -80px;
    width: 70px;
    height: 100vh;
    background: rgba(10,10,15,0.8);
    backdrop-filter: blur(16px);
    border-left: 1px solid rgba(45,212,191,0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    gap: 15px;
    z-index: 1002;
    transition: right 0.3s ease;
    overflow-y: auto;
}

.action-sidebar.open {
    right: 0;
}

/* Main Chat Container */
.chat-container {
    flex: 1;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(12px);
    border-radius: 32px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(45,212,191,0.1);
    margin: 15px;
    z-index: 1;
}

/* Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: none;
}

.sidebar-overlay.active {
    display: block;
}

.sidebar-header {
    padding: 20px 15px;
    border-bottom: 1px solid rgba(45,212,191,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h3 {
    color: #2dd4bf;
    font-size: 1rem;
    opacity: 0.8;
}

.new-chat-btn {
    background: rgba(45,212,191,0.15);
    border: 1px solid rgba(45,212,191,0.3);
    padding: 6px 12px;
    border-radius: 20px;
    color: #2dd4bf;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: bold;
    transition: all 0.2s;
}

.new-chat-btn:hover {
    background: rgba(45,212,191,0.3);
    color: white;
}

.chat-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-list-item {
    padding: 12px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(45,212,191,0.04);
    color: #ccc;
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.chat-list-item:hover {
    background: rgba(45,212,191,0.1);
    color: #e5e5e5;
}

.chat-list-item.active {
    background: rgba(45,212,191,0.15);
    border-left: 3px solid #2dd4bf;
    color: #2dd4bf;
}

.chat-list-item .chat-title {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-list-item .delete-chat {
    background: rgba(255,255,255,0.05);
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 12px;
    opacity: 0.5;
}

.chat-list-item .delete-chat:hover {
    opacity: 1;
    background: rgba(255,0,0,0.2);
}

.action-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(45,212,191,0.1);
    border: 1px solid rgba(45,212,191,0.2);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #2dd4bf;
    backdrop-filter: blur(4px);
}

.action-btn:hover {
    background: rgba(45,212,191,0.25);
    color: white;
    transform: scale(1.05);
    border-color: rgba(45,212,191,0.5);
}

.chat-header {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(12px);
    padding: 16px 24px;
    text-align: center;
    border-bottom: 1px solid rgba(45,212,191,0.08);
    flex-shrink: 0;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 5px;
}

.main-logo-3d {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    transition: all 0.2s ease;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2))
            drop-shadow(0 0 8px rgba(45,212,191,0.2));
    transform: perspective(500px) translateZ(5px);
}

.main-logo-3d:hover {
    transform: perspective(500px) translateZ(15px) scale(1.02);
    filter: drop-shadow(0 6px 12px rgba(0,0,0,0.3))
            drop-shadow(0 0 15px rgba(45,212,191,0.4));
}

.sidebar-logo {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2))
            drop-shadow(0 0 4px rgba(45,212,191,0.2));
    transform: perspective(300px) translateZ(3px);
}

.sidebar-logo:hover {
    transform: perspective(300px) translateZ(8px) scale(1.05);
    filter: drop-shadow(0 0 8px rgba(45,212,191,0.4));
}

.chat-header h1 {
    background: linear-gradient(135deg, rgba(167,139,250,0.7), rgba(45,212,191,0.7));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-size: 1.8rem;
    letter-spacing: 2px;
    font-weight: 700;
}

.chat-header p {
    color: #888;
    font-size: 0.8rem;
    margin-top: 6px;
    opacity: 0.7;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
}

/* ============================================
   پیام‌ها - کادر کوچک‌تر و وسط صفحه
   ============================================ */
.message {
    max-width: 75%;
    padding: 10px 16px;
    border-radius: 20px;
    font-size: 0.95rem;
    line-height: 1.5;
    animation: fadeIn 0.3s ease;
}

.user-message {
    background: rgba(109, 40, 217, 0.15);
    color: #d0d0ff;
    align-self: flex-end !important;
    border-bottom-right-radius: 6px;
    border: 1px solid rgba(109, 40, 217, 0.2);
    backdrop-filter: blur(4px);
}

.ai-message {
    position: relative;
    background: rgba(25, 25, 35, 0.5);
    color: #ccc;
    align-self: center !important;
    border-bottom-left-radius: 6px;
    border-left: 3px solid rgba(45,212,191,0.4);
    backdrop-filter: blur(4px);
    padding-bottom: 38px !important;
    padding-top: 12px !important;
    min-width: 90px;
    max-width: 80%;
}

/* دکمه‌های کپی و دانلود - پایین پیام (شناور) */
.message-actions {
    position: absolute;
    bottom: -20px;
    right: 10px;
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
    background: transparent;
    z-index: 10;
}

.ai-message:hover .message-actions {
    opacity: 1;
}

.copy-msg-btn, .download-msg-btn {
    background: rgba(45,212,191,0.2);
    border: 1px solid rgba(45,212,191,0.4);
    border-radius: 20px;
    padding: 4px 12px;
    cursor: pointer;
    font-size: 0.7rem;
    transition: all 0.2s ease;
    color: #2dd4bf;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: bold;
}

.copy-msg-btn:hover, .download-msg-btn:hover {
    background: rgba(45,212,191,0.4);
    transform: scale(1.02);
}

.copy-msg-btn i, .download-msg-btn i {
    font-size: 0.7rem;
}

/* تنظیم خودکار راست به چپ متن بر اساس زبان */
.message-content {
    direction: auto;
    unicode-bidi: plaintext;
    white-space: normal;
    word-break: break-word;
}

.message-content[dir="rtl"] {
    text-align: right;
}

.message-content[dir="ltr"] {
    text-align: left;
}

/* استایل برای کدهای داخل پیام */
.message-content code,
.message-content pre {
    background: rgba(0,0,0,0.4);
    border-radius: 8px;
    padding: 2px 6px;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.85rem;
    color: #2dd4bf;
}

.message-content pre {
    padding: 12px;
    overflow-x: auto;
    margin: 8px 0;
}

/* Welcome Message */
.welcome-msg {
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(25, 25, 35, 0.5) !important;
    border-left: 3px solid rgba(45,212,191,0.4);
    color: #ddd !important;
    max-width: 80% !important;
    width: auto !important;
    padding: 12px 18px !important;
    border-radius: 20px !important;
    align-self: center !important;
}

.welcome-short {
    font-size: 0.9rem !important;
    line-height: 1.4 !important;
}

.click-hint {
    color: #2dd4bf;
    text-decoration: underline;
    cursor: pointer;
    font-weight: bold;
    opacity: 0.8;
}

.click-hint:hover {
    color: #a78bfa;
    opacity: 1;
}

.welcome-full {
    margin-top: 10px;
    border-top: 1px solid rgba(45,212,191,0.1);
    padding-top: 10px;
}

.welcome-header {
    font-size: 0.9rem;
    color: #2dd4bf;
    margin-bottom: 10px;
    text-align: center;
    opacity: 0.8;
}

.welcome-section {
    background: rgba(45,212,191,0.03);
    border-radius: 10px;
    padding: 8px 12px;
    margin: 8px 0;
    border-left: 2px solid rgba(45,212,191,0.15);
    font-size: 0.8rem;
    color: #bbb;
}

.welcome-section strong {
    color: #a78bfa;
    opacity: 0.9;
}

.welcome-footer {
    margin-top: 10px;
    text-align: center;
    font-size: 0.8rem;
    color: #999;
}

.typing-indicator {
    background: rgba(25,25,35,0.5);
    backdrop-filter: blur(4px);
    color: #aaa;
    align-self: flex-start;
    padding: 12px 18px;
    border-radius: 24px;
    font-size: 0.85rem;
    display: flex;
    gap: 6px;
}

.typing-indicator span {
    animation: blink 1.4s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink {
    0%,60%,100% { opacity: 0; }
    30% { opacity: 1; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px);}
    to { opacity: 1; transform: translateY(0);}
}

/* ============================================
   بخش آپلود چند فایل
   ============================================ */
.upload-preview-area {
    background: rgba(20,20,30,0.8);
    backdrop-filter: blur(8px);
    border-top: 1px solid rgba(45,212,191,0.2);
    border-bottom: 1px solid rgba(45,212,191,0.2);
    padding: 12px 16px;
    margin: 0 15px;
}

.upload-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(45,212,191,0.1);
    color: #2dd4bf;
    font-size: 0.85rem;
}

.cancel-all-btn {
    background: rgba(255,0,0,0.2);
    border: none;
    border-radius: 20px;
    padding: 4px 12px;
    cursor: pointer;
    color: #ff6666;
    font-size: 0.7rem;
}

.cancel-all-btn:hover {
    background: rgba(255,0,0,0.4);
}

.upload-preview-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    max-height: 150px;
    overflow-y: auto;
}

.preview-item {
    background: rgba(0,0,0,0.4);
    border-radius: 12px;
    padding: 6px;
    text-align: center;
    position: relative;
    width: 100px;
}

.preview-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

.preview-item-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5px;
    font-size: 0.6rem;
    color: #aaa;
}

.preview-file-name {
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.remove-file-btn {
    background: rgba(255,0,0,0.3);
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    cursor: pointer;
    color: white;
    font-size: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-file-btn:hover {
    background: rgba(255,0,0,0.6);
}

/* ============================================
   فیلد ورودی - بزرگتر و قابل نوشتن
   ============================================ */
.chat-input-area {
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(8px);
    padding: 16px;
    display: flex;
    justify-content: center;
    border-top: 1px solid rgba(45,212,191,0.08);
    flex-shrink: 0;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: rgba(20,20,30,0.5);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(45,212,191,0.15);
    border-radius: 60px;
    width: 100%;
    max-width: 800px;
    min-height: 50px;
}

.upload-btn {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #2dd4bf;
    padding: 0 15px;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    opacity: 0.7;
    transition: all 0.2s;
}

.upload-btn:hover {
    background: rgba(45,212,191,0.15);
    opacity: 1;
}

.message-input {
    flex: 1;
    padding: 14px 12px;
    background: transparent;
    border: none;
    color: white;
    font-size: 0.95rem;
    outline: none;
    font-family: inherit;
    min-width: 0;
    resize: vertical;
    max-height: 150px;
    overflow-y: auto;
    line-height: 1.4;
}

.message-input::placeholder {
    color: #666;
    font-size: 0.85rem;
}

.chat-input-area button {
    background: rgba(45,212,191,0.12);
    border: 1px solid rgba(45,212,191,0.25);
    padding: 0 25px;
    border-radius: 60px;
    color: #2dd4bf;
    font-weight: bold;
    cursor: pointer;
    height: 46px;
    margin: 5px;
    font-size: 0.85rem;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.2s;
    backdrop-filter: blur(4px);
}

.chat-input-area button:hover {
    background: rgba(45,212,191,0.25);
    transform: scale(1.02);
    color: white;
    border-color: rgba(45,212,191,0.5);
}

.footer {
    font-size: 0.65rem;
    text-align: center;
    padding: 12px;
    background: rgba(0,0,0,0.2);
    color: #666;
    flex-shrink: 0;
}

.footer-content {
    margin-bottom: 8px;
}

.translate-footer {
    text-align: center;
}

.translate-footer .goog-te-combo {
    background: rgba(20,20,30,0.5);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(45,212,191,0.2);
    color: #2dd4bf;
    padding: 6px 12px;
    border-radius: 30px;
    font-size: 0.75rem;
    cursor: pointer;
}

.translate-footer .goog-te-combo:hover {
    border-color: #a78bfa;
    background: rgba(45,212,191,0.1);
}

.goog-te-banner-frame {
    display: none !important;
}

.goog-te-balloon-frame {
    display: none !important;
}

body {
    top: 0px !important;
}

.message img {
    max-width: 200px;
    max-height: 150px;
    border-radius: 12px;
    margin-top: 8px;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.1);
    object-fit: contain;
}

/* ============================================
   استایل برای آیکون فایل‌ها
   ============================================ */
.file-icon-preview {
    width: 80px;
    height: 80px;
    background: rgba(0,0,0,0.4);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.file-ext {
    font-size: 0.6rem;
    color: #aaa;
    margin-top: 4px;
}

.file-download-card {
    background: rgba(0,0,0,0.3);
    border-radius: 12px;
    padding: 10px 15px;
    margin: 5px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    border: 1px solid rgba(45,212,191,0.2);
}

.file-download-card i {
    font-size: 1.5rem;
}

.file-download-card span {
    flex: 1;
    font-size: 0.8rem;
    word-break: break-all;
}

.download-file-btn {
    background: rgba(45,212,191,0.15);
    border: 1px solid rgba(45,212,191,0.3);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.7rem;
    color: #2dd4bf;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

.download-file-btn:hover {
    background: rgba(45,212,191,0.3);
}

.preview-file-content {
    text-align: center;
}

.preview-file-content img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
}

/* ============================================
   موبایل - تنظیمات مخصوص
   ============================================ */
@media (max-width: 768px) {
    .menu-toggle {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
        top: 15px;
        left: 15px;
    }
    
    .action-toggle {
        left: auto;
        right: 15px;
    }
    
    .chat-container {
        margin: 10px;
        border-radius: 24px;
    }
    
    .main-logo-3d {
        width: 34px;
        height: 34px;
    }
    
    .logo-container h1 {
        font-size: 1.2rem;
    }
    
    .chat-header h1 {
        font-size: 1rem;
    }
    
    .chat-header p {
        font-size: 0.6rem;
        padding: 0 30px;
    }
    
    .message {
        max-width: 90%;
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .message-actions {
        opacity: 1;
        bottom: -16px;
        right: 5px;
    }
    
    .copy-msg-btn, .download-msg-btn {
        padding: 3px 8px;
        font-size: 0.6rem;
    }
    
    .ai-message {
        padding-bottom: 32px !important;
        padding-top: 8px !important;
    }
    
    .preview-item {
        width: 70px;
    }
    .preview-item img {
        width: 55px;
        height: 55px;
    }
    .preview-file-name {
        display: none;
    }
    
    .upload-preview-list {
        max-height: 120px;
    }
    
    .welcome-msg {
        max-width: 95% !important;
        padding: 8px 12px !important;
    }
    
    .welcome-short {
        font-size: 0.8rem !important;
    }
    
    .welcome-section {
        padding: 5px 8px !important;
        font-size: 0.7rem !important;
    }
    
    .welcome-header {
        font-size: 0.8rem !important;
    }
    
    .welcome-footer {
        font-size: 0.7rem !important;
    }
    
    .chat-sidebar {
        width: 260px;
        left: -280px;
    }
    
    .action-sidebar {
        width: 60px;
        right: -70px;
    }
    
    .action-btn {
        width: 42px;
        height: 42px;
        font-size: 1.2rem;
    }
}

/* گوشی‌های خیلی کوچک */
@media (max-width: 480px) {
    .main-logo-3d {
        width: 28px;
        height: 28px;
    }
    
    .logo-container h1 {
        font-size: 0.9rem;
    }
    
    .chat-header h1 {
        font-size: 0.9rem;
    }
    
    .chat-header p {
        font-size: 0.55rem;
    }
    
    .input-wrapper button {
        padding: 0 12px;
        font-size: 0.7rem;
    }
    
    .upload-btn {
        width: 34px;
        height: 34px;
        font-size: 0.9rem;
    }
    
    .welcome-section br {
        display: none;
    }
    
    .preview-item {
        width: 60px;
    }
    .preview-item img {
        width: 48px;
        height: 48px;
    }
    
    .file-icon-preview {
        width: 55px;
        height: 55px;
        font-size: 1.5rem;
    }
    .file-download-card {
        width: 100%;
    }
}