/* Styles from original fbpost.php */

.ai-post-generator-container {
    margin: 20px;
}

.div-input {
    background-color: #fff;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 10;
}

.input {
    width: 90%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-bottom: 10px;
    text-align: right;
}

#submit-button,
#select-all-button,
#copy-button,
#stop-button {
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 10px 15px;
    cursor: pointer;
    font-weight: bold;
    margin: 0 5px;
    transition: background-color 0.3s;
}

#select-all-button {
    background-color: #28a745;
}

#select-all-button:hover {
    background-color: #218838;
}

#copy-button {
    background-color: #17a2b8;
}

#copy-button:hover {
    background-color: #138496;
}

#stop-button {
    background-color: #dc3545;
}

#stop-button:hover {
    background-color: #c82333;
}

#submit-button:hover,
#select-all-button:hover,
#copy-button:hover,
#stop-button:hover {
    opacity: 0.9;
}

#submit-button:disabled,
#copy-button:disabled,
#stop-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.button-container {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    position: relative;
    z-index: 100;
}

.ai-limit-message {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
    position: relative;
    z-index: 1;
    clear: both;
}

.div-chat {
    background-color: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    min-height: 200px;
    line-height: 1.6;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    direction: rtl;
    text-align: right;
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    color: #6c757d;
    font-style: italic;
    display: none;
    transition: all 0.3s ease;
}

.div-chat.ai-chat-visible {
    display: block;
}

.div-chat:not(:empty) {
    color: #212529;
    font-style: normal;
}

.div-chat:hover {
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.3);
    transition: all 0.3s ease;
}

.div-chat:active {
    border-color: #0056b3;
    box-shadow: 0 0 10px rgba(0, 86, 179, 0.5);
}

/* Notification styles */
.ai-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 6px;
    color: white;
    font-weight: bold;
    z-index: 10000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    font-size: 14px;
    animation: slideIn 0.3s ease-out;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 300px;
    word-wrap: break-word;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.ai-notification-success {
    background-color: #27ae60;
}

.ai-notification-error {
    background-color: #e74c3c;
}

.ai-notification-info {
    background-color: #3498db;
}

.div-responseBox {
    border: 1px solid #ccc;
    padding: 10px;
    margin-top: 20px;
    width: 100%;
    font-weight: bold;
    font-size: 16px;
    border-radius: 4px;
}

.progress {
    position: relative;
    width: 100%;
    height: 20px;
    background-color: #f3f3f3;
    border-radius: 10px;
    overflow: hidden;
    display: none; /* Hidden by default */
}

.progress-bar {
    position: absolute;
    width: 0;
    height: 100%;
    background-color: #4caf50;
    border-radius: 10px;
    transition: width 0.9s ease;
}

.progress-indicator {
    display: none;
}

.question-type-container,
.lang-type-container,
.api-provider-container,
.socials-type-container,
.custom-field-container {
    display: inline-block;
    vertical-align: top;
    margin-right: 10px;
}

.question-type-label,
.lang-type-label,
.socials-label,
.api-provider-label,
.custom-field-label {
    display: block;
    margin-bottom: 5px;
}

.question-type-dropdown,
.lang-type-dropdown,
.socials-dropdown,
.api-provider-dropdown,
.ai-custom-field {
    width: 150px;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-align: right;
}

.div-chat, .div-responseBox {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    direction: rtl;
}

/* Style the progress bar container */
.progress-container {
    width: 100%;
    background-color: #f3f3f3;
}

/* Style the progress bar */
.progress-bar {
    width: 0%;
    height: 10px;
    background-color: #4caf50;
    text-align: center;
    line-height: 10px;
    color: white;
    animation: progress-animation 15s ease-out forwards; /* Animation duration is 4 seconds */
}

/* Keyframe animation for the progress bar */
@keyframes progress-animation {
    0% { width: 0%; } /* Start with 0% width */
    100% { width: 75%; } /* End with 100% width */
}

.download-buttons {
    margin-top: 15px;
    text-align: center;
    padding: 10px;
}
.download-buttons button {
    margin: 5px;
    padding: 8px 15px;
}
.download-buttons i {
    margin-right: 5px;
}

.message-box table {
    direction: rtl;
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.message-box th, .message-box td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: right;
}

.message-box th {
    background-color: #f5f5f5;
    font-weight: bold;
}

.message-box tr:nth-child(even) {
    background-color: #f9f9f9;
}

.message-box tr:hover {
    background-color: #f0f0f0;
}

.markdown-body {
    direction: rtl;
    text-align: right;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    word-wrap: break-word;
    padding: 15px;
    height: auto;
    overflow-y: visible;
}

#chat {
    height: 250px !important;
    overflow-y: auto !important;
    position: relative;
    scroll-behavior: smooth;
}

#chat::-webkit-scrollbar {
    width: 8px;
}

#chat::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#chat::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

#chat::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.markdown-body::-webkit-scrollbar {
    width: 0 !important;
    display: none;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
    margin-top: 24px;
    margin-bottom: 16px;
    font-weight: 1000;
    line-height: 1.25;
}

