/* chatbot.css - Styles for the Medical Assistant Interface */

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: #f5f7fa;
    color: #333;
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: 320px;
    background: white;
    border-right: 1px solid #e0e6ed;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid #e0e6ed;
    background: linear-gradient(135deg, #3498db 0%, #2c3e50 100%);
    color: white;
}

.sidebar-header h1 {
    font-size: 1.5rem;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-header p {
    opacity: 0.9;
    font-size: 0.9rem;
}

.patient-info {
    padding: 24px;
    border-bottom: 1px solid #e0e6ed;
}

.patient-info h3 {
    color: #2c3e50;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.patient-details {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 16px;
}

.detail-item {
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
}

.detail-label {
    color: #7f8c8d;
    font-size: 0.9rem;
    font-weight: 500;
}

.detail-value {
    color: #2c3e50;
    font-weight: 600;
}

.new-patient-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 16px;
    transition: background 0.3s ease;
}

.new-patient-btn:hover {
    background: #2980b9;
}

.consultation-history {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.consultation-history h3 {
    color: #2c3e50;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-item {
    background: white;
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.history-item:hover {
    border-color: #3498db;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.1);
}

.history-item.active {
    border-color: #3498db;
    background: #f0f9ff;
}

.history-date {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.history-summary {
    color: #7f8c8d;
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Main Chat Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f8fafc;
}

.chat-header {
    background: white;
    padding: 20px 24px;
    border-bottom: 1px solid #e0e6ed;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.chat-header-left h2 {
    color: #2c3e50;
    font-size: 1.4rem;
    margin-bottom: 4px;
}

.chat-header-left p {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.chat-actions {
    display: flex;
    gap: 12px;
}

.language-select {
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    padding: 6px 10px;
    background: #ffffff;
    color: #2c3e50;
    font-size: 0.9rem;
}

.rtl .chat-actions {
    flex-direction: row-reverse;
}

.rtl {
    direction: rtl;
}

.action-btn {
    background: white;
    border: 1px solid #e0e6ed;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #2c3e50;
    transition: all 0.3s ease;
}

.action-btn:hover {
    border-color: #3498db;
    color: #3498db;
}

.action-btn.primary {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.action-btn.primary:hover {
    background: #2980b9;
}

.chat-container {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.message {
    max-width: 75%;
    padding: 16px 20px;
    border-radius: 18px;
    line-height: 1.5;
    position: relative;
}

.message.ai {
    background: white;
    border: 1px solid #e0e6ed;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.message.user {
    background: linear-gradient(135deg, #3498db 0%, #2c3e50 100%);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.message-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
}

.message.ai .message-avatar {
    background: #3498db;
    color: white;
}

.message.user .message-avatar {
    background: white;
    color: #3498db;
}

.message-sender {
    font-weight: 600;
    font-size: 0.9rem;
}

.message.ai .message-sender {
    color: #3498db;
}

.message.user .message-sender {
    color: white;
}

.message-time {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-top: 8px;
    text-align: right;
}

.message-content {
    font-size: 0.95rem;
}

.chat-image-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chat-image-card:hover {
    border-color: #3498db;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.15);
}

.chat-image-thumb {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    background: #eef2f7;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3498db;
    font-size: 1.4rem;
    overflow: hidden;
    flex-shrink: 0;
}

.chat-image-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.chat-image-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.chat-image-name {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

.chat-image-type {
    font-size: 0.75rem;
    color: #2563eb;
    background: #dbeafe;
    padding: 2px 8px;
    border-radius: 999px;
    width: fit-content;
}

.chat-image-desc {
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.3;
}

.chat-image-analysis-btn {
    margin-top: 8px;
    border: 1px solid #c7d7ea;
    background: #f1f6ff;
    color: #1f3a5f;
    font-size: 0.8rem;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.chat-image-analysis-btn:hover {
    background: #e4eefc;
}

.analysis-waiting {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #1f2937;
    font-size: 0.9rem;
}

.analysis-waiting i {
    color: #3498db;
}

.message-references {
    margin-top: 10px;
}

.references-btn {
    background: #f4f8ff;
    border: 1px solid #d3e2f6;
    color: #2c3e50;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.references-btn:hover {
    background: #e8f1ff;
    border-color: #b6cff0;
}

.references-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1100;
}

.references-modal.open {
    display: flex;
}

.references-modal-content {
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    width: min(720px, 92vw);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.references-modal-header {
    padding: 18px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #204080, #3a6db5);
    color: #fff;
}

.references-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.references-modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
}

.references-modal-body {
    padding: 20px 22px 24px;
    overflow-y: auto;
}

.analysis-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1100;
}

.analysis-modal.open {
    display: flex;
}

.analysis-modal-content {
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    width: min(720px, 92vw);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.analysis-modal-header {
    padding: 18px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #204080, #3a6db5);
    color: #fff;
}

.analysis-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.analysis-modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
}

.analysis-modal-body {
    padding: 20px 22px 24px;
    overflow-y: auto;
}

.analysis-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 8px 16px;
    font-size: 0.9rem;
    color: #334155;
    margin-bottom: 16px;
}

.analysis-text {
    background: #f1f5f9;
    border-radius: 10px;
    padding: 14px 16px;
    color: #1f2937;
    font-size: 0.95rem;
    line-height: 1.5;
    word-break: break-word;
}

.analysis-text h1,
.analysis-text h2,
.analysis-text h3 {
    margin: 12px 0 8px;
    color: #0f172a;
}

.analysis-text ul,
.analysis-text ol {
    margin: 8px 0 8px 18px;
}

.analysis-text code {
    background: #e2e8f0;
    padding: 2px 6px;
    border-radius: 6px;
    font-family: "JetBrains Mono", "SFMono-Regular", ui-monospace, monospace;
    font-size: 0.9em;
}

.analysis-text pre {
    background: #0f172a;
    color: #e2e8f0;
    padding: 12px 14px;
    border-radius: 10px;
    overflow-x: auto;
}

.references-list {
    display: grid;
    gap: 14px;
}

.references-item {
    border: 1px solid #e6edf5;
    border-radius: 12px;
    padding: 14px 16px;
    background: #f8fbff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.references-item-title {
    font-weight: 600;
    color: #1f2d3d;
    font-size: 0.98rem;
    line-height: 1.3;
}

.references-item-meta {
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.references-item-excerpt {
    margin-top: 10px;
    font-size: 0.86rem;
    color: #475569;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    overflow: hidden;
}

.references-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.references-empty {
    text-align: center;
    color: #7f8c8d;
    padding: 30px 0;
}

.suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.suggestion-btn {
    background: white;
    border: 1px solid #e0e6ed;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.suggestion-btn:hover {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

/* Input Area */
.input-container {
    background: white;
    padding: 20px 24px;
    border-top: 1px solid #e0e6ed;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.input-wrapper {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.input-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

.input-action-btn {
    background: white;
    border: 1px solid #e0e6ed;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: #2c3e50;
    transition: all 0.3s ease;
}

.input-action-btn:hover {
    border-color: #3498db;
    color: #3498db;
}

.input-action-btn.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.message-input {
    flex: 1;
    border: 1px solid #e0e6ed;
    border-radius: 12px;
    padding: 16px 20px;
    font-size: 1rem;
    resize: none;
    min-height: 60px;
    max-height: 120px;
    outline: none;
    transition: border-color 0.3s ease;
}

.message-input:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.send-btn {
    background: linear-gradient(135deg, #3498db 0%, #2c3e50 100%);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
}

.send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

/* Voice Recording */
.voice-recording {
    background: white;
    border: 1px solid #e0e6ed;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    display: none;
}

.voice-visualizer {
    flex: 1;
    height: 40px;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.voice-wave {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 2px,
        #3498db 2px,
        #3498db 4px
    );
    animation: wave 1s linear infinite;
}

@keyframes wave {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-4px);
    }
}

.voice-time {
    font-family: monospace;
    font-size: 1.2rem;
    color: #2c3e50;
    font-weight: 600;
}

.voice-controls {
    display: flex;
    gap: 10px;
}

.voice-control-btn {
    background: white;
    border: 1px solid #e0e6ed;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.voice-control-btn:hover {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

/* File Upload */
.file-upload {
    background: white;
    border: 2px dashed #e0e6ed;
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: none;
}

.file-upload:hover {
    border-color: #3498db;
    background: #f0f9ff;
}

.file-upload.drag-over {
    border-color: #3498db;
    background: #e3f2fd;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.file-upload-icon {
    font-size: 2rem;
    color: #7f8c8d;
    margin-bottom: 12px;
}

.file-upload-text {
    color: #2c3e50;
    margin-bottom: 8px;
    font-weight: 500;
}

.file-upload-subtext {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.uploaded-files {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

.uploaded-file {
    background: white;
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 200px;
}

.file-thumb {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    color: #3498db;
    font-size: 1.2rem;
}

.file-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-weight: 500;
    color: #2c3e50;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    color: #7f8c8d;
    font-size: 0.8rem;
}

.file-remove {
    color: #e74c3c;
    cursor: pointer;
    font-size: 0.9rem;
}

.uploaded-file.uploaded-success {
    border-color: #27ae60;
    background-color: #f0fff4;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .sidebar {
        width: 280px;
    }
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: 40vh;
        border-right: none;
        border-bottom: 1px solid #e0e6ed;
    }

    .chat-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .chat-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .message {
        max-width: 90%;
    }
}

/* Typing Indicator Styles */
.typing-indicator {
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease;
}

.typing-content {
    padding: 15px;
    background: #f0f7ff;
    border-radius: 18px 18px 18px 4px;
    border: 1px solid #e0edff;
    min-height: 50px;
    display: flex;
    align-items: center;
}

.typing-dots {
    display: flex;
    align-items: center;
    gap: 6px;
}

.typing-dots .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #3498db;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dots .dot:nth-child(1) {
    animation-delay: -0.32s;
}

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

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

@keyframes typingBounce {
    0%,
    80%,
    100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid #e0e6ed;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #3498db 0%, #2c3e50 100%);
    color: white;
}

.modal-header h3 {
    font-size: 1.4rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background 0.2s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group.full-width {
    grid-column: span 2;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    font-size: 1rem;
    transition:
        border 0.2s,
        box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid #e0e6ed;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: #f8fafc;
}

.btn-primary,
.btn-secondary {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2980b9 0%, #1c5a80 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-group.full-width {
        grid-column: span 1;
    }

    .modal-content {
        width: 95%;
        margin: 10px;
    }
}

/* Empty State Styles */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
}

.empty-state-icon {
    font-size: 3rem;
    color: #cbd5e1;
    margin-bottom: 16px;
}

.empty-state-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #475569;
}

.empty-state-description {
    font-size: 0.95rem;
    line-height: 1.5;
    max-width: 300px;
    margin: 0 auto;
}

/* Loading Indicator Styles */
.loading-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: #f0f7ff;
    border-radius: 18px 18px 18px 4px;
    border: 1px solid #e0edff;
}

.loading-dots {
    display: flex;
    align-items: center;
    gap: 6px;
}

.loading-dots .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #3498db;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.loading-dots .dot:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots .dot:nth-child(2) {
    animation-delay: -0.16s;
}

.loading-dots .dot:nth-child(3) {
    animation-delay: 0s;
}

.loading-text {
    font-size: 0.95rem;
    color: #475569;
    font-weight: 500;
}

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

html[dir="rtl"] .toast-container {
    right: auto;
    left: 24px;
}

.toast {
    min-width: 220px;
    max-width: 360px;
    padding: 10px 14px;
    border-radius: 10px;
    color: #1f2a37;
    background: #f8fafc;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-info {
    border-left: 4px solid #3b82f6;
}

.toast-warning {
    border-left: 4px solid #f59e0b;
    background: #fff7ed;
}

.toast-error {
    border-left: 4px solid #ef4444;
    background: #fef2f2;
}
