body {
    font-family: 'Vazir', Tahoma, sans-serif;
    background: #f0f4f8;
    color: #243c5a;
}

.hooshafza-chatbox {
    width: 100%;
    max-width: 95vw;
    background: #e3edf7;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(36, 60, 90, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: 20px auto;
    border: 2px solid #2a4d8f;
}

.chat-header {
    background-color: #2a4d8f;
    color: #fff;
    padding: 10px 15px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    margin: 0;
    font-size: 18px;
	color:#fff;
}
.chat-input-area textarea {
margin:20px;
}
#hooshafza-toggle-dark {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f9fbfe;
    min-height: 200px;
}

.msg {
    padding: 8px 12px;
    margin-bottom: 10px;
    border-radius: 14px;
    max-width: 80%;
    word-wrap: break-word;
    line-height: 1.3;
    font-size: 14px;
}

.msg.user {
    background: #2a4d8f;
    color: white;
    margin-left: auto;
}

.msg.bot {
    background: #d6e0f5;
    color: #243c5a;
    margin-right: auto;
}

.msg.error {
    background: #f8d7da;
    color: #721c24;
    text-align: center;
    max-width: 100%;
    border-radius: 8px;
}

/* تایپینگ */
.typing-dots span {
    animation-name: blink;
    animation-duration: 1.4s;
    animation-iteration-count: infinite;
    animation-timing-function: ease-in-out;
    font-weight: bold;
    font-size: 20px;
    margin-right: 4px;
    color: #2a4d8f;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes blink {
    0%, 80%, 100% {opacity: 0;}
    40% {opacity: 1;}
}

/* فرم تولید تصویر */
.hooshafza-imagegen-container {
    max-width: 350px;
    margin: 20px auto;
    text-align: center;
}

#hooshafza-img-prompt {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: 2px solid #2a4d8f;
    font-size: 14px;
    margin-bottom: 10px;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

#hooshafza-img-prompt:focus {
    outline: none;
    border-color: #1a2f5a;
}

/* دکمه سورمه ای */
#hooshafza-generate-btn,
#hooshafza-send-btn {
    background-color: #2a4d8f;
    color: white;
    border: none;
    border-radius: 12px;
    padding: 10px 20px;
	margin-bottom:20px;
    cursor: pointer;
	margin-right:20px;
    font-weight: 600;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

#hooshafza-generate-btn:hover,
#hooshafza-send-btn:hover {
    background-color: #1a2f5a;
}

/* پاپ‌آپ تصویر */
.img-popup {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(36, 60, 90, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.img-popup.hidden {
    display: none;
}

.img-popup-content {
    background: #e3edf7;
    padding: 20px;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 4px 20px rgba(42, 77, 143, 0.7);
    position: relative;
    text-align: center;
}

.img-popup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #2a4d8f;
    font-weight: bold;
    line-height: 1;
}

/* اسپینر */
.spinner {
    border: 6px solid #cbd6ea;
    border-top: 6px solid #2a4d8f;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    margin: 20px auto;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg);}
    100% { transform: rotate(360deg);}
}

/* پیام خطا در پاپ‌آپ */
.msg.error {
    color: #721c24;
    background: #f8d7da;
    padding: 10px;
    border-radius: 12px;
    margin-top: 10px;
    font-weight: 600;
}

/* حالت تاریک */
body.dark-mode {
    background: #1f2937;
    color: #cbd5e1;
}

body.dark-mode .hooshafza-chatbox {
    background: #2c3e50;
    border-color: #4c5c7d;
	
    box-shadow: 0 4px 16px rgba(20, 30, 45, 0.8);
}

body.dark-mode .chat-header {
    background-color: #4c5c7d;
    color: #cbd5e1;
}

body.dark-mode .chat-messages {
    background: #34495e;
    color: #cbd5e1;
}

body.dark-mode .msg.user {
    background: #5678a4;
    color: #e0e6f0;
}

body.dark-mode .msg.bot {
    background: #46627f;
    color: #d1dce8;
}

body.dark-mode #hooshafza-img-prompt {
    background: #34495e;
    border-color: #5678a4;
    color: #cbd5e1;
}

body.dark-mode #hooshafza-generate-btn,
body.dark-mode #hooshafza-send-btn {
    background-color: #5678a4;
    color: #e0e6f0;
}

body.dark-mode .img-popup-content {
    background: #2c3e50;
    box-shadow: 0 4px 20px rgba(30, 40, 55, 0.9);
}

body.dark-mode .img-popup-close {
    color: #a0b8dd;
}