.markdown-body table {
    direction: rtl;
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    overflow: auto;
}

.markdown-body table th,
.markdown-body table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: right;
}

.markdown-body table th {
    background-color: #f5f5f5;
    font-weight: bold;
}

.markdown-body table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.markdown-body table tr:hover {
    background-color: #f0f0f0;
}

.markdown-body ul,
.markdown-body ol {
    padding-right: 20px;
    padding-left: 0;
}

.markdown-body code,
.markdown-body pre {
    background: #0d1117;
    color: #c9d1d9;
    border-radius: 6px;
    font-family: Consolas, Monaco, 'Liberation Mono', 'Courier New', monospace;
}

.markdown-body code {
    padding: 0.2em 0.4em;
    font-size: 0.95em;
}

.markdown-body pre {
    padding: 16px;
    overflow-x: auto;
    margin: 18px 0;
}

.markdown-body blockquote {
    padding: 16px;
    background: #f3f4f6;
    border-right: 0.25em solid #a0aec0;
}

.markdown-body a {
    color: #0366d6;
    text-decoration: none;
}

.markdown-body a:hover {
    text-decoration: underline;
}

.markdown-body strong,
.markdown-body b {
    color: #111827;
}

.markdown-body em,
.markdown-body i {
    color: #475569;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
    color: #111827;
}

.markdown-body strong {
    font-weight: 1000;
}

.markdown-body hr {
    height: 0.25em;
    margin: 24px 0;
    background-color: #e1e4e8;
    border: 0;
}

.markdown-body blockquote {
    padding: 0 1em;
    color: #6a737d;
    border-right: 0.25em solid #dfe2e5;
    border-left: 0;
    margin: 0;
}

.markdown-body::-webkit-scrollbar {
    width: 8px;
}

.markdown-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.markdown-body::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.markdown-body::-webkit-scrollbar-thumb:hover {
    background: #555;
}


.toolbar {
    margin-bottom: 10px;
    padding: 5px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Language Switcher in Menu */
.ai-menu-language-switcher {
    list-style: none;
    display: inline-block;
    margin-left: 20px;
}

.ai-menu-language-switcher .ai-language-select {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ai-menu-language-switcher .ai-language-select:hover {
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.3);
}

.ai-menu-language-switcher .ai-language-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}

/* Language Switcher Container */
.ai-language-switcher {
    display: inline-block;
    margin: 10px;
}

.ai-language-switcher select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    color: #333;
    font-size: 14px;
    cursor: pointer;
}

.ai-language-switcher select:hover {
    border-color: #007bff;
}

/* Fixed Language Switcher (displayed at top of page) */
.ai-language-switcher-fixed {
    position: fixed;
    top: 10px;
    left: 10px;
    background-color: #fff;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-language-switcher-fixed label {
    margin: 0;
    font-weight: bold;
    color: #333;
    font-size: 13px;
}

.ai-language-select-floating {
    padding: 6px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
    color: #333;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ai-language-select-floating:hover {
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.3);
}

.ai-language-select-floating:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}

/* RTL Support */
.ai-language-switcher-fixed[dir="rtl"] {
    left: auto;
    right: 10px;
    flex-direction: row-reverse;
}

.ai-post-generator-container[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

.ai-post-generator-container[dir="ltr"] {
    direction: ltr;
    text-align: left;
}

.ai-post-generator-container[dir="rtl"] .button-container,
.ai-post-generator-container[dir="rtl"] .custom-field-container {
    direction: rtl;
}

.ai-post-generator-container[dir="rtl"] label,
.ai-post-generator-container[dir="rtl"] input,
.ai-post-generator-container[dir="rtl"] textarea,
.ai-post-generator-container[dir="rtl"] select {
    direction: rtl;
    text-align: right;
}

.ai-post-generator-container[dir="ltr"] input,
.ai-post-generator-container[dir="ltr"] textarea,
.ai-post-generator-container[dir="ltr"] select {
    direction: ltr;
    text-align: left;
}

.toolbar select {
    height: 30px;
    margin: 0 5px;
    padding: 0 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background-color: white;
}

/* Translated content direction support */
.ai-translated-content[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

.ai-translated-content[dir="ltr"] {
    direction: ltr;
    text-align: left;
}

.toolbar .color-btn {
    width: 30px;
    height: 30px;
    padding: 0;
    margin: 0 2px;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.toolbar .color-btn i {
    font-size: 14px;
}

.toolbar .color-picker {
    position: absolute;
    width: 30px;
    height: 30px;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

.toolbar .color-preview {
    width: 20px;
    height: 4px;
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #000;
}

.toolbar button {
    margin: 0 2px;
}

.toolbar button:hover {
    background-color: #e0e0e0;
}

.toolbar select.heading-select {
    min-width: 120px;
    height: 30px;
    padding: 0 5px;
    margin: 0 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background-color: white;
    font-family: Arial, sans-serif;
}
