/* ==========================================================================
   LinkWord Stylesheet - Premium Minimalist Light Theme (Mobile First)
   ========================================================================== */

/* Variables */
:root {
    --bg-app: #f8fafc;        /* Slate 50 */
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;  /* Slate 100 */
    --bg-modal: #ffffff;
    --border-color: #e2e8f0;   /* Slate 200 */
    --border-hover: #cbd5e1;   /* Slate 300 */
    
    --text-primary: #0f172a;   /* Slate 900 */
    --text-secondary: #475569; /* Slate 600 */
    --text-muted: #94a3b8;     /* Slate 400 */
    
    --accent: #4f46e5;         /* Indigo 600 */
    --accent-hover: #4338ca;   /* Indigo 700 */
    --accent-glow: rgba(79, 70, 229, 0.08);
    --accent-subtle: rgba(79, 70, 229, 0.05);
    
    --success: #10b981;
    --danger: #ef4444;
    
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    --sidebar-width: 280px;
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 20px;
    --transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.02);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

/* Reset & Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent; /* Remove mobile touch blue highlight */
}

body {
    background-color: var(--bg-app);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* App Container */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    font-size: 18px;
    color: var(--accent);
    animation: float 3s ease-in-out infinite;
}

.logo h1 {
    font-family: var(--font-heading);
    font-size: 19px;
    font-weight: 600;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.logo-sub {
    font-size: 10px;
    font-weight: 600;
    color: var(--accent);
    background-color: var(--accent-subtle);
    padding: 2px 7px;
    border-radius: 8px;
    letter-spacing: 0.5px;
}

.header-actions {
    display: flex;
    gap: 8px;
}

/* Buttons */
button {
    font-family: var(--font-body);
    font-size: 14px;
    border: none;
    outline: none;
    cursor: pointer;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
    min-height: 40px; /* Mobile touch target standard */
}

.icon-btn {
    width: 40px;
    height: 40px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
}

.icon-btn:hover, .icon-btn:active {
    color: var(--text-primary);
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.icon-btn svg {
    width: 18px;
    height: 18px;
}

.primary-btn {
    background-color: var(--accent);
    color: #ffffff;
    font-weight: 500;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.15);
}

.primary-btn:hover, .primary-btn:active {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
}

.primary-btn:disabled {
    background-color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.5;
    box-shadow: none;
}

.secondary-btn {
    background-color: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 10px 16px;
    box-shadow: var(--shadow-sm);
}

.secondary-btn:hover, .secondary-btn:active {
    color: var(--text-primary);
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.secondary-btn svg {
    width: 16px;
    height: 16px;
}

.text-btn {
    background: transparent;
    color: var(--text-secondary);
    padding: 6px 12px;
}

.text-btn:hover, .text-btn:active {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.02);
}

.close-btn {
    font-size: 24px;
    background: transparent;
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.close-btn:hover, .close-btn:active {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.02);
}

/* App Main Layout */
.app-main {
    display: flex;
    flex: 1;
    position: relative;
}

/* History Sidebar (Sliding Drawer Overlay for Mobile & Desktop) */
.history-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: var(--sidebar-width);
    border-right: 1px solid var(--border-color);
    background-color: var(--bg-card);
    display: flex;
    flex-direction: column;
    z-index: 150;
    transform: translateX(-100%);
    transition: var(--transition);
    box-shadow: var(--shadow-lg);
}

.history-sidebar.active {
    transform: translateX(0);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h2 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.history-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-item {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
}

.history-item:hover, .history-item:active {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.history-words {
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.history-date {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Sidebar Backdrop overlay */
.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.35);
    z-index: 140;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.sidebar-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

/* Workspace */
.workspace-content {
    flex: 1;
    max-width: 680px; /* Narrower for more focused reading */
    margin: 0 auto;
    padding: 24px 16px 40px; /* Tighter padding for mobile focus */
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

/* Input Card */
.input-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.input-card:focus-within {
    border-color: var(--accent);
    box-shadow: var(--shadow-md), 0 0 0 3px var(--accent-glow);
}

.input-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.input-header h3 {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.info-tip {
    font-size: 12px;
    color: var(--text-secondary);
}

.textarea-wrapper textarea {
    width: 100%;
    height: 100px;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 16px;
    resize: none;
    line-height: 1.5;
}

.textarea-wrapper textarea::placeholder {
    color: var(--text-muted);
}

.input-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
}

.action-left {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Loading Spinner */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner.hidden {
    display: none;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 16px;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    background: #ffffff;
    box-shadow: var(--shadow-sm);
}

.empty-icon {
    font-size: 36px;
    margin-bottom: 12px;
    color: var(--accent);
}

.empty-state h3 {
    font-family: var(--font-heading);
    font-size: 17px;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 600;
}

.empty-state p {
    color: var(--text-secondary);
    max-width: 440px;
    margin: 0 auto 20px;
    font-size: 13.5px;
    line-height: 1.5;
}

.quick-examples {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.example-tag {
    background: var(--bg-app);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11.5px;
    min-height: 30px;
}

.example-tag:hover, .example-tag:active {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--bg-card);
}

/* Output Panel */
.output-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    animation: fadeIn 0.4s ease;
}

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

.story-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title h4 {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

.tag {
    font-size: 10px;
    font-weight: 700;
    color: var(--accent);
    background: var(--accent-subtle);
    padding: 2px 8px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.tts-btn {
    background: var(--bg-app);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    min-height: 36px;
}

.tts-btn:hover, .tts-btn:active {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--bg-card);
}

.tts-btn svg {
    width: 16px;
    height: 16px;
}

.story-content {
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-primary);
}

.story-content strong {
    font-weight: 700;
    color: #4338ca;            /* Dark Indigo 800 */
    background: #e0e7ff;       /* Soft Indigo 100 */
    padding: 2px 8px;
    border-radius: 6px;
    margin: 0 4px;
    display: inline-block;     /* Prevent line break inside word tag */
    border: 1px solid #c7d2fe; /* Indigo 200 border */
    box-shadow: 0 1px 2px rgba(79, 70, 229, 0.05);
}

.vocab-grid-header {
    margin-top: 4px;
}

.vocab-grid-header h3 {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
}

.vocab-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.vocab-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.vocab-card:hover, .vocab-card:active {
    border-color: var(--border-hover);
    background-color: var(--bg-app);
}

.vocab-word-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vocab-word-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.vocab-word-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.vocab-ipa {
    font-size: 12px;
    color: var(--text-secondary);
    font-family: var(--font-body);
}

.vocab-pos {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    font-style: italic;
    margin-right: 2px;
}

.vocab-definition {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.vocab-sentence {
    font-size: 13.5px;
    color: var(--text-secondary);
    background: var(--bg-app);
    border-left: 3px solid var(--accent);
    padding: 8px 12px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin-top: 2px;
}

/* Modals */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.5);
    display: flex;
    align-items: flex-end; /* Pop up from bottom on mobile */
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.25s ease;
}

@media (min-width: 640px) {
    .modal-backdrop {
        align-items: center; /* Center on desktop */
    }
}

.modal-backdrop.hidden {
    display: none;
}

.modal-card {
    background-color: var(--bg-modal);
    border-top: 1px solid var(--border-color);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    max-height: 85vh;
    transform: translateY(100%);
    transition: var(--transition);
}

@media (min-width: 640px) {
    .modal-card {
        border: 1px solid var(--border-color);
        border-radius: var(--radius-lg);
        transform: scale(0.95);
        box-shadow: var(--shadow-lg);
    }
}

.modal-backdrop:not(.hidden) .modal-card {
    transform: translateY(0);
}

@media (min-width: 640px) {
    .modal-backdrop:not(.hidden) .modal-card {
        transform: scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-group input,
.form-group select {
    background-color: var(--bg-app);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
    min-height: 42px;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--accent);
    background-color: #ffffff;
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.password-input-wrapper {
    display: flex;
    position: relative;
    width: 100%;
}

.password-input-wrapper input {
    width: 100%;
    padding-right: 60px;
}

.password-input-wrapper button {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    height: 34px;
    min-height: 34px;
}

.input-desc {
    font-size: 11px;
    color: var(--text-secondary);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

/* Scan Modal CSS */
.scan-card {
    max-width: 520px;
}

.scan-body {
    padding: 0;
    overflow: hidden;
}

.scan-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    padding: 12px;
    border-radius: 0;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 2px solid transparent;
    min-height: 44px;
}

.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.tab-content {
    display: none;
    padding: 20px;
}

.tab-content.active {
    display: block;
}

.video-container {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    background-color: #000;
    border-radius: var(--radius-md);
    overflow: hidden;
}

video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scan-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.scan-frame {
    width: 80%;
    height: 60%;
    border: 2px dashed rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.4);
    border-radius: 6px;
    position: relative;
}

.scan-frame::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--accent);
    box-shadow: 0 0 6px var(--accent);
    animation: scanner 2s ease-in-out infinite;
}

@keyframes scanner {
    0% { top: 0%; }
    50% { top: 100%; }
    100% { top: 0%; }
}

.scan-controls {
    display: flex;
    justify-content: center;
    margin-top: 16px;
}

/* Drag & Drop Zone */
.dropzone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 40px 16px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-app);
}

.dropzone:hover, .dropzone:active {
    border-color: var(--accent);
    background: var(--accent-subtle);
}

.upload-icon {
    width: 36px;
    height: 36px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.dropzone p {
    font-size: 13.5px;
    color: var(--text-secondary);
}

.dropzone .highlight {
    color: var(--accent);
    font-weight: 600;
}

.preview-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px;
    background-color: var(--bg-app);
}

#image-preview {
    max-width: 100%;
    max-height: 200px;
    border-radius: var(--radius-sm);
    object-fit: contain;
}

.scan-status {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    z-index: 10;
}

.spinner-large {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

#scan-status p {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

/* Skeleton Loading CSS */
.skeleton-card {
    position: relative;
    overflow: hidden;
}

.skeleton-line {
    height: 14px;
    background: #e2e8f0;
    border-radius: 4px;
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
}

.skeleton-title {
    height: 20px;
    background: #cbd5e1;
    border-radius: 4px;
    margin-bottom: 16px;
}

.skeleton-card::after,
.skeleton-line::after,
.skeleton-title::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    background-image: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.4) 20%,
        rgba(255, 255, 255, 0.7) 60%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: shimmer 1.8s infinite;
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

/* Float Animation */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-3px); }
    100% { transform: translateY(0px); }
}

/* Mobile Styling & Layout Adjustments */
@media (max-width: 640px) {
    body {
        font-size: 14.5px;
    }
    
    .app-header {
        padding: 10px 16px;
    }
    
    .logo h1 {
        font-size: 18px;
    }
    
    .workspace-content {
        padding: 16px 12px 30px;
        gap: 16px;
    }
    
    .input-card {
        padding: 16px;
    }
    
    .input-actions {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .action-left {
        justify-content: space-between;
    }
    
    .primary-btn {
        width: 100%;
        min-height: 44px; /* Even taller touch target for generate button */
    }
    
    .story-card {
        padding: 16px;
    }
    
    .story-content {
        font-size: 15px;
    }
    
    .vocab-card {
        padding: 14px;
        gap: 6px;
    }
    
    .vocab-word-title {
        font-size: 17px;
    }
}

/* Utility classes */
.hidden {
    display: none !important;
}

/* Protocol Warning Banner */
.protocol-warning {
    background-color: #fffbeb;
    border-bottom: 1px solid #fef3c7;
    color: #b45309;
    padding: 12px 20px;
    z-index: 1000;
    width: 100%;
}

.warning-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 13.5px;
    max-width: 800px;
    margin: 0 auto;
    flex-wrap: wrap;
    text-align: center;
}

.url-highlight {
    background-color: #fef3c7;
    padding: 2px 6px;
    border-radius: 4px;
    color: #d97706;
}

.sm-btn {
    min-height: 30px;
    padding: 4px 12px;
    font-size: 12px;
    background-color: #d97706;
    color: #fff;
    border-radius: 6px;
    box-shadow: none;
}
.sm-btn:hover {
    background-color: #b45309;
}

/* Story Translation Styling */
.story-translation {
    font-size: 14.5px;
    color: var(--text-secondary);
    margin-top: 12px;
    border-top: 1px dashed var(--border-color);
    padding-top: 12px;
    line-height: 1.6;
}

/* Cute Loading Interface CSS */
.cute-loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    text-align: center;
    margin: 20px 0;
}

.cute-mascot {
    width: 120px;
    height: 120px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Mascot Book styling */
.mascot-book {
    width: 80px;
    height: 60px;
    background: #6366f1; /* Indigo base */
    border-radius: 6px;
    position: relative;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
    animation: bookFloat 2s ease-in-out infinite;
    transform-style: preserve-3d;
    perspective: 300px;
}

/* Float animation for book */
@keyframes bookFloat {
    0% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-12px) rotate(2deg); }
    100% { transform: translateY(0) rotate(0deg); }
}

/* Left & Right Cover of the mascot book */
.mascot-book::before,
.mascot-book::after {
    content: '';
    position: absolute;
    bottom: 0;
    width: 50%;
    height: 100%;
    background: #4f46e5;
    border-radius: 6px 0 0 6px;
}
.mascot-book::before {
    left: 0;
    transform-origin: right center;
    animation: leftCover 2s ease-in-out infinite;
}
.mascot-book::after {
    right: 0;
    border-radius: 0 6px 6px 0;
    transform-origin: left center;
    animation: rightCover 2s ease-in-out infinite;
}

/* Blinking Eyes of the book */
.mascot-face {
    position: absolute;
    top: 30%;
    left: 0;
    width: 100%;
    height: 40%;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.mascot-eyes {
    display: flex;
    gap: 16px;
}

.mascot-eye {
    width: 8px;
    height: 8px;
    background: #ffffff;
    border-radius: 50%;
    position: relative;
    animation: mascotBlink 4s infinite;
}

@keyframes mascotBlink {
    0%, 90%, 100% { transform: scaleY(1); }
    95% { transform: scaleY(0.1); }
}

/* Smiling mouth */
.mascot-smile {
    width: 12px;
    height: 6px;
    border-bottom: 2px solid #ffffff;
    border-radius: 0 0 12px 12px;
    margin-top: 4px;
}

/* Mascot Book Pages Flipping */
.mascot-pages {
    position: absolute;
    top: 5%;
    left: 10%;
    width: 80%;
    height: 90%;
    background: #ffffff;
    border-radius: 4px;
    z-index: 2;
    overflow: hidden;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
}

.mascot-page-flip {
    width: 50%;
    height: 100%;
    background: #f1f5f9;
    position: absolute;
    right: 0;
    top: 0;
    transform-origin: left center;
    animation: pageFlip 1.5s ease-in-out infinite;
    z-index: 3;
    border-left: 1px solid #cbd5e1;
}

@keyframes pageFlip {
    0% { transform: rotateY(0deg); background: #f8fafc; }
    50% { transform: rotateY(-180deg); background: #e2e8f0; }
    100% { transform: rotateY(0deg); background: #f8fafc; }
}

/* Loading status text styling */
.loading-title {
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    color: var(--text-primary);
    margin-top: 10px;
    margin-bottom: 8px;
    font-weight: 600;
}

/* Loading Tip formatting */
.loading-tips-wrapper {
    background: #f8fafc;
    border-radius: 12px;
    padding: 10px 20px;
    margin: 10px auto 20px;
    max-width: 420px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed #e2e8f0;
}

.loading-tip {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
    animation: tipFade 3s infinite;
}

@keyframes tipFade {
    0%, 100% { opacity: 0.8; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(-1px); }
}

/* Bouncing Dots CSS */
.bouncing-dots {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 10px;
}

.bouncing-dots .dot {
    width: 8px;
    height: 8px;
    background: #6366f1;
    border-radius: 50%;
    animation: dotBounce 1.4s infinite ease-in-out both;
}

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

@keyframes dotBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}

