/* ==========================================================================
   EDAIC Plugin CSS Reset - Isolates plugin from theme styles
   ========================================================================== */

/* Base Typography - ChatGPT/Gemini Style */
/* Font Size CSS Variables - Only for chat messages */
:root {
    --chat-font-size-xs: 10px;
    --chat-font-size-sm: 11px;
    --chat-font-size-md: 12px;
    --chat-font-size-lg: 13px;
    --chat-font-size-xl: 14px;
}

/* Default to 12px */
.edaic-app {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
    font-size: 12px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Font Size Classes - Apply ONLY to chat messages in #chat-container */
/* Target only message text with .chat-message-text class */
.edaic-app.font-size-xs #chat-container .chat-message-text,
body.font-size-xs .edaic-app #chat-container .chat-message-text {
    font-size: var(--chat-font-size-xs) !important;
}

.edaic-app.font-size-sm #chat-container .chat-message-text,
body.font-size-sm .edaic-app #chat-container .chat-message-text {
    font-size: var(--chat-font-size-sm) !important;
}

.edaic-app.font-size-md #chat-container .chat-message-text,
body.font-size-md .edaic-app #chat-container .chat-message-text {
    font-size: var(--chat-font-size-md) !important;
}

.edaic-app.font-size-lg #chat-container .chat-message-text,
body.font-size-lg .edaic-app #chat-container .chat-message-text {
    font-size: var(--chat-font-size-lg) !important;
}

.edaic-app.font-size-xl #chat-container .chat-message-text,
body.font-size-xl .edaic-app #chat-container .chat-message-text {
    font-size: var(--chat-font-size-xl) !important;
}

/* Default chat message text size */
.edaic-app #chat-container .chat-message-text {
    font-size: 12px;
}

.edaic-app #chat-container p,
.edaic-app #chat-container span:not([class*="text-"]):not([class*="font-"]),
.edaic-app #chat-container div:not([class*="text-"]):not([class*="font-"]) {
    font-size: 12px;
    line-height: 1.5;
    font-weight: 400;
}

.edaic-app button,
.edaic-app input,
.edaic-app textarea {
    font-family: inherit;
    font-size: 12px;
}

/* Scoped reset for the app */
.edaic-app,
.edaic-app *,
.edaic-app *::before,
.edaic-app *::after {
    box-sizing: border-box;
}

html,
body.edaic-app {
    width: 100%;
    height: 100%;
}

body.edaic-app {
    min-height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
}

body.edaic-app main {
    max-height: 100dvh;
}

body.edaic-app #training-selector > div {
    max-height: calc(100dvh - 1.5rem);
}

.edaic-app #training-selector .grid {
    min-height: 0;
}

.edaic-app #scenario-list {
    overflow-x: hidden;
}

.edaic-app #scenario-panel {
    min-width: 0;
    min-height: 0;
}

.edaic-app .scenario-card {
    min-width: 0;
}

.edaic-app .scenario-start-chip {
    color: #0f172a;
    background: #f7f9fb;
    border: 1px solid #d9e2ec;
    box-shadow: none;
    transition: background-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.dark .edaic-app .scenario-start-chip {
    color: #e2e8f0;
    background: #1f2937;
    border-color: #303b4a;
}

.edaic-app .scenario-card:hover .scenario-start-chip,
.edaic-app .scenario-card:focus-visible .scenario-start-chip {
    background: #e0ecff;
    color: #0f172a;
    transform: translateY(-1px);
}

.edaic-app button,
.edaic-app input,
.edaic-app textarea,
.edaic-app select {
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}

.edaic-app input,
.edaic-app textarea,
.edaic-app select {
    background-image: none !important;
}

.edaic-app #start-training-btn {
    background: #f8fafc !important;
    color: #0f172a !important;
    border: 1px solid #d7e3f4 !important;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08) !important;
    transition: transform 150ms ease, box-shadow 150ms ease, background-color 150ms ease, color 150ms ease, border-color 150ms ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: 0.02em;
}

.edaic-app #start-training-btn:hover,
.edaic-app #start-training-btn:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12) !important;
    background: #e9f1ff !important;
    border-color: #c7d8f5 !important;
    color: #0b1324 !important;
}

.dark .edaic-app #start-training-btn {
    background: #0f172a !important;
    color: #e5edf5 !important;
    border-color: #1f2937 !important;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28) !important;
}

.dark .edaic-app #start-training-btn:hover,
.dark .edaic-app #start-training-btn:focus-visible {
    background: #111827 !important;
    border-color: #243049 !important;
    color: #f8fafc !important;
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.32) !important;
}

.edaic-app #start-training-btn svg {
    width: 1rem;
    height: 1rem;
}

.edaic-app button:focus,
.edaic-app input:focus,
.edaic-app textarea:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Remove borders from all interactive elements */
.edaic-app .exam-option,
.edaic-app .category-chip,
.edaic-app #start-training-btn,
.edaic-app .theme-toggle {
    border: none !important;
    box-shadow: none !important;
}

/* Ensure rounded corners work properly */
.edaic-app [class*="rounded"] {
    border: none !important;
}

/* Override any theme link styles */
.edaic-app a {
    text-decoration: none;
}

/* Dark mode text input fix - ensure text is visible */
.dark .edaic-app textarea,
.dark .edaic-app input[type="text"],
.dark .edaic-app input {
    background-color: transparent !important;
    color: #e5e7eb !important;
}

.dark .edaic-app textarea::placeholder,
.dark .edaic-app input::placeholder {
    color: #9ca3af !important;
}

/* Ensure chat input is readable in dark mode */
.dark #chat-input-bottom {
    background-color: transparent !important;
    color: #f3f4f6 !important;
}

/* ==========================================================================
   ChatGPT-Style Chat Input - Complete Redesign
   ========================================================================== */

/* Container: Just a flex wrapper, NO padding, NO visual styles */
.edaic-app .chat-input-container {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* Textarea: All visual styles here - ChatGPT style */
.edaic-app .chat-input,
.edaic-app #chat-input-bottom,
.edaic-app textarea.chat-input,
.edaic-app textarea#chat-input-bottom {
    flex: 1 !important;
    min-height: 80px !important;
    height: 80px !important;
    max-height: 200px !important;
    line-height: 20px !important;
    font-size: 12px !important;
    font-family: inherit !important;
    padding: 12px 16px !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 24px !important;
    background: #f0f4f9 !important;
    color: #1f2937 !important;
    resize: none !important;
    overflow: hidden !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    box-sizing: border-box !important;
    transition: height 0.15s ease !important;
    outline: none !important;
}

.edaic-app .chat-input::-webkit-scrollbar,
.edaic-app #chat-input-bottom::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

.edaic-app .chat-input::placeholder,
.edaic-app #chat-input-bottom::placeholder {
    line-height: 20px !important;
    color: #9ca3af !important;
    opacity: 0.6 !important;
}

/* Dark mode */
.dark .edaic-app .chat-input,
.dark .edaic-app #chat-input-bottom {
    background: #1e1f20 !important;
    color: #e5e7eb !important;
}

.dark .edaic-app .chat-input::placeholder,
.dark .edaic-app #chat-input-bottom::placeholder {
    color: #9ca3af !important;
}

/* Focus state */
.edaic-app .chat-input:focus,
.edaic-app #chat-input-bottom:focus {
    background: #ffffff !important;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1) !important;
}

.dark .edaic-app .chat-input:focus,
.dark .edaic-app #chat-input-bottom:focus {
    background: #282a2c !important;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1) !important;
}

/* Send button alignment */
.edaic-app .send-button {
    margin: 0 !important;
    align-self: center !important;
}

/* Mobile adjustments */
@media (max-width: 639px) {
    .edaic-app .chat-input,
    .edaic-app #chat-input-bottom,
    .edaic-app textarea.chat-input,
    .edaic-app textarea#chat-input-bottom {
        min-height: 72px !important;
        height: 72px !important;
        line-height: 18px !important;
        padding: 10px 12px !important;
        border-radius: 20px !important;
    }
    
    .edaic-app .chat-input::placeholder,
    .edaic-app #chat-input-bottom::placeholder {
        line-height: 18px !important;
    }
}

/* Old container styles removed - using new chat-input-container approach */

/* Exam Option Base Styles - Prevent Overflow */
.edaic-app .exam-option {
    overflow: hidden !important;
    word-wrap: break-word !important;
    box-sizing: border-box !important;
    max-width: 100% !important;
    width: 100% !important;
}

.edaic-app .exam-option span {
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    max-width: 100% !important;
    display: block !important;
    width: 100% !important;
}

/* Chat Container and Welcome Screen Base Styles */
.edaic-app #chat-container {
    box-sizing: border-box !important;
    overflow-x: hidden !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Ensure chat container is centered on all screen sizes */
@media (min-width: 768px) {
    .edaic-app #chat-container {
        max-width: 56rem !important; /* max-w-4xl = 56rem */
    }
}

.edaic-app #welcome-screen {
    box-sizing: border-box !important;
    overflow-x: hidden !important;
    max-width: 100% !important;
    width: 100% !important;
}

.edaic-app #exam-mode-cards {
    box-sizing: border-box !important;
    overflow-x: hidden !important;
    max-width: 100% !important;
    width: 100% !important;
}

/* Desktop fixes - prevent overflow */
@media (min-width: 769px) {
    .edaic-app #welcome-screen {
        padding-bottom: 1.5rem !important;
    }

    .edaic-app #exam-mode-cards {
        gap: 1rem !important;
        padding: 0 1rem !important;
        max-width: 48rem !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .edaic-app #chat-container {
        padding-bottom: 11rem !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
}

@media (min-width: 1024px) {
    .edaic-app #exam-mode-cards {
        gap: 1.25rem !important;
        max-width: 48rem !important;
    }
}

/* Exam Status Bar - Modern Design */
.edaic-app #exam-status-bar {
    font-size: 12px !important;
    font-weight: 500 !important;
    letter-spacing: -0.01em;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.2s ease;
}

/* Finish exam button styling */
.edaic-app #end-session-btn {
    white-space: nowrap !important;
}

@media (min-width: 768px) {
    .edaic-app #end-session-btn {
        padding: 6px 12px !important;
    }
    
    .edaic-app #end-session-btn span {
        font-size: 12px !important;
    }
}

.edaic-app #exam-status-bar:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12), 0 2px 4px rgba(0, 0, 0, 0.12) !important;
}

.dark .edaic-app #exam-status-bar {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.2) !important;
    background: rgba(30, 31, 32, 0.95) !important;
}

.dark .edaic-app #exam-status-bar:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4), 0 2px 4px rgba(0, 0, 0, 0.3) !important;
}

.edaic-app #exam-status-bar > div {
    font-size: 12px !important;
}

.edaic-app #exam-status-bar .text-xs {
    font-size: 12px !important;
    font-weight: 500 !important;
    letter-spacing: 0.02em;
}

.edaic-app #exam-status-bar span.font-semibold,
.edaic-app #exam-status-bar span.font-medium {
    font-size: 12px !important;
    font-weight: 600 !important;
}

.edaic-app #exam-status-bar button {
    font-size: 12px !important;
    font-weight: 500 !important;
    padding: 6px 12px !important;
    border-radius: 8px !important;
    transition: all 0.2s ease;
}

.edaic-app #exam-status-bar .w-px {
    height: 16px !important;
    background: rgba(0, 0, 0, 0.08) !important;
}

.dark .edaic-app #exam-status-bar .w-px {
    background: rgba(255, 255, 255, 0.1) !important;
}

/* Mobile responsive improvements */
@media (max-width: 768px) {
    .edaic-app #exam-status-bar {
        padding: 10px 14px !important;
        gap: 10px !important;
        font-size: 12px !important;
        flex-wrap: nowrap !important;
        max-width: calc(100vw - 32px) !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        border-radius: 16px !important;
    }

    .edaic-app #exam-status-bar::-webkit-scrollbar {
        display: none !important;
    }

    .edaic-app #exam-status-bar > div {
        flex-shrink: 0 !important;
        white-space: nowrap !important;
    }

    .edaic-app #exam-status-bar .text-xs {
        font-size: 10px !important;
    }

    .edaic-app #exam-status-bar span.font-semibold,
    .edaic-app #exam-status-bar span.font-medium {
        font-size: 12px !important;
    }

    .edaic-app #exam-status-bar button {
        padding: 5px 10px !important;
        font-size: 11px !important;
    }

    .edaic-app #exam-status-bar .w-px {
        height: 14px !important;
    }

    .edaic-app #exam-mode-cards {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        padding: 0 12px !important;
        max-width: 48rem !important;
        width: 100% !important;
        box-sizing: border-box !important;
        margin: 0 auto !important;
    }

    .edaic-app .exam-option {
        padding: 12px 8px !important;
        min-height: auto !important;
        height: auto !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    .edaic-app .exam-option > div {
        flex-shrink: 0 !important;
        margin-bottom: 6px !important;
    }

    .edaic-app .exam-option span {
        width: 100% !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        word-break: break-word !important;
        hyphens: auto !important;
        line-height: 1.3 !important;
    }

    .edaic-app .exam-option span:first-of-type {
        font-size: 0.7rem !important;
        margin-bottom: 2px !important;
    }

    .edaic-app .exam-option span:last-of-type {
        font-size: 0.65rem !important;
        -webkit-line-clamp: 1 !important;
    }

    .edaic-app #welcome-screen {
        min-height: auto !important;
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
        overflow-x: hidden !important;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        margin: 0 !important;
    }

    .edaic-app #welcome-screen > div {
        max-width: 100% !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
        width: 100% !important;
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    .edaic-app #welcome-screen h1 {
        font-size: 1.5rem !important;
        line-height: 1.3 !important;
        margin-bottom: 0.75rem !important;
    }

    .edaic-app #welcome-screen p {
        font-size: 0.875rem !important;
        line-height: 1.5 !important;
        padding: 0 0.5rem !important;
    }

    .edaic-app #bottom-input-bar {
        padding: 12px !important;
        -webkit-backdrop-filter: blur(8px) !important;
        backdrop-filter: blur(8px) !important;
    }

    /* Chat messages mobile optimization */
    .edaic-app #chat-container > div {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .edaic-app #chat-container .max-w-\\[85\\%\\],
    .edaic-app #chat-container .max-w-\\[75\\%\\] {
        max-width: 90% !important;
    }

    /* Header mobile optimization */
    .edaic-app header {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    .edaic-app #model-selector-popup {
        width: calc(100vw - 24px) !important;
        max-width: 320px !important;
    }
}

@media (max-width: 640px) {
    /* Status bar should be behind sidebar when sidebar is open */
    .edaic-app #exam-status-bar {
        left: 0 !important;
        right: 0 !important;
        transform: none !important;
        top: 80px !important;
        margin: 0 12px !important;
        border-radius: 14px !important;
        justify-content: flex-start !important;
        align-items: flex-start !important;
        flex-wrap: wrap !important;
        overflow: visible !important;
        padding: 10px 12px !important;
        gap: 8px 6px !important;
        font-size: 11px !important;
        max-width: calc(100vw - 24px) !important;
        z-index: 30 !important;
        min-height: auto !important;
        height: auto !important;
    }
    
    /* When sidebar is open, hide status bar behind it */
    body.mobile-sidebar-open .edaic-app #exam-status-bar {
        z-index: 30 !important;
    }
    
    /* Ensure sidebar is above all elements when open */
    .edaic-app #sidebar {
        z-index: 60 !important;
    }
    
    body.mobile-sidebar-open .edaic-app #sidebar {
        z-index: 60 !important;
    }
    
    /* Hide other elements behind sidebar when open */
    body.mobile-sidebar-open .edaic-app #exam-status-bar,
    body.mobile-sidebar-open .edaic-app #model-selector-popup,
    body.mobile-sidebar-open .edaic-app #quota-pill {
        z-index: 30 !important;
    }
    
    /* Ensure sidebar toggle button is above status bar */
    .edaic-app header {
        z-index: 50 !important;
    }
    
    .edaic-app #sidebar-toggle {
        z-index: 60 !important;
        position: relative !important;
    }

    /* Status bar items should wrap and fit properly */
    .edaic-app #exam-status-bar {
        justify-content: space-between !important;
        align-items: center !important;
    }
    
    .edaic-app #exam-status-bar > div {
        flex-shrink: 1 !important;
        white-space: nowrap !important;
        min-width: fit-content !important;
    }
    
    /* Prevent status bar from causing horizontal scroll */
    .edaic-app #exam-status-bar .w-px {
        flex-shrink: 0 !important;
    }

    .edaic-app #exam-status-bar .text-xs {
        font-size: 9px !important;
    }

    .edaic-app #exam-status-bar span.font-semibold,
    .edaic-app #exam-status-bar span.font-medium {
        font-size: 11px !important;
    }

    .edaic-app #exam-status-bar button {
        padding: 4px 8px !important;
        font-size: 10px !important;
        line-height: 1.3 !important;
        border-radius: 6px !important;
    }

    .edaic-app #exam-status-bar .w-px {
        height: 12px !important;
        margin: 0 3px !important;
    }

    .edaic-app #chat-container {
        padding-top: 4rem !important;
        padding-bottom: 8rem !important;
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    /* Reading Modal Mobile - Modern Design */
    /* Reading Modal Mobile - Minimalist Design */
    #reading-modal {
        padding: 12px !important;
    }

    #reading-modal > div {
        max-width: calc(100vw - 24px) !important;
        max-height: calc(100vh - 24px) !important;
        border-radius: 16px !important;
    }

    #reading-modal .p-3.md\\:p-4 {
        padding: 12px !important;
    }

    #reading-modal h2 {
        font-size: 0.8125rem !important;
    }

    #reading-modal #reading-timer {
        font-size: 0.8125rem !important;
    }

    #reading-modal .p-4.md\\:p-6 {
        padding: 12px !important;
    }

    #reading-modal #case-text-content {
        font-size: 0.875rem !important;
        line-height: 1.6 !important;
    }

    #reading-modal .p-3.md\\:p-4.bg-gray-50 {
        padding: 12px !important;
    }

    #reading-modal #reading-note {
        font-size: 0.75rem !important;
        line-height: 1.4 !important;
    }
    
    #reading-modal #reading-start-btn {
        padding: 8px 12px !important;
        font-size: 0.75rem !important;
        width: 100% !important;
    }
    
    #reading-modal .flex.flex-col.sm\\:flex-row {
        flex-direction: column !important;
        gap: 12px !important;
    }

    /* Image Viewer Mobile */
    #exam-image-viewer {
        left: 8px !important;
        right: 8px !important;
        width: auto !important;
        max-width: calc(100vw - 16px) !important;
    }

    .edaic-app #welcome-screen {
        min-height: auto !important;
        padding-top: 0.5rem !important;
        padding-bottom: 0.75rem !important;
        margin-bottom: 0 !important;
        justify-content: flex-start !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .edaic-app #welcome-screen > div:first-child {
        margin-bottom: 1rem !important;
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 0.25rem !important;
        padding-right: 0.25rem !important;
    }

    .edaic-app #exam-mode-cards {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
        margin-bottom: 0 !important;
        padding: 0 12px !important;
        max-width: 48rem !important;
        width: 100% !important;
        box-sizing: border-box !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .edaic-app .exam-option {
        padding: 10px 6px !important;
        min-height: auto !important;
        height: auto !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .edaic-app .exam-option > div {
        width: 32px !important;
        height: 32px !important;
        margin-bottom: 4px !important;
    }

    .edaic-app .exam-option > div svg {
        width: 16px !important;
        height: 16px !important;
    }

    .edaic-app .exam-option span {
        width: 100% !important;
        padding: 0 2px !important;
        box-sizing: border-box !important;
    }

    /* Mobile adjustments for chat input */
    @media (max-width: 639px) {
        .edaic-app .chat-input {
            min-height: 20px !important;
            height: 20px !important;
            line-height: 20px !important;
            padding: 0 12px !important;
            border-radius: 20px !important;
        }
        
        .edaic-app .chat-input::placeholder {
            line-height: 20px !important;
        }
    }

    .edaic-app #bottom-input-bar {
        padding-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
    }

    .edaic-app .exam-option {
        padding: 10px 6px !important;
        min-height: auto !important;
        height: auto !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .edaic-app .exam-option > div {
        width: 32px !important;
        height: 32px !important;
        margin-bottom: 4px !important;
        flex-shrink: 0 !important;
    }

    .edaic-app .exam-option > div svg {
        width: 16px !important;
        height: 16px !important;
    }

    .edaic-app .exam-option span {
        width: 100% !important;
        padding: 0 2px !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        word-break: break-word !important;
        line-height: 1.3 !important;
    }

    .edaic-app .exam-option span:first-of-type {
        font-size: 0.7rem !important;
        line-height: 1.3 !important;
        margin-bottom: 2px !important;
        -webkit-line-clamp: 2 !important;
    }

    .edaic-app .exam-option span:last-of-type {
        font-size: 0.65rem !important;
        margin-top: 0.25rem !important;
        -webkit-line-clamp: 1 !important;
    }

    .edaic-app #training-selector > div {
        border-radius: 24px;
    }

    .edaic-app #training-selector .grid {
        gap: 16px !important;
    }

    .edaic-app #training-selector .p-5, .edaic-app #training-selector .p-4 {
        padding: 16px !important;
    }

    .edaic-app .exam-option {
        width: 100%;
    }

    .edaic-app #training-selector.mobile-compact > div {
        height: 100%;
    }

    .edaic-app #training-selector.mobile-compact .grid {
        grid-template-rows: auto 1fr;
        overflow-x: hidden;
    }

    .edaic-app #training-selector.mobile-compact #category-panel {
        max-height: 34vh;
        overflow-y: auto;
    }

    .edaic-app #training-selector.mobile-compact #scenario-panel {
        min-height: 48vh;
    }
}

/* ==========================================================================
   Original Plugin Styles
   ========================================================================== */

/* Genel Geçiş Animasyonları */
body,
.prompt-card,
aside,
main,
button,
a,
div,
input,
textarea {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Karanlık Mod için temel renkler */
html.dark body {
    background-color: #111827;
    /* gray-900 */
    color: #d1d5db;
    /* gray-300 */
}

/* Modal Animasyonları */
#settings-modal.modal-open #settings-modal-panel {
    opacity: 1;
    transform: translateY(0);
}

/* Tooltip İyileştirmesi */
#sidebar:not(.sidebar-expanded) [data-tooltip]:hover::after {
    animation: fadeIn 0.2s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Base styles scoped to wrapper if possible, but global is fine for now as it's a plugin */
/* .edaic-examiner-wrapper body { ... } */

.font-serif {
    font-family: 'Lora', serif;
}

/* Textarea customization */
textarea::-webkit-resizer {
    display: none;
}

/* Prompt card shadow */
.prompt-card {
    box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.05), 0px 1px 3px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.2s ease-in-out;
}

.prompt-card:focus-within {
    box-shadow: 0px 6px 16px rgba(0, 0, 0, 0.08), 0px 2px 4px rgba(0, 0, 0, 0.1);
}

/* Suggestion buttons */
.suggestion-btn {
    transition: all 0.2s ease-in-out;
}

.suggestion-btn:hover {
    background-color: #f1f3f5;
    box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

.suggestion-btn:active {
    transform: translateY(0);
}

/* Scrollbar styles */
.sidebar-scroll::-webkit-scrollbar {
    width: 6px;
}

.sidebar-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-scroll::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
    transition: background 0.2s ease;
}

.sidebar-scroll::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Desktop Sidebar - Default collapsed state */
#sidebar {
    width: 4rem;
    /* 64px = w-16 */
}

#sidebar.sidebar-expanded {
    width: 16rem;
    /* 256px = w-64 */
}

.guest-auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 0.9rem;
    border-radius: 0.875rem;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    text-decoration: none;
}

.guest-auth-btn.glass-outline {
    background: linear-gradient(135deg, rgba(255,255,255,0.8), rgba(226,232,240,0.75));
    color: #0f172a;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.dark .guest-auth-btn.glass-outline {
    background: rgba(255, 255, 255, 0.04);
    color: #e5e7eb;
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.guest-auth-btn.guest-auth-primary {
    background: linear-gradient(135deg, #6366f1, #14b8a6);
    color: #fff;
    box-shadow: 0 12px 35px rgba(99, 102, 241, 0.35);
}

.guest-auth-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 35px rgba(15, 23, 42, 0.12);
}

.dark .guest-auth-btn:hover {
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5);
}

/* Sidebar text visibility */
.sidebar-text {
    opacity: 0;
    width: 0;
    margin-left: 0;
    transition: opacity 0.25s ease-in-out, width 0.25s ease-in-out, margin 0.25s ease-in-out;
    white-space: nowrap;
    overflow: hidden;
}

#sidebar.sidebar-expanded .sidebar-text {
    opacity: 1;
    width: auto;
    margin-left: 0.75rem;
}

/* New Chat button - ensure perfect circle when sidebar is collapsed */
@media (min-width: 768px) {
    #sidebar:not(.sidebar-expanded) .px-3.pt-4 {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
        display: flex !important;
        justify-content: center !important;
    }

    #sidebar:not(.sidebar-expanded) .px-3.pt-4 > a[title="New Chat"],
    #sidebar:not(.sidebar-expanded) .px-3.pt-4 > a[onclick*="reload"] {
        width: 2.5rem !important;
        height: 2.5rem !important;
        min-width: 2.5rem !important;
        min-height: 2.5rem !important;
        max-width: 2.5rem !important;
        max-height: 2.5rem !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 50% !important;
        margin: 0 auto !important;
        flex-shrink: 0 !important;
    }

    #sidebar:not(.sidebar-expanded) .px-3.pt-4 > a[title="New Chat"] svg,
    #sidebar:not(.sidebar-expanded) .px-3.pt-4 > a[onclick*="reload"] svg {
        margin: 0 !important;
        flex-shrink: 0 !important;
    }

    #sidebar:not(.sidebar-expanded) .px-3.pt-4 > a[title="New Chat"] .sidebar-text,
    #sidebar:not(.sidebar-expanded) .px-3.pt-4 > a[onclick*="reload"] .sidebar-text {
        display: none !important;
    }
}

/* Mobile sidebar - New Chat button should show text when open */
@media (max-width: 767px) {
    body.mobile-sidebar-open #sidebar .px-3.pt-4 > a[title="New Chat"] .sidebar-text,
    body.mobile-sidebar-open #sidebar .px-3.pt-4 > a[onclick*="reload"] .sidebar-text {
        display: inline !important;
        opacity: 1 !important;
        width: auto !important;
        margin-left: 0.75rem !important;
    }
    
    body.mobile-sidebar-open #sidebar .px-3.pt-4 > a[title="New Chat"],
    body.mobile-sidebar-open #sidebar .px-3.pt-4 > a[onclick*="reload"] {
        width: auto !important;
        height: auto !important;
        padding: 0.75rem !important;
        border-radius: 9999px !important;
        justify-content: flex-start !important;
    }
}

@media (min-width: 768px) {
    #sidebar:not(.sidebar-expanded) .guest-auth-actions {
        display: none;
    }
}

/* Mobile sidebar styles */
@media (max-width: 767px) {
    #sidebar {
        width: 80%;
        max-width: 20rem;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* Show sidebar text on mobile when open */
    body.mobile-sidebar-open #sidebar .sidebar-text {
        opacity: 1;
        width: auto;
        margin-left: 0.75rem;
    }

    body.mobile-sidebar-open #sidebar {
        transform: translateX(0);
    }
}

/* Mobile sidebar backdrop */
#mobile-sidebar-backdrop {
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.mobile-sidebar-open #mobile-sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
}

/* Desktop only: smooth sidebar width transition */
@media (min-width: 768px) {
    #sidebar {
        transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
}

/* Rotation animation for arrows */
.rotate-180 {
    transform: rotate(180deg);
}

svg {
    transition: transform 0.2s ease-in-out;
}

/* Button hover effects */
button,
a {
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

/* Focus states for accessibility */
button:focus-visible,
a:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Smooth popup animations */
#user-menu-popup,
#model-selector-popup {
    animation: fadeInUp 0.2s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

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

/* Hide scrollbar when not needed */
.sidebar-scroll {
    overflow-y: auto;
    overflow-x: hidden;
}

/* Ensure proper text truncation */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 1;
}

/* Custom Tooltip Styles */
#sidebar:not(.sidebar-expanded) [data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 1rem;
    /* 16px */
    padding: 0.375rem 0.75rem;
    /* 6px 12px */
    background-color: #1f2937;
    /* gray-800 */
    color: #f9fafb;
    /* gray-50 */
    border-radius: 0.375rem;
    /* rounded-md */
    font-size: 0.875rem;
    /* text-sm */
    font-weight: 500;
    white-space: nowrap;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.2s ease-in-out;
    pointer-events: none;
}

/* Tooltip'ten önce gizli kalmasını sağla */
#sidebar:not(.sidebar-expanded) [data-tooltip]::after {
    content: '';
    opacity: 0;
}

/* Hide session history controls (Manage/Header) when collapsed on desktop only */
@media (min-width: 768px) {
#sidebar:not(.sidebar-expanded) #session-history-controls {
    display: none !important;
    }
}

/* Ensure manage button is visible on mobile */
@media (max-width: 767px) {
    #session-history-controls {
        display: block !important;
    }
    
    #history-manage-btn {
        display: inline-block !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
}

/* Ensure history items look okay when collapsed - hide title, show icon centered-ish? */
/* Optional: Hide history title text when collapsed to maintain icon-only look */
#sidebar:not(.sidebar-expanded) .history-item h4,
#sidebar:not(.sidebar-expanded) .history-item span.truncate {
    display: none;
}

#sidebar:not(.sidebar-expanded) .history-item {
    justify-content: center;
}

/* Exam briefing flow rail */
.exam-flow-rail {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.exam-flow-node {
    position: relative;
    padding: 14px;
    border-radius: 18px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: linear-gradient(145deg, rgba(248, 250, 252, 0.9), #fff);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.dark .exam-flow-node {
    background: radial-gradient(circle at 10% 10%, rgba(59, 130, 246, 0.12), transparent 35%), rgba(17, 18, 21, 0.95);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.exam-flow-node::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(99, 102, 241, 0.05));
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.exam-flow-node:hover::after {
    opacity: 1;
}

.exam-flow-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: linear-gradient(120deg, #2563eb, #6366f1);
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
    margin-bottom: 10px;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.35);
}

.exam-flow-label {
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 4px;
}

.dark .exam-flow-label {
    color: #e5e7eb;
}

.exam-flow-hint {
    margin: 0;
    color: #64748b;
    font-size: 0.85rem;
}

.dark .exam-flow-hint {
    color: #cbd5e1;
}

#exam-briefing .exam-briefing-card {
    max-height: calc(100vh - 1.5rem);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

@media (max-width: 768px) {
    #exam-briefing {
        padding: 0 !important;
    }

    #exam-briefing .exam-briefing-card {
        height: 100vh !important;
        max-height: 100vh !important;
        padding: 16px !important;
        border-radius: 20px 20px 0 0 !important;
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
    }
    
    #exam-briefing .exam-briefing-card > button#exam-briefing-close {
        position: absolute !important;
        top: 12px !important;
        right: 12px !important;
        padding: 8px !important;
        z-index: 60 !important;
        background: rgba(255, 255, 255, 0.95) !important;
        backdrop-filter: blur(8px) !important;
    }
    
    .dark #exam-briefing .exam-briefing-card > button#exam-briefing-close {
        background: rgba(17, 18, 21, 0.95) !important;
    }

    /* Header section mobile */
    #exam-briefing .flex.flex-col.sm\\:flex-row {
        gap: 12px !important;
        margin-bottom: 20px !important;
    }

    #exam-briefing .w-14.h-14 {
        width: 48px !important;
        height: 48px !important;
    }

    #exam-briefing h3 {
        font-size: 1.25rem !important;
        line-height: 1.3;
    }

    #exam-briefing .text-sm {
        font-size: 0.8125rem !important;
        line-height: 1.5;
    }

    /* Grid layout mobile - stack vertically */
    #exam-briefing .grid.lg\\:grid-cols-\\[1\\.15fr_\\.85fr\\] {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    /* Flow map mobile */
    #exam-briefing .p-4.sm\\:p-5 {
        padding: 16px !important;
    }

    .exam-flow-rail {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .exam-flow-node {
        padding: 12px !important;
    }

    .exam-flow-index {
        width: 36px !important;
        height: 36px !important;
        font-size: 0.875rem !important;
    }

    .exam-flow-label {
        font-size: 0.9rem !important;
    }

    .exam-flow-hint {
        font-size: 0.8rem !important;
        line-height: 1.4;
    }

    /* Tips grid mobile - single column */
    #exam-briefing .grid.sm\\:grid-cols-2 {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    #exam-briefing .p-3.rounded-xl {
        padding: 12px !important;
        font-size: 0.8125rem !important;
    }

    /* Footer buttons mobile */
    #exam-briefing .mt-6.flex {
        margin-top: 20px !important;
        flex-direction: column !important;
        gap: 16px !important;
        overflow: hidden !important;
        flex-shrink: 0 !important;
    }

    #exam-briefing .mt-6.flex > p {
        font-size: 0.8125rem !important;
        text-align: center;
    }

    #exam-briefing .flex.flex-col.sm\\:flex-row {
        width: 100% !important;
    }

    #exam-briefing .flex.flex-col.sm\\:flex-row > button {
        width: 100% !important;
        padding: 12px 16px !important;
        font-size: 0.875rem !important;
    }
}

/* Desktop - EDAIC Exam briefing modal - prevent scrollbar on card, only content scrolls */
@media (min-width: 769px) {
    #exam-briefing .exam-briefing-card {
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
    }
    
    #exam-briefing .mt-6.flex {
        overflow: hidden !important;
        flex-shrink: 0 !important;
    }
}

/* Reading Modal - Desktop Minimalist Design */
@media (min-width: 768px) {
    #reading-modal > div {
        max-width: 42rem !important;
    }
    
    #reading-modal h2 {
        font-size: 0.875rem !important;
    }
    
    #reading-modal #reading-timer {
        font-size: 0.875rem !important;
    }
    
    #reading-modal #case-text-content {
        font-size: 0.9375rem !important;
        line-height: 1.7 !important;
    }
    
    #reading-modal #reading-note {
        font-size: 0.8125rem !important;
    }
    
    #reading-modal #reading-start-btn {
        font-size: 0.8125rem !important;
        padding: 8px 16px !important;
    }
}

@media (max-width: 640px) {
    #exam-briefing {
        padding: 4px !important;
    }

    #exam-briefing .exam-briefing-card {
        padding: 12px !important;
        border-radius: 16px !important;
    }

    #exam-briefing h3 {
        font-size: 1.125rem !important;
    }

    #exam-briefing .text-xs.uppercase {
        font-size: 0.6875rem !important;
    }
}


/* ==========================================================================
   FRCA Exam Briefing Styles
   ========================================================================== */

#frca-exam-briefing .frca-exam-briefing-card {
    max-height: calc(100vh - 1.5rem);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Desktop - FRCA Exam briefing modal - prevent scrollbar on card, only content scrolls */
@media (min-width: 769px) {
    #frca-exam-briefing .frca-exam-briefing-card {
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
    }
    
    #frca-exam-briefing .mt-6.flex {
        overflow: hidden !important;
        flex-shrink: 0 !important;
    }
}

.frca-exam-flow-rail {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.frca-exam-flow-node {
    position: relative;
    display: flex;
    gap: 16px;
    padding: 16px;
    border-radius: 16px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: linear-gradient(145deg, rgba(248, 250, 252, 0.9), #fff);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
}

.frca-exam-flow-node:hover {
    transform: translateX(4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

.dark .frca-exam-flow-node {
    background: radial-gradient(circle at 10% 10%, rgba(20, 184, 166, 0.12), transparent 35%), rgba(17, 18, 21, 0.95);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.frca-exam-flow-connector {
    width: 2px;
    height: 24px;
    margin-left: 32px;
    background: linear-gradient(to bottom, #14b8a6, #10b981);
    border-radius: 1px;
}

.dark .frca-exam-flow-connector {
    background: linear-gradient(to bottom, rgba(20, 184, 166, 0.6), rgba(16, 185, 129, 0.6));
}

.frca-exam-flow-index {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
    box-shadow: 0 10px 30px rgba(20, 184, 166, 0.35);
}

.frca-exam-flow-content {
    flex: 1;
    min-width: 0;
}

.frca-exam-flow-label {
    font-weight: 700;
    font-size: 1rem;
    color: #0f172a;
    margin: 0 0 4px;
}

.dark .frca-exam-flow-label {
    color: #e5e7eb;
}

.frca-exam-flow-hint {
    margin: 0 0 8px;
    color: #64748b;
    font-size: 0.85rem;
    line-height: 1.4;
}

.dark .frca-exam-flow-hint {
    color: #cbd5e1;
}

.frca-exam-flow-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.frca-exam-flow-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 500;
    background: rgba(20, 184, 166, 0.1);
    color: #0d9488;
    border: 1px solid rgba(20, 184, 166, 0.2);
}

.dark .frca-exam-flow-badge {
    background: rgba(20, 184, 166, 0.15);
    color: #5eead4;
    border-color: rgba(20, 184, 166, 0.3);
}

@media (max-width: 768px) {
    #frca-exam-briefing {
        align-items: flex-start;
        padding: 8px !important;
    }

    #frca-exam-briefing {
        padding: 0 !important;
    }
    
    #frca-exam-briefing .frca-exam-briefing-card {
        height: 100vh !important;
        max-height: 100vh !important;
        padding: 16px !important;
        border-radius: 20px 20px 0 0 !important;
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
    }

    #frca-exam-briefing .frca-exam-briefing-card > button#frca-exam-briefing-close {
        position: absolute !important;
        top: 12px !important;
        right: 12px !important;
        padding: 8px !important;
        z-index: 60 !important;
        background: rgba(255, 255, 255, 0.95) !important;
        backdrop-filter: blur(8px) !important;
    }
    
    .dark #frca-exam-briefing .frca-exam-briefing-card > button#frca-exam-briefing-close {
        background: rgba(17, 18, 21, 0.95) !important;
    }

    /* Header section mobile */
    #frca-exam-briefing .flex.flex-col.sm\\:flex-row {
        gap: 12px !important;
        margin-bottom: 20px !important;
    }

    #frca-exam-briefing .w-14.h-14 {
        width: 48px !important;
        height: 48px !important;
    }

    #frca-exam-briefing h3 {
        font-size: 1.25rem !important;
        line-height: 1.3;
    }

    #frca-exam-briefing .text-sm {
        font-size: 0.8125rem !important;
        line-height: 1.5;
    }

    /* Grid layout mobile - stack vertically */
    #frca-exam-briefing .grid.lg\\:grid-cols-\\[1\\.15fr_\\.85fr\\] {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    /* Flow map mobile */
    #frca-exam-briefing .p-4.sm\\:p-5 {
        padding: 16px !important;
    }

    .frca-exam-flow-node {
        padding: 12px;
        gap: 12px;
    }

    .frca-exam-flow-index {
        width: 40px;
        height: 40px;
        font-size: 0.8rem;
    }

    .frca-exam-flow-connector {
        height: 16px;
        margin-left: 28px;
    }

    .frca-exam-flow-label {
        font-size: 0.9rem;
    }

    .frca-exam-flow-hint {
        font-size: 0.8rem;
        line-height: 1.4;
    }

    .frca-exam-flow-badge {
        font-size: 0.65rem;
        padding: 3px 8px;
    }

    /* Tips grid mobile - single column */
    #frca-exam-briefing .grid.sm\\:grid-cols-2 {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    #frca-exam-briefing .p-3.rounded-xl {
        padding: 12px !important;
        font-size: 0.8125rem !important;
    }

    /* Footer buttons mobile */
    #frca-exam-briefing .mt-6.flex {
        margin-top: 20px !important;
        flex-direction: column !important;
        gap: 16px !important;
        overflow: hidden !important;
        flex-shrink: 0 !important;
    }

    #frca-exam-briefing .mt-6.flex > p {
        font-size: 0.8125rem !important;
        text-align: center;
    }

    #frca-exam-briefing .flex.flex-col.sm\\:flex-row {
        width: 100% !important;
    }

    #frca-exam-briefing .flex.flex-col.sm\\:flex-row > button {
        width: 100% !important;
        padding: 12px 16px !important;
        font-size: 0.875rem !important;
    }
}

@media (max-width: 640px) {
    #frca-exam-briefing {
        padding: 4px !important;
    }

    #frca-exam-briefing .frca-exam-briefing-card {
        padding: 12px !important;
        border-radius: 16px !important;
    }

    #frca-exam-briefing h3 {
        font-size: 1.125rem !important;
    }

    #frca-exam-briefing .text-xs.uppercase {
        font-size: 0.6875rem !important;
    }

    /* Extra small screens */
    #frca-exam-briefing .frca-exam-flow-hint {
        font-size: 0.75rem !important;
    }

    #frca-exam-briefing .p-3.rounded-xl {
        padding: 10px !important;
        font-size: 0.75rem !important;
    }
}

/* Prevent zoom on input focus - iOS Safari */
@media (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="password"],
    textarea,
    select {
        font-size: 12px !important;
    }
}

/* Exam Mode Required Notification Styles */
#exam-mode-required-notification {
    animation: slideInFromTop 0.3s ease-out, fadeIn 0.3s ease-out;
}

#exam-mode-required-notification > div {
    max-width: calc(100vw - 2rem) !important;
}

@media (max-width: 640px) {
    #exam-mode-required-notification {
        top: 16px !important;
        left: 1rem !important;
        right: 1rem !important;
        transform: none !important;
        max-width: calc(100vw - 2rem) !important;
        animation: slideInFromTopMobile 0.3s ease-out, fadeIn 0.3s ease-out !important;
    }

    #exam-mode-required-notification > div {
        padding: 16px !important;
        gap: 12px !important;
        margin: 0 !important;
    }

    #exam-mode-required-notification h3 {
        font-size: 0.875rem !important;
    }

    #exam-mode-required-notification p {
        font-size: 0.8125rem !important;
    }
}

@keyframes slideInFromTopMobile {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInFromTop {
    from {
        transform: translate(-50%, -20px);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Font Size Toolbar Styles */
.font-size-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.font-size-toggle-btn:hover {
    background: rgba(99, 102, 241, 0.12) !important;
    color: #6366f1 !important;
}

.dark .font-size-toggle-btn:hover {
    background: rgba(99, 102, 241, 0.25) !important;
    color: #a5b4fc !important;
}

.font-size-option {
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.font-size-option:hover {
    background: rgba(99, 102, 241, 0.12) !important;
    color: #6366f1 !important;
}

.dark .font-size-option:hover {
    background: rgba(99, 102, 241, 0.25) !important;
    color: #a5b4fc !important;
}

.font-size-option.active {
    background: rgba(99, 102, 241, 0.15) !important;
    color: #6366f1 !important;
    font-weight: 600;
}

.dark .font-size-option.active {
    background: rgba(99, 102, 241, 0.35) !important;
    color: #a5b4fc !important;
}

#font-size-dropdown {
    z-index: 100 !important;
}

#font-size-arrow {
    transition: transform 0.2s ease;
}

#font-size-arrow.rotate-180 {
    transform: rotate(180deg);
}

/* Toolbar Container Enhancement */
.flex.items-center.gap-1.bg-gray-100.dark\\:bg-white\\/5 {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dark .flex.items-center.gap-1.bg-gray-100.dark\\:bg-white\\/5 {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Responsive: Adjust font size dropdown on small screens */
@media (max-width: 640px) {
    #font-size-dropdown {
        right: 0;
        left: auto;
        min-width: 140px;
    }
    
    .font-size-label {
        display: none;
    }
}

