:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #c5c6ff;
    --secondary: #f43f5e;
    --dark: #1e293b;
    --darker: #0f172a;
    --darkest: #020617;
    --light: #f8fafc;
    --lighter: #f1f5f9;
    --gray: #94a3b8;
    --gray-dark: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-full: 9999px;
}

/* حالت تاریک */
.dark-mode {
    --primary: #818cf8;
    --primary-dark: #6366f1;
    --primary-light: #000000;
    --secondary: #fb7185;
    --dark: #1e293b;
    --darker: #0f172a;
    --darkest: #020617;
    --light: #e7e7e7;
    --lighter: #0f172a;
    --gray: #94a3b8;
    --gray-dark: #64748b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Vazirmatn', sans-serif;
}

body {
    background-color: var(--lighter);
    color: var(--dark);
    transition: background-color 0.3s, color 0.3s;
}

body.dark-mode {
    background-color: var(--darkest);
    color: var(--light);
}

/* استایل‌های صفحه لاگین */
.login-container {
    background: var(--light);
    padding: 2rem;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 350px;
    text-align: center;
    box-shadow: var(--shadow-md);
    margin: 1rem;
}

.dark-mode .login-container {
    background: var(--darker);
}

.login-title {
    margin-bottom: 1.5rem;
    color: var(--primary);
    font-size: 1.5rem;
}

.login-input {
    width: 100%;
    padding: 0.75rem;
    margin: 0.5rem 0;
    border: 1px solid var(--gray);
    border-radius: var(--radius);
    background: var(--light);
    color: var(--dark);
    font-size: 0.9rem;
    transition: border-color 0.3s;
}

.dark-mode .login-input {
    background: var(--dark);
    color: var(--light);
    border-color: var(--gray-dark);
}

.login-input:focus {
    outline: none;
    border-color: var(--primary);
}

.login-btn {
    width: 100%;
    padding: 0.75rem;
    border: none;
    margin-top: 1rem;
    border-radius: var(--radius);
    cursor: pointer;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    font-weight: bold;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(79, 70, 229, 0.3);
}

.switch-form {
    margin-top: 1rem;
    cursor: pointer;
    color: var(--primary);
    font-size: 0.9rem;
    display: inline-block;
    transition: color 0.3s;
}

.switch-form:hover {
    color: var(--primary-dark);
}

.error-message {
    color: var(--error);
    font-size: 0.8rem;
    margin-top: 0.25rem;
    text-align: right;
    display: none;
}

/* استایل‌های صفحه اشتراک */
.subscription-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.dark-mode .subscription-container {
    background: var(--darker);
}

.subscription-title {
    color: var(--primary);
    text-align: center;
    margin-bottom: 2rem;
}

.plans-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.plan-card {
    background: var(--lighter);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid var(--gray);
    position: relative;
    overflow: hidden;
}

.dark-mode .plan-card {
    background: var(--darkest);
    border-color: var(--gray-dark);
}

.plan-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.plan-card.popular {
    border: 2px solid var(--primary);
}

.plan-card.popular::before {
    content: "پیشنهاد ویژه";
    position: absolute;
    top: 0;
    left: 0;
    background: var(--primary);
    color: white;
    padding: 0.25rem 1rem;
    font-size: 0.8rem;
    border-bottom-right-radius: var(--radius);
}

.plan-name {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.plan-price {
    font-size: 1.75rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.plan-period {
    font-size: 0.9rem;
    color: var(--gray-dark);
}

.dark-mode .plan-period {
    color: var(--gray);
}

.plan-features {
    list-style: none;
    margin: 1.5rem 0;
}

.plan-features li {
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.plan-features li::before {
    content: "✓";
    color: var(--success);
}

.subscribe-btn {
    width: 100%;
    padding: 0.75rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
}

.subscribe-btn:hover {
    background: var(--primary-dark);
}

/* استایل‌های نوار وضعیت مهمان */
.guest-status-bar {
    padding: 0.75rem 1rem;
    background: var(--light);
    color: var(--gray-dark);
    font-size: 0.85rem;
    text-align: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.dark-mode .guest-status-bar {
    background: var(--darker);
    color: var(--gray);
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

.guest-counter {
    font-weight: bold;
    color: var(--primary);
}

.guest-login-btn {
    color: var(--primary);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
}

.guest-login-btn:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.guest-limit-message {
    background-color: rgba(255, 167, 38, 0.1);
    padding: 1rem;
    border-radius: var(--radius);
    border-right: 3px solid var(--warning);
    margin: 1rem 0;
    font-size: 0.9rem;
}

.dark-mode .guest-limit-message {
    background-color: rgba(255, 167, 38, 0.2);
}

.guest-limit-message a {
    color: var(--primary);
    font-weight: bold;
    text-decoration: none;
    transition: color 0.3s;
}

.guest-limit-message a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* بقیه استایل‌های موجود... */
/* [بقیه کدهای CSS که قبلاً داشتید بدون تغییر باقی می‌ماند] */

/* استایل‌های واکنش‌گرا */
@media (max-width: 768px) {
    .plans-container {
        grid-template-columns: 1fr;
    }
    
    .subscription-container {
        padding: 1rem;
        margin: 1rem;
    }
    
    .login-container {
        padding: 1.5rem;
    }
}

.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* نوار کناری */
.sidebar {
    width: 280px;
    background-color: var(--light);
    display: flex;
    flex-direction: column;
    border-left: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    z-index: 10;
}

.dark-mode .sidebar {
    background-color: var(--darker);
    border-left-color: rgba(255, 255, 255, 0.1);
}

.sidebar-header {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.dark-mode .sidebar-header {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

.new-chat-btn {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.new-chat-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
}

.sidebar-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--gray-dark);
    cursor: pointer;
    transition: all 0.2s;
}

.dark-mode .icon-btn {
    color: var(--gray);
}

.icon-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--primary);
}

.dark-mode .icon-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.chat-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.chat-item {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    cursor: pointer;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s;
}

.chat-item:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.dark-mode .chat-item:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.chat-item.active {
    background-color: var(--primary-light);
    color: var(--primary-dark);
}

.dark-mode .chat-item.active {
    background-color: rgba(99, 102, 241, 0.2);
}

.chat-item-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray);
}

.chat-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-item-title {
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-item-preview {
    font-size: 0.8rem;
    color: var(--gray);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-panel {
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.dark-mode .user-panel {
    border-top-color: rgba(255, 255, 255, 0.05);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--primary-light);
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.username {
    font-size: 0.9rem;
    font-weight: 500;
}

.user-status {
    font-size: 0.75rem;
    color: var(--success);
}

/* بخش اصلی چت */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--lighter);
}

.dark-mode .chat-area {
    background-color: var(--darkest);
}

.chat-header {
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.dark-mode .chat-header {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chat-icon {
    color: var(--primary);
}

.chat-actions {
    display: flex;
    gap: 0.5rem;
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.welcome-message {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.welcome-content {
    max-width: 600px;
    text-align: center;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.welcome-content h3 {
    font-size: 1.5rem;
    color: var(--primary);
}

.welcome-content p {
    color: var(--gray-dark);
    line-height: 1.6;
}

.dark-mode .welcome-content p {
    color: var(--gray);
}

.quick-questions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

.quick-question {
    background-color: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-question:hover {
    background-color: rgba(99, 102, 241, 0.2);
    transform: translateY(-2px);
}

.message {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-lg);
    line-height: 1.6;
    position: relative;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.user {
    background-color: var(--primary);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: var(--radius-sm);
}

.message.ai {
    background-color: var(--light);
    color: var(--dark);
    align-self: flex-start;
    border-bottom-left-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

.dark-mode .message.ai {
    background-color: var(--dark);
    color: var(--light);
}

.message-time {
    display: block;
    font-size: 0.7rem;
    margin-top: 0.25rem;
    opacity: 0.7;
    text-align: left;
}

.message.user .message-time {
    text-align: right;
    color: rgba(255, 255, 255, 0.7);
}

.message-typing {
    display: flex;
    gap: 0.25rem;
    padding: 0.5rem;
}

.message-typing span {
    width: 8px;
    height: 8px;
    background-color: var(--gray);
    border-radius: 50%;
    display: inline-block;
    animation: bounce 1.4s infinite ease-in-out;
}

.message-typing span:nth-child(1) { animation-delay: 0s; }
.message-typing span:nth-child(2) { animation-delay: 0.2s; }
.message-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-5px); }
}

.input-area {
    padding: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.dark-mode .input-area {
    border-top-color: rgba(255, 255, 255, 0.05);
}

.input-container {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
}

textarea {
    flex: 1;
    border: none;
    border-radius: var(--radius-lg);
    padding: 0.75rem 3.5rem 0.75rem 1rem;
    resize: none;
    max-height: 150px;
    min-height: 50px;
    background-color: var(--light);
    color: var(--dark);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}

.dark-mode textarea {
    background-color: var(--dark);
    color: var(--light);
}

textarea:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--primary-light);
}

.input-actions {
    position: absolute;
    left: 0.5rem;
    bottom: 0.5rem;
    display: flex;
    gap: 0.25rem;
}

.send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.send-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

.disclaimer {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    text-align: center;
    color: var(--gray);
    opacity: 0.7;
}
/* کاهش فاصله بین پیام‌ها */
.messages-container {
    gap: 0.5rem; /* کاهش از 1rem به 0.5rem */
}

/* حذف دکمه ارسال فایل */
#attach-btn {
    display: none;
}

/* بهبود دکمه منو */
#menu-toggle {
    display: flex; /* اطمینان از نمایش در همه حالت‌ها */
}

/* استایل دکمه حذف چت */
.delete-chat-btn {
    background-color: var(--error);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 0.5rem;
    width: 100%;
    text-align: center;
}

.delete-chat-btn:hover {
    background-color: #dc2626;
}

/* بهبود ظاهر دکمه تم تاریک */
#theme-toggle {
    font-size: 1rem;
}
/* استایل‌های مودال تنظیمات */
.modal-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background-color: var(--light);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: fadeIn 0.3s ease;
}

.dark-mode .modal-content {
    background-color: var(--darker);
}

.modal-header {
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.dark-mode .modal-header {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.modal-header h3 {
    font-size: 1.25rem;
    color: var(--primary);
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray);
    transition: all 0.2s;
}

.close-modal:hover {
    color: var(--primary);
}

.modal-body {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray);
    border-radius: var(--radius);
    background-color: var(--light);
    color: var(--dark);
}

.dark-mode .form-group input {
    background-color: var(--dark);
    color: var(--light);
    border-color: var(--gray-dark);
}

.theme-options {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.theme-option {
    flex: 1;
    padding: 0.75rem;
    border-radius: var(--radius);
    border: 1px solid var(--gray);
    background-color: var(--light);
    color: var(--dark);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.guest-status-bar.hidden {
    display: none;
}
.dark-mode .theme-option {
    background-color: var(--dark);
    color: var(--light);
    border-color: var(--gray-dark);
}

.theme-option:hover {
    border-color: var(--primary);
}

.theme-option.active {
    border-color: var(--primary);
    background-color: var(--primary-light);
    color: var(--primary-dark);
}

.save-btn {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.save-btn:hover {
    background-color: var(--primary-dark);
}
/* استایل‌های جدید برای اسکرول بار نامرئی */
.messages-container::-webkit-scrollbar {
    width: 8px;
}

.messages-container::-webkit-scrollbar-track {
    background: transparent;
}

.messages-container::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 20px;
    border: 2px solid transparent;
    background-clip: content-box;
}

.dark-mode .messages-container::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
}

.messages-container::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.3);
}

.dark-mode .messages-container::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.3);
}
/* استایل‌های واکنش‌گرا */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        max-width: 320px;
    }
    
    .chat-item {
        padding: 0.5rem;
    }
}
@media (max-width: 768px) {
    #menu-toggle, #settings-btn {
        display: flex !important;
    }
    
    .sidebar {
        transition: transform 0.3s ease;
    }
}
/* حالت موبایل */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        transform: translateX(100%);
        width: 280px;
        z-index: 100;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .chat-area {
        width: 100%;
    }
    .guest-status-bar , .login-btn, .login-btn{
    display: none;
    }
}


/* انیمیشن‌ها */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}


