/* /home/siisi/vertex/vertex_app/static/css/chat.css */

/* ---------- Sessions sidebar ---------- */
/* The theme's base .card-header forces display:flex with no wrapping, so the
   toggle button and filter-links row get crammed onto one line. Allow wrapping
   so the links drop to their own line below the toggle, like Conversations does. */
.session-sidebar .card-header {
    flex-wrap: wrap;
    gap: 0.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

/* Decorative bubble pattern — same SVG polka-dot overlay used on
   .profile-gradient-bg (profile-header.css) and .swipe-fab/.swipe-glow
   (gallery.css), so this matches the site's established "bubbles on a
   gradient" treatment. */
.session-sidebar .card-header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.341 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23ffffff' fill-opacity='0.1' fill-rule='evenodd'/%3E%3C/svg%3E");
}

.session-sidebar .card-header > * {
    position: relative;
    z-index: 1;
}

/* White text/icons so they stay readable on the gradient — matches the
   "bubble" treatment used for .user-bubble/.user-avatar-placeholder elsewhere. */
.session-sidebar .card-header h5,
.session-sidebar .card-header .sessions-toggle-icon,
.session-sidebar .card-header .filter-link,
.session-sidebar .card-header .bi {
    color: #fff !important;
}

.session-sidebar .card-header .filter-link {
    opacity: 0.8;
}

.session-sidebar .card-header .filter-link.active,
.session-sidebar .card-header .filter-link:hover {
    opacity: 1;
    color: #fff !important;
}

.header-icon-bubble {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 52px !important;
    height: 52px !important;
    min-width: 52px;
    border-radius: 50% !important;
    background: #fff !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25) !important;
    font-size: 1.6rem !important;
    color: #764ba2 !important;
    flex-shrink: 0;
    margin-right: 0.75rem;
}
.header-icon-bubble i {
    color: #764ba2 !important;
}

/* Color comes from text-muted (already theme-aware) so this stays visible in dark mode. */
.filter-link {
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    padding-bottom: 2px;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}

.filter-link:hover {
    color: #43DC80 !important;
}

.filter-link.active {
    border-bottom-color: currentColor;
}

/* Bootstrap puts a green focus ring (theme's --bs-primary) on click — keep it
   for real keyboard navigation, drop it for mouse/touch clicks. */
.filter-link:focus:not(:focus-visible) {
    background-color: transparent;
    box-shadow: none;
    outline: none;
}

.filter-link i {
    background: transparent !important;
    box-shadow: none !important;
}

.session-icon-btn {
    padding: 2px 6px;
    font-size: 0.85rem;
    line-height: 1;
}

.sessions-toggle-icon {
    transition: transform 0.2s ease;
}

#sessions-toggle[aria-expanded="false"] .sessions-toggle-icon {
    transform: rotate(-90deg);
}

.session-item {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    background: #f8f9fa;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.session-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    background-color: rgba(102, 126, 234, 0.02);
}

.session-item.active {
    background-color: rgba(102, 126, 234, 0.08);
    border-left: 4px solid #667eea;
}

/* RAG Context Indicator */
.rag-context-indicator {
    color: #43DC80;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
}

/* --- Chat Container --- */
#chat-history {
    height: 65vh;
    min-height: 400px;
    overflow-y: auto;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

#chat-history.chat-history-empty {
    height: auto;
    min-height: 0;
    padding-bottom: 0;
    margin-bottom: 0;
}

/* --- Message Layout --- */
.message-container {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 24px;
    animation: messageSlideIn 0.3s ease;
}

.message-user {
    flex-direction: row;
    justify-content: flex-end;
}

.message-ai {
    flex-direction: row;
    justify-content: flex-start;
}

/* --- Avatar --- */
.message-avatar {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 50%;
    flex-shrink: 0;
}

.message-user .message-avatar {
    border: 2.5px solid #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.25), 0 4px 8px rgba(0, 0, 0, 0.15);
}

.message-ai .message-avatar {
    border: 2.5px solid #764ba2;
    box-shadow: 0 0 0 3px rgba(118, 75, 162, 0.25), 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* --- Bubbles --- */
.message-bubble {
    padding: 16px 20px;
    border-radius: 20px;
    max-width: 70%;
    position: relative;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    word-wrap: break-word;
    backdrop-filter: blur(10px);
}

.user-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 6px;
}

/* Same fix as chat_app/conversation.css's .message-sent/.message-received:
   the row mirrors correctly in RTL, this fixed physical corner doesn't. */
[dir="rtl"] .user-bubble {
    border-bottom-right-radius: 20px;
    border-bottom-left-radius: 6px;
}

.user-bubble a {
    color: #e0e0ff !important;
    text-decoration: underline !important;
    font-weight: 600 !important;
}

.user-bubble a:hover {
    color: #ffffff !important;
    text-decoration: none !important;
}

.ai-bubble {
    background: rgba(255, 255, 255, 0.95);
    color: #2d3748;
    border: .5px solid rgba(255, 255, 255, 0.2);
    border-bottom-left-radius: 6px;
    backdrop-filter: blur(10px);
}

[dir="rtl"] .ai-bubble {
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 6px;
}

.ai-bubble a {
    color: #0d6efd;
}

.user-bubble a:hover,
.ai-bubble a:hover {
    color: #43DC80 !important;
}

/* Make sure links are visible and clickable */
.message-content a {
    position: relative;
    z-index: 10;
    pointer-events: auto !important;
}

.message-bubble {
    position: relative;
    z-index: 1;
}

/* --- Content --- */
.message-sender {
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 6px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

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

.message-sources {
    font-size: 0.75rem;
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.source-link {
    margin-right: 8px;
    text-decoration: none;
}

.source-link:hover {
    text-decoration: underline;
}

/* --- Image Container --- */
.image-container img {
    max-height: 350px;
    width: auto;
    transition: transform 0.2s;
    cursor: pointer;
}

.image-container img:hover {
    transform: scale(1.01);
}

/* =========================================
   TTS BUTTON STATES (Playing, AI)
   ========================================= */
/* --- Audio Button Styling --- */
.custom-audio-play-button {
    background: #43DC80;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.3s ease;
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.custom-audio-play-button:hover {
    background: #41b45a;
}

/* Playing state for audio buttons */
.custom-audio-play-button.playing {
    background: linear-gradient(135deg, #f56565, #e53e3e);
}

.custom-audio-play-button.playing:hover {
    background: linear-gradient(135deg, #e53e3e, #c53030);
}

/* Style for the user's TTS button */
.user-tts-button {
    background-color: rgba(255, 255, 255, 0.9);
    color: #0056b3;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.user-tts-button:hover {
    background-color: #ffffff;
    color: #0056b3;
}

.user-tts-button.playing {
    background: linear-gradient(135deg, #f56565, #e53e3e);
    color: white;
    border: none;
}

/* AI-specific TTS button (purple) */
.ai-tts-button {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    color: white;
    border: none;
}

.ai-tts-button:hover {
    background: linear-gradient(135deg, #7c3aed, #5b21b6);
}

.ai-tts-button.playing {
    background: linear-gradient(135deg, #f56565, #e53e3e);
}

/* Hide the default audio player */
.hidden-audio-player {
    display: none;
}

/* --- Media --- */
.image-container img {
    max-height: 350px;
    width: auto;
    transition: transform 0.2s;
    cursor: pointer;
}

.image-container img:hover {
    transform: scale(1.01);
}

/* --- Typing Indicator --- */
.typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 11px;
    background: #fff;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
}

.typing-text {
    font-size: 0.85rem;
    color: #6b7280;
    font-weight: 500;
}

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

.typing-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    animation: typingBounce 1.4s ease-in-out infinite both;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

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

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

/* --- Input Area --- */
.chat-input {
    border: none;
    background: transparent;
    resize: none;
    padding: 12px 16px;
    font-size: 0.95rem;
    width: 100%;
}

/* Light mode: no border means the input blends into the white page
   background. Dark mode already reads fine without one, left untouched. */
:root:not([data-bs-theme="dark"]):not([data-theme-version="dark"]) .chat-input {
    border: 1px solid #ced4da;
}

.chat-input:focus {
    outline: none;
    box-shadow: none;
}

/* Media button - attached state */
#media-select-btn.btn-primary {
    background-color: #43DC80;
    border-color: #43DC80;
    color: #fff;
}

/* Preview strip */
#media-preview-area:not(.d-none) {
    animation: mediaIn 0.18s ease;
}

@keyframes mediaIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#media-remove-btn {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* Animations */
@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes typingBounce {

    0%,
    80%,
    100% {
        transform: scale(0.8);
        opacity: 0.5;
    }

    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Empty State */
.empty-chat-state {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.empty-chat-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-chat-state h4 {
    margin-bottom: 8px;
    color: #374151;
}

/* Responsive Design */
@media (max-width: 768px) {
    .message-bubble {
        max-width: 85%;
        padding: 14px 16px;
    }

    .message-avatar {
        width: 36px;
        height: 36px;
    }

    #chat-history {
        height: 60vh;
        padding: 16px;
    }

    .image-container img {
        max-height: 250px;
    }
}

/* ── Live tool indicator ─────────────────────────────────────────── */
.tool-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    color: #adb5bd;
    padding: 4px 14px;
    margin: 4px 0;
    border-left: 3px solid #0dcaf0;
    background: rgba(13, 202, 240, 0.06);
    border-radius: 0 8px 8px 0;
    animation: fadeInUp 0.2s ease;
}

.tool-done-check {
    color: #20c997;
    font-weight: 700;
}

/* ── Reasoning / thinking panel ─────────────────────────────────── */
.reasoning-panel {
    margin-top: 10px;
    border: 1px solid rgba(0, 0, 0, 0.12) !important;
    border-radius: 8px;
    overflow: hidden;
    font-size: 0.82rem;
    background: rgba(0, 0, 0, 0.02) !important;
}

.reasoning-panel summary {
    cursor: pointer;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.05) !important;
    color: #2d3748 !important;
    user-select: none;
    font-weight: 600;
    opacity: 1 !important;
}

.reasoning-panel[open] summary {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
}

.reasoning-body {
    padding: 10px 14px;
    color: #2d3748 !important;
    opacity: 1 !important;
    max-height: 260px;
    overflow-y: auto;
}

.reasoning-body p,
.reasoning-body li,
.reasoning-body span,
.reasoning-body strong,
.reasoning-body div {
    color: #2d3748 !important;
    opacity: 1 !important;
    margin-bottom: 6px;
}

/* ── Source credibility badges ───────────────────────────────────── */
.cred-badge {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    text-align: center;
    line-height: 14px;
    font-size: 9px;
    font-weight: 700;
    margin-right: 2px;
    vertical-align: middle;
}

.cred-high {
    background: #198754;
    color: #fff;
}

.cred-medium {
    background: #ffc107;
    color: #000;
}

/* ── Mic recording button ────────────────────────────────────────── */
#mic-btn {
    transition: background 0.2s;
}

#mic-btn.recording {
    background: #dc3545 !important;
    border-color: #dc3545 !important;
    animation: pulse-red 0.9s infinite;
}

@keyframes pulse-red {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.5);
    }

    50% {
        box-shadow: 0 0 0 7px rgba(220, 53, 69, 0);
    }
}

/* ── Misc ────────────────────────────────────────────────────────── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Workflow Progress Stepper & HITL Card ────────────────────────── */

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

    100% {
        transform: rotate(360deg);
    }
}

.spin-animation {
    display: inline-block;
    animation: spin 1.5s linear infinite;
}

.workflow-progress-card {
    background: rgba(0, 0, 0, 0.04);
    border: 1px dashed rgba(0, 0, 0, 0.12);
    border-radius: 12px;
    padding: 10px 14px;
    margin: 12px 0;
    font-size: 0.85rem;
    backdrop-filter: blur(8px);
}

.workflow-stepper-details summary {
    cursor: pointer;
    font-weight: 600;
    list-style: none;
    /* Hide default arrow */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Hide arrow for Webkit browsers */
.workflow-stepper-details summary::-webkit-details-marker {
    display: none;
}

.workflow-stepper-body {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding-top: 8px;
}

.stepper-step {
    transition: opacity 0.3s ease, transform 0.2s ease;
    opacity: 0.6;
}

.stepper-step.completed {
    opacity: 0.95;
}

.stepper-step.active {
    opacity: 1;
    font-weight: 600;
    transform: translateX(2px);
}

.stepper-step.pending {
    opacity: 0.4;
}

.step-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
}

.workflow-hitl-card {
    background: rgba(255, 243, 205, 0.95);
    border-left: 4px solid #ffc107 !important;
    border-radius: 8px;
    color: #664d03;
}

/* For Dark Theme support */
[data-bs-theme="dark"] .workflow-progress-card {
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .workflow-stepper-body {
    border-top-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .workflow-hitl-card {
    background: rgba(44, 38, 19, 0.95);
    color: #ffda6a;
    border-color: rgba(255, 255, 255, 0.1) !important;
    border-left: 4px solid #ffc107 !important;
}

[data-bs-theme="dark"] .hitl-message {
    color: #ffda6a !important;
}

/* --- Inline Markdown/Message Content Image Styling --- */
.message-content img {
    max-height: 350px;
    max-width: 100%;
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s;
    cursor: pointer;
    display: block;
    margin-top: 8px;
    margin-bottom: 8px;
}

.message-content img:hover {
    transform: scale(1.01);
}

/* ── Quran card ─────────────────────────────────────────────────────────── */
.quran-card {
    background: linear-gradient(135deg, #f0faf5 0%, #e8f5f0 100%);
    border: 1px solid #b2dfcf;
    border-radius: 12px;
    padding: 16px;
    margin: 6px 0 8px;
    max-width: 520px;
}

[data-bs-theme="dark"] .quran-card {
    background: linear-gradient(135deg, #0f2820 0%, #12312a 100%);
    border-color: #2a6b50;
}

.quran-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.quran-surah-badge {
    font-size: 0.82rem;
    font-weight: 700;
    color: #1a7a52;
    letter-spacing: 0.02em;
}

[data-bs-theme="dark"] .quran-surah-badge {
    color: #4cba87;
}

.quran-surah-sub {
    font-size: 0.75rem;
    color: #5a8a72;
    font-style: italic;
}

[data-bs-theme="dark"] .quran-surah-sub {
    color: #7ab89a;
}

.quran-arabic {
    font-family: 'Amiri', 'Scheherazade New', 'Traditional Arabic', serif;
    font-size: 1.55rem;
    line-height: 2;
    text-align: right;
    color: #1a3a2a;
    border-bottom: 1px solid #c8e8d8;
    padding-bottom: 10px;
    margin-bottom: 10px;
}

[data-bs-theme="dark"] .quran-arabic {
    color: #d4f0e4;
    border-bottom-color: #2a6b50;
}

.quran-transliteration {
    font-size: 0.78rem;
    color: #3a7a5a;
    margin-bottom: 6px;
    line-height: 1.6;
}

[data-bs-theme="dark"] .quran-transliteration {
    color: #7abfa0;
}

.quran-translation {
    font-size: 0.88rem;
    color: #2a5040;
    line-height: 1.6;
    margin-bottom: 12px;
}

[data-bs-theme="dark"] .quran-translation {
    color: #b8dece;
}

.quran-audio-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quran-play-btn {
    background: #1a7a52;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.quran-play-btn:hover,
.quran-play-btn.playing {
    background: #0f5c3b;
}

[data-bs-theme="dark"] .quran-play-btn {
    background: #2a9a6a;
}

[data-bs-theme="dark"] .quran-play-btn:hover,
[data-bs-theme="dark"] .quran-play-btn.playing {
    background: #1a7a52;
}

.quran-reciter-name {
    font-size: 0.73rem;
    color: #5a8a72;
    font-style: italic;
}

[data-bs-theme="dark"] .quran-reciter-name {
    color: #7ab89a;
}

/* ── Hadith Card ─────────────────────────────────────────────────────────── */
.hadith-card {
    background: linear-gradient(135deg, #fdf8f0 0%, #f9f0e0 100%);
    border: 1px solid #d4b896;
    border-radius: 12px;
    padding: 16px;
    margin: 6px 0 8px;
    max-width: 520px;
}
[data-bs-theme="dark"] .hadith-card {
    background: linear-gradient(135deg, #2a1e0f 0%, #31240f 100%);
    border-color: #6b4a20;
}
.hadith-card-header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.hadith-collection-badge { font-size: 0.82rem; font-weight: 700; color: #7a4a1a; letter-spacing: 0.02em; }
[data-bs-theme="dark"] .hadith-collection-badge { color: #c8902a; }
.hadith-grade { font-size: 0.72rem; background: #e8f5e0; color: #2a7a1a; border-radius: 8px; padding: 2px 8px; }
[data-bs-theme="dark"] .hadith-grade { background: #1a3010; color: #7abf4a; }
.hadith-narrator { font-size: 0.78rem; color: #7a4a1a; font-style: italic; margin-bottom: 8px; }
[data-bs-theme="dark"] .hadith-narrator { color: #c8902a; }
.hadith-arabic {
    font-family: 'Amiri', 'Scheherazade New', 'Traditional Arabic', serif;
    font-size: 1.3rem; line-height: 2; text-align: right; color: #3a2010;
    border-bottom: 1px solid #d4b896; padding-bottom: 8px; margin-bottom: 8px;
}
[data-bs-theme="dark"] .hadith-arabic { color: #f0d4b0; border-bottom-color: #6b4a20; }
.hadith-translation { font-size: 0.88rem; color: #4a2e10; line-height: 1.7; margin-bottom: 10px; }
[data-bs-theme="dark"] .hadith-translation { color: #d4b896; }

/* ── 99 Names of Allah (Asma al-Husna) Card ─────────────────────────────── */
.asma-card {
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
    border: 1px solid #d4b8f0;
    border-radius: 12px;
    padding: 16px;
    margin: 6px 0 8px;
    max-width: 520px;
    text-align: center;
}
[data-bs-theme="dark"] .asma-card {
    background: linear-gradient(135deg, #2a1a3a 0%, #241030 100%);
    border-color: #6b4a8a;
}
.asma-card-label { font-size: 0.78rem; font-weight: 700; color: #7a4ac0; letter-spacing: 0.02em; margin-bottom: 10px; }
[data-bs-theme="dark"] .asma-card-label { color: #c8a2ff; }
.asma-arabic {
    font-family: 'Amiri', 'Scheherazade New', 'Traditional Arabic', serif;
    font-size: 2rem; line-height: 1.5; color: #4a2070; margin-bottom: 6px;
}
[data-bs-theme="dark"] .asma-arabic { color: #e0c8ff; }
.asma-transliteration { font-size: 0.95rem; font-weight: 700; color: #5a3090; margin-bottom: 6px; }
[data-bs-theme="dark"] .asma-transliteration { color: #d4b8f0; }
.asma-meaning { font-size: 0.88rem; color: #4a2e70; line-height: 1.6; margin-bottom: 4px; }
[data-bs-theme="dark"] .asma-meaning { color: #c8a2ff; }

/* ── Dua / Dhikr Card ────────────────────────────────────────────────────── */
.dua-card {
    background: linear-gradient(135deg, #f0faf9 0%, #e0f4f1 100%);
    border: 1px solid #a8dcd4;
    border-radius: 12px;
    padding: 16px;
    margin: 6px 0 8px;
    max-width: 520px;
}
[data-bs-theme="dark"] .dua-card {
    background: linear-gradient(135deg, #123230 0%, #0e2624 100%);
    border-color: #2e6b60;
}
.dua-card-label { font-size: 0.78rem; font-weight: 700; color: #0f8a78; letter-spacing: 0.02em; margin-bottom: 10px; }
[data-bs-theme="dark"] .dua-card-label { color: #7ce0cc; }
.dua-arabic {
    font-family: 'Amiri', 'Scheherazade New', 'Traditional Arabic', serif;
    font-size: 1.3rem; line-height: 2; text-align: right; color: #0d3d38;
    border-bottom: 1px solid #a8dcd4; padding-bottom: 8px; margin-bottom: 8px;
}
[data-bs-theme="dark"] .dua-arabic { color: #b8f0e4; border-bottom-color: #2e6b60; }
.dua-translation { font-size: 0.88rem; color: #0d3d38; line-height: 1.7; margin-bottom: 6px; }
[data-bs-theme="dark"] .dua-translation { color: #a8dcd4; }
.dua-source { font-size: 0.78rem; font-style: italic; color: #3a7a70; margin-bottom: 4px; }
[data-bs-theme="dark"] .dua-source { color: #7ce0cc; }

/* ── Prayer Times Card ───────────────────────────────────────────────────── */
.prayer-times-card {
    background: linear-gradient(135deg, #f0f4fa 0%, #e8eef8 100%);
    border: 1px solid #a0b4d4;
    border-radius: 12px;
    padding: 16px;
    margin: 6px 0 8px;
    max-width: 340px;
}
[data-bs-theme="dark"] .prayer-times-card {
    background: linear-gradient(135deg, #0f1520 0%, #121b2a 100%);
    border-color: #2a4060;
}
.prayer-times-header { margin-bottom: 10px; }
.prayer-times-city { font-size: 0.9rem; font-weight: 700; color: #1a3a7a; }
[data-bs-theme="dark"] .prayer-times-city { color: #6ab0ff; }
.prayer-times-date { font-size: 0.72rem; color: #5a7aaa; margin-top: 2px; }
[data-bs-theme="dark"] .prayer-times-date { color: #7a9acc; }
.prayer-times-table { width: 100%; border-collapse: collapse; }
.prayer-times-table tr { border-bottom: 1px solid rgba(100,130,180,0.15); }
.prayer-times-table tr:last-child { border-bottom: none; }
.prayer-times-table td { padding: 5px 4px; font-size: 0.85rem; }
.prayer-times-table td:first-child { color: #1a3a7a; font-weight: 600; width: 60%; }
[data-bs-theme="dark"] .prayer-times-table td:first-child { color: #6ab0ff; }
.prayer-times-table td:last-child { text-align: right; color: #2a5aaa; font-variant-numeric: tabular-nums; }
[data-bs-theme="dark"] .prayer-times-table td:last-child { color: #a0c8ff; }