@font-face {
    font-family: 'Vazir';
    src: url('https://cdn.jsdelivr.net/gh/rastikerdar/vazir-font@v30.1.0/dist/Vazir-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

.ai-persian-container {
    font-family: 'Vazir', sans-serif;
    direction: rtl;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    background-color: #fff;
    margin: 20px auto;
    max-width: 900px;
    position: relative;
}

.ai-persian-header {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-persian-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.ai-persian-status {
    display: flex;
    align-items: center;
    font-size: 14px;
}

.ai-persian-status-dot {
    width: 10px;
    height: 10px;
    background-color: #4ade80;
    border-radius: 50%;
    margin-left: 8px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(74, 222, 128, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0);
    }
}

.ai-persian-messages {
    padding: 20px;
    background-color: #f8fafc;
    overflow-y: auto;
    max-height: 500px;
    min-height: 300px;
}

.ai-persian-welcome {
    text-align: center;
    padding: 30px 20px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    max-width: 500px;
    margin: 0 auto;
}

.ai-persian-welcome-icon {
    font-size: 50px;
    margin-bottom: 15px;
}

.ai-persian-welcome h4 {
    margin: 0 0 15px 0;
    color: #1e293b;
    font-size: 22px;
}

.ai-persian-welcome p {
    margin: 0 0 10px 0;
    color: #64748b;
    line-height: 1.6;
}

.ai-persian-supported-formats {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
}

.ai-persian-supported-formats p {
    margin: 0 0 10px 0;
    font-weight: 600;
    color: #334155;
}

.ai-persian-format-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.ai-persian-format-tag {
    background-color: #f1f5f9;
    color: #64748b;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.ai-persian-message {
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.ai-persian-user-message {
    justify-content: flex-end;
}

.ai-persian-message-content {
    max-width: 80%;
    padding: 15px 20px;
    border-radius: 18px;
    line-height: 1.6;
    position: relative;
    font-size: 15px;
}

.ai-persian-user-message .ai-persian-message-content {
    background-color: #2575fc;
    color: white;
    border-bottom-right-radius: 4px;
}

.ai-persian-assistant-message .ai-persian-message-content {
    background-color: white;
    color: #334155;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.ai-persian-message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    margin: 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    flex-shrink: 0;
}

.ai-persian-user-message .ai-persian-message-avatar {
    background-color: #2575fc;
    order: 2;
}

.ai-persian-assistant-message .ai-persian-message-avatar {
    background-color: #6a11cb;
}

.ai-persian-copy-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 4px;
    padding: 5px 8px;
    cursor: pointer;
    font-size: 12px;
    color: #334155;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

.ai-persian-user-message .ai-persian-copy-btn {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.ai-persian-copy-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.ai-persian-copy-btn.copied {
    background-color: #4ade80;
    color: white;
}

.ai-persian-code-block {
    background-color: #1e293b;
    color: #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    margin: 10px 0;
    position: relative;
    overflow-x: auto;
    font-family: monospace;
    font-size: 14px;
    line-height: 1.5;
    direction: ltr;
    text-align: left;
}

.ai-persian-code-block .ai-persian-copy-btn {
    top: 10px;
    left: 10px;
    background-color: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

.ai-persian-code-block .ai-persian-copy-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.ai-persian-file-preview {
    margin: 10px 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    background-color: #fff;
}

.ai-persian-file-preview img {
    max-width: 100%;
    display: block;
}

.ai-persian-file-preview video {
    max-width: 100%;
    display: block;
}

.ai-persian-file-info {
    padding: 10px;
    background-color: #f1f5f9;
    font-size: 14px;
    color: #64748b;
    display: flex;
    align-items: center;
}

.ai-persian-file-icon {
    margin-left: 10px;
    font-size: 18px;
}

.ai-persian-file-list {
    margin: 10px 0;
}

.ai-persian-file-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background-color: #f1f5f9;
    border-radius: 6px;
    margin-bottom: 8px;
}

.ai-persian-file-item-icon {
    margin-left: 10px;
    font-size: 18px;
}

.ai-persian-file-item-name {
    flex: 1;
    font-size: 14px;
    color: #334155;
}

.ai-persian-file-item-size {
    font-size: 12px;
    color: #64748b;
    margin-left: 10px;
}

.ai-persian-input-area {
    padding: 15px;
    background-color: white;
    border-top: 1px solid #e2e8f0;
}

.ai-persian-upload-container {
    margin-bottom: 10px;
}

.ai-persian-upload-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 15px;
    background-color: #f1f5f9;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #64748b;
    font-size: 14px;
}

.ai-persian-upload-btn:hover {
    background-color: #e2e8f0;
    border-color: #94a3b8;
}

.ai-persian-upload-icon {
    margin-left: 8px;
    font-size: 16px;
}

.ai-persian-file-input {
    display: none;
}

.ai-persian-textarea-container {
    display: flex;
    align-items: flex-end;
}

.ai-persian-textarea {
    flex: 1;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 12px 15px;
    resize: none;
    min-height: 60px;
    max-height: 120px;
    font-family: inherit;
    font-size: 15px;
    outline: none;
    transition: border-color 0.3s;
}

.ai-persian-textarea:focus {
    border-color: #2575fc;
}

.ai-persian-send-btn {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0 20px;
    height: 44px;
    margin-right: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.ai-persian-send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 117, 252, 0.3);
}

.ai-persian-send-btn:active {
    transform: translateY(0);
}

.ai-persian-send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.ai-persian-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.ai-persian-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(37, 117, 252, 0.2);
    border-radius: 50%;
    border-top-color: #2575fc;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.ai-persian-loading p {
    color: #64748b;
    font-style: italic;
}

/* Image Generator Styles */
.ai-persian-image-generator-container {
    font-family: 'Vazir', sans-serif;
    direction: rtl;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    background-color: #fff;
    margin: 20px auto;
    max-width: 900px;
}

.ai-persian-image-generator-header {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    padding: 20px;
    text-align: center;
}

.ai-persian-image-generator-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.ai-persian-image-generator-form {
    padding: 20px;
    background-color: #f8fafc;
}

.ai-persian-form-group {
    margin-bottom: 15px;
}

.ai-persian-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #334155;
}

.ai-persian-form-group textarea,
.ai-persian-form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-family: inherit;
    font-size: 15px;
    outline: none;
    transition: border-color 0.3s;
}

.ai-persian-form-group textarea:focus,
.ai-persian-form-group select:focus {
    border-color: #2575fc;
}

.ai-persian-form-row {
    display: flex;
    gap: 15px;
}

.ai-persian-form-row .ai-persian-form-group {
    flex: 1;
}

.ai-persian-generate-image-btn,
.ai-persian-generate-video-btn {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.2s ease;
    width: 100%;
}

.ai-persian-generate-image-btn:hover,
.ai-persian-generate-video-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 117, 252, 0.3);
}

.ai-persian-generate-image-btn:active,
.ai-persian-generate-video-btn:active {
    transform: translateY(0);
}

.ai-persian-image-results,
.ai-persian-video-results {
    padding: 20px;
    background-color: white;
}

.ai-persian-image-grid,
.ai-persian-video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.ai-persian-image-item,
.ai-persian-video-item {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ai-persian-image-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.ai-persian-video-item video {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.ai-persian-image-item-info,
.ai-persian-video-item-info {
    padding: 10px;
    background-color: #f8fafc;
    font-size: 14px;
    color: #64748b;
}

.ai-persian-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
    font-style: italic;
}

/* Video Generator Styles */
.ai-persian-video-generator-container {
    font-family: 'Vazir', sans-serif;
    direction: rtl;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    background-color: #fff;
    margin: 20px auto;
    max-width: 900px;
}

.ai-persian-video-generator-header {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    padding: 20px;
    text-align: center;
}

.ai-persian-video-generator-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.ai-persian-video-generator-form {
    padding: 20px;
    background-color: #f8fafc;
}

/* Responsive design */
@media (max-width: 768px) {
    .ai-persian-container,
    .ai-persian-image-generator-container,
    .ai-persian-video-generator-container {
        margin: 10px;
        border-radius: 10px;
    }
    
    .ai-persian-header,
    .ai-persian-image-generator-header,
    .ai-persian-video-generator-header {
        padding: 15px;
    }
    
    .ai-persian-header h3,
    .ai-persian-image-generator-header h3,
    .ai-persian-video-generator-header h3 {
        font-size: 18px;
    }
    
    .ai-persian-status {
        font-size: 12px;
    }
    
    .ai-persian-messages {
        padding: 15px;
    }
    
    .ai-persian-message-content {
        max-width: 90%;
        font-size: 14px;
        padding: 12px 15px;
    }
    
    .ai-persian-input-area,
    .ai-persian-image-generator-form,
    .ai-persian-video-generator-form {
        padding: 10px;
    }
    
    .ai-persian-send-btn,
    .ai-persian-generate-image-btn,
    .ai-persian-generate-video-btn {
        padding: 0 15px;
        height: 40px;
        font-size: 14px;
    }
    
    .ai-persian-form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .ai-persian-image-grid,
    .ai-persian-video-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}
