/* General Styling */
body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* RTL Support */
[dir="rtl"] .navbar-nav {
    padding-right: 0;
}

/* Theme-specific styles */
[data-bs-theme="light"] {
    --custom-bg-color: #ffffff;
    --custom-text-color: #212529;
    --custom-border-color: #dee2e6;
    --custom-card-bg: #ffffff;
    --custom-badge-bg: #f8f9fa;
}

[data-bs-theme="dark"] {
    --custom-bg-color: #212529;
    --custom-text-color: #f8f9fa;
    --custom-border-color: #495057;
    --custom-card-bg: #343a40;
    --custom-badge-bg: #495057;
}

/* Text Wrapping */
.wrapped-text {
    white-space: pre-wrap;
    word-wrap: break-word;
    max-width: 100%;
    line-height: 1.6;
}

/* Card Styling */
.card {
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background-color: var(--custom-card-bg);
    border-color: var(--custom-border-color);
}

.card-title {
    color: var(--bs-primary);
}

/* Badge Styling */
.badge {
    font-size: 0.85em;
    padding: 0.4em 0.8em;
    margin-right: 0.5em;
    margin-left: 0.5em;
}

/* Case Detail Sections */
.case-section {
    padding: 1rem 0;
    border-bottom: 1px solid var(--bs-gray-200);
}

.case-section:last-child {
    border-bottom: none;
}

/* Search Results */
.results-container {
    margin-top: 2rem;
}

/* Form Controls */
.form-control {
    border-radius: 6px;
}

textarea.form-control {
    min-height: 120px;
}

/* Alert Styling */
.alert {
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

/* Algorithm Info Page */
.algorithm-info ul,
.terms-content ul {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.algorithm-info li,
.terms-content li {
    margin-bottom: 0.5rem;
}

.terms-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--bs-primary);
}

/* Prediction Results */
.prediction-results {
    margin-top: 2rem;
}

/* Signup and Login Forms */
.signup-card {
    margin-top: 2rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.form-check-label {
    font-size: 0.9rem;
}

.form-text {
    font-size: 0.85rem;
    color: #6c757d;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .card {
        margin-bottom: 1rem;
    }

    .badge {
        margin-bottom: 0.5rem;
    }

    .signup-card {
        margin-top: 1rem;
    }
}

/* Add your custom CSS here */
.phone-input-group {
    display: flex !important;
}

/* Fix for RTL layout - keep phone inputs in LTR direction */
[dir="rtl"] .phone-input-group {
    flex-direction: row !important;
}

/* Style for valid/invalid feedback specifically for phone */
#phone-validation-status.text-success {
    color: #198754;
}

#phone-validation-status.text-danger {
    color: #dc3545;
}

/* Chat interface styles */
.chat-messages {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    background-color: #f9f9f9;
}

.chat-message {
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    max-width: 80%;
    word-wrap: break-word;
}

.user-message {
    background-color: #e3f2fd;
    margin-left: auto;
    text-align: right;
}

.assistant-message {
    background-color: #f1f1f1;
    margin-right: auto;
}

.system-message {
    background-color: #fff3cd;
    margin: 0 auto;
    text-align: center;
    font-style: italic;
    max-width: 95%;
}

.chat-input-area {
    display: flex;
    flex-direction: column;
}

#chat-input {
    resize: none;
}

#send-message {
    align-self: flex-end;
}

/* Dark mode styles */
.dark-mode {
    background-color: #121212;
    color: #e0e0e0;
}

.dark-mode .card {
    background-color: #1e1e1e;
    color: #e0e0e0;
}

.dark-mode .navbar {
    background-color: #212121 !important;
}

.dark-mode .form-control {
    background-color: #2d2d2d;
    color: #e0e0e0;
    border-color: #444;
}

.dark-mode .btn-outline-primary {
    color: #90caf9;
    border-color: #90caf9;
}

.dark-mode .btn-outline-primary:hover {
    background-color: #0d47a1;
    color: #ffffff;
}

.dark-mode .chat-messages {
    background-color: #2d2d2d;
    border-color: #444;
}

.dark-mode .user-message {
    background-color: #1a3c67;
}

.dark-mode .assistant-message {
    background-color: #333333;
}

.dark-mode .system-message {
    background-color: #5f4a1f;
}

/* Loading indicator styles */
#loading-indicator .card {
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#loading-indicator .card-body {
    padding: 16px 20px;
}

#thinking-text {
    font-size: 1rem;
    font-weight: 500;
}

/* Dark mode for loading indicator */
.dark-mode #loading-indicator .card {
    background-color: #2a2a2a;
    border-color: #444;
}