/* ==========================================================================
   DESIGN SYSTEM & VARIABLES
   ========================================================================== */
:root {
    /* Fonts */
    --font-primary: 'Inter', system-ui, -apple-system, sans-serif;
    --font-heading: 'Plus Jakarta Sans', system-ui, sans-serif;

    /* Theme-independent colors */
    --color-indigo-50: #e0e7ff;
    --color-indigo-100: #c7d2fe;
    --color-indigo-500: #6366f1;
    --color-indigo-600: #4f46e5;
    --color-indigo-700: #3730a3;
    
    --color-purple-500: #8b5cf6;
    --color-purple-600: #7c3aed;
    
    --color-emerald-500: #10b981;
    --color-emerald-600: #059669;
    
    --color-amber-500: #f59e0b;
    --color-amber-600: #d97706;
    
    --color-rose-500: #f43f5e;
    --color-rose-600: #e11d48;

    /* Light Theme Colors (Default) */
    --bg-app: #f8fafc;
    --bg-app-gradient: radial-gradient(at 0% 0%, rgba(224, 231, 255, 0.3) 0px, transparent 50%),
                       radial-gradient(at 50% 0%, rgba(245, 243, 255, 0.4) 0px, transparent 50%),
                       radial-gradient(at 100% 0%, rgba(236, 253, 245, 0.3) 0px, transparent 50%);
    --bg-card: rgba(255, 255, 255, 0.85);
    --border-color: #e2e8f0;
    --border-focus: var(--color-indigo-500);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.08);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
    
    --card-backdrop: blur(12px);
    
    /* Document Preview Theme (Light Paper style) */
    --doc-bg: #ffffff;
    --doc-text: #334155;
    --doc-border: #e2e8f0;
    --doc-bilingual-text: #0369a1; /* Light mode bilingual translation color */
    --doc-heading: #1e293b;
}

/* Dark Theme Overrides */
[data-theme="dark"] {
    --bg-app: #080710;
    --bg-app-gradient: radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
                       radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.08) 0%, transparent 40%);
    --bg-card: rgba(17, 24, 39, 0.7);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-focus: var(--color-indigo-500);
    
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.25);
    
    --card-backdrop: blur(16px);
    
    /* Document Preview Theme (Dark Paper style) */
    --doc-bg: #1e293b;
    --doc-text: #cbd5e1;
    --doc-border: #334155;
    --doc-bilingual-text: #38bdf8; /* Dark mode bilingual translation color */
    --doc-heading: #f8fafc;
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-app);
    background-image: var(--bg-app-gradient);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* ==========================================================================
   LOGIN SCREEN
   ========================================================================== */
.app-container.auth-locked {
    display: none;
}

.login-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
}

.login-screen.is-hidden {
    display: none;
}

.login-card {
    width: min(100%, 440px);
    background: var(--bg-card);
    backdrop-filter: var(--card-backdrop);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.login-logo {
    width: 4rem;
    height: 4rem;
    border-radius: 0.75rem;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

.login-eyebrow {
    color: var(--color-indigo-500);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0;
}

.login-brand h1 {
    font-size: 1.5rem;
    color: var(--text-primary);
    line-height: 1.25;
}

.login-description {
    color: var(--text-secondary);
    font-size: 0.92rem;
}

.login-error {
    min-height: 1.2rem;
    color: var(--color-rose-500);
    font-size: 0.85rem;
    font-weight: 600;
}

.login-submit {
    width: 100%;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
}

/* ==========================================================================
   LAYOUT STRUCTURE
   ========================================================================== */
.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    backdrop-filter: var(--card-backdrop);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 2.25rem;
    height: 2.25rem;
    color: var(--color-indigo-500);
    filter: drop-shadow(0 0 6px rgba(99, 102, 241, 0.4));
}

.school-logo {
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 0.7rem;
    object-fit: cover;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.logo-text h1 {
    font-size: 1.25rem;
    line-height: 1.2;
    background: linear-gradient(135deg, var(--color-indigo-500), var(--color-purple-500));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-text p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.logo-author {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
    font-weight: 400;
}

.logo-author a {
    color: var(--color-indigo-500);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.logo-author a:hover {
    color: var(--color-purple-500);
    text-decoration: underline;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* ==========================================================================
   MAIN LAYOUT & SIDEBAR
   ========================================================================== */
.app-main {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 1.5rem;
    flex-grow: 1;
}

@media (max-width: 1024px) {
    .app-main {
        grid-template-columns: 1fr;
    }
}

/* Cards style */
.card {
    background: var(--bg-card);
    backdrop-filter: var(--card-backdrop);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-header h2 {
    font-size: 1.1rem;
    color: var(--text-primary);
}

.header-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--color-indigo-500);
}

.card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* ==========================================================================
   FORM CONTROLS
   ========================================================================== */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-group.col {
    flex: 1;
}

label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

input[type="text"],
input[type="password"],
select {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    background-color: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] select {
    background-color: rgba(0, 0, 0, 0.2);
}

input[type="text"]:focus,
input[type="password"]:focus,
select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Radio button card options */
.radio-card-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.radio-card {
    display: flex;
    align-items: flex-start;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.6rem;
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.02);
    transition: all 0.2s ease;
}

.radio-card:hover {
    border-color: var(--color-indigo-100);
    background-color: rgba(99, 102, 241, 0.02);
}

.radio-card.active {
    border-color: var(--color-indigo-500);
    background-color: rgba(99, 102, 241, 0.05);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.05);
}

.radio-card input[type="radio"] {
    margin-top: 0.25rem;
    margin-right: 0.75rem;
    accent-color: var(--color-indigo-500);
}

.radio-card-content {
    display: flex;
    flex-direction: column;
}

.radio-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
}

.radio-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
    line-height: 1.3;
}

/* Toggle Switch Group */
.radio-group-toggle {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    overflow: hidden;
    padding: 2px;
    background-color: rgba(0, 0, 0, 0.03);
}

.radio-toggle-label {
    flex: 1;
    text-align: center;
    cursor: pointer;
    padding: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: 0.4rem;
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.radio-toggle-label input[type="radio"] {
    display: none;
}

.radio-toggle-label.active {
    background-color: var(--color-indigo-500);
    color: white;
}

/* Input Password wrapper */
.input-password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.btn-inline-icon {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
}

.btn-inline-icon:hover {
    color: var(--text-primary);
}

/* API Status Indicator */
.api-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.25rem;
    font-size: 0.75rem;
}

.badge {
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    font-weight: 600;
}

.badge-warning {
    background-color: rgba(245, 158, 11, 0.15);
    color: var(--color-amber-600);
}

.badge-success {
    background-color: rgba(16, 185, 129, 0.15);
    color: var(--color-emerald-600);
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: 0.5rem;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-indigo-500), var(--color-purple-500));
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--color-indigo-600), var(--color-purple-600));
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.35);
}

.btn-secondary {
    background-color: transparent;
    border-color: var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--text-muted);
}

.btn-success {
    background-color: var(--color-emerald-500);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-success:hover {
    background-color: var(--color-emerald-600);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
}

.btn-large {
    padding: 0.85rem 2rem;
    font-size: 1rem;
    border-radius: 0.6rem;
}

.btn-icon {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--text-muted);
}

/* ==========================================================================
   CONTENT AREA & WIZARD
   ========================================================================== */
.content-area {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Stepper */
.stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 2rem;
}

.step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.step.active {
    opacity: 1;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background-color: var(--border-color);
    color: var(--text-primary);
    font-weight: 700;
    font-size: 0.85rem;
    border: 2px solid transparent;
}

.step.active .step-number {
    background-color: var(--color-indigo-500);
    color: white;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

.step.completed .step-number {
    background-color: var(--color-emerald-500);
    color: white;
}

.step-label {
    font-size: 0.9rem;
    font-weight: 600;
}

.step-line {
    flex-grow: 1;
    height: 2px;
    background-color: var(--border-color);
    margin: 0 1.5rem;
}

@media (max-width: 640px) {
    .stepper {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 1rem;
    }
    .step-line {
        display: none;
    }
}

/* ==========================================================================
   FILE UPLOAD CARD
   ========================================================================== */
.upload-card {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.upload-zone {
    width: 100%;
    border: 2px dashed var(--border-color);
    border-radius: 0.75rem;
    padding: 3rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--color-indigo-500);
    background-color: rgba(99, 102, 241, 0.02);
}

.upload-icon-wrapper {
    background-color: rgba(99, 102, 241, 0.05);
    padding: 1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.upload-zone:hover .upload-icon-wrapper {
    transform: scale(1.1);
}

.upload-icon {
    width: 2.5rem;
    height: 2.5rem;
    color: var(--color-indigo-500);
}

.upload-zone h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.upload-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Selected File Info */
.file-info-container {
    width: 100%;
    max-width: 500px;
    margin-top: 1rem;
}

.file-details {
    display: flex;
    align-items: center;
    gap: 1rem;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 0.6rem;
    margin-bottom: 1.5rem;
}

.file-icon-large {
    width: 2rem;
    height: 2rem;
}

.file-metadata {
    flex-grow: 1;
    overflow: hidden;
}

.file-metadata h4 {
    font-size: 0.95rem;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

.file-metadata p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ==========================================================================
   PROGRESS / STATUS CARD
   ========================================================================== */
.status-card {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.status-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.spinner {
    width: 1.5rem;
    height: 1.5rem;
    border: 3px solid rgba(99, 102, 241, 0.15);
    border-top-color: var(--color-indigo-500);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.progress-bar-wrapper {
    height: 8px;
    background-color: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-indigo-500), var(--color-purple-500));
    border-radius: 4px;
    transition: width 0.4s ease;
    position: relative;
    overflow: hidden;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: progress-sweep 1.5s infinite;
}

.status-steps {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.status-step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    opacity: 0.5;
}

.status-step.active {
    opacity: 1;
    font-weight: 500;
}

.status-step.completed {
    opacity: 1;
    color: var(--color-emerald-600);
}

.step-check {
    width: 1.25rem;
    height: 1.25rem;
}

.status-step.completed .step-check {
    fill: rgba(16, 185, 129, 0.1);
    color: var(--color-emerald-500);
}

.status-console {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 0.5rem;
    padding: 0.85rem 1rem;
    font-family: monospace;
    font-size: 0.78rem;
    max-height: 120px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
}

.console-line {
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

/* ==========================================================================
   PREVIEW PANEL
   ========================================================================== */
.preview-card {
    display: flex;
    flex-direction: column;
}

.preview-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
}

.preview-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.preview-tabs {
    display: flex;
    border: 1px solid var(--border-color);
    padding: 2px;
    border-radius: 0.5rem;
    background-color: rgba(0, 0, 0, 0.05);
}

.tab-btn {
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 0.4rem;
    border: none;
    background: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn.active {
    background-color: var(--color-indigo-500);
    color: white;
}

.preview-panes {
    background-color: rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    max-height: 500px;
    overflow-y: auto;
    border-bottom: 1px solid var(--border-color);
}

.preview-pane {
    display: none;
}

.preview-pane.active {
    display: block;
}

/* Document Sheet Effect */
.document-container {
    background-color: var(--doc-bg);
    color: var(--doc-text);
    border: 1px solid var(--doc-border);
    border-radius: 0.5rem;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    min-height: 400px;
    font-size: 0.95rem;
    overflow-x: auto;
}

.preview-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
}

/* ==========================================================================
   WORD CONTENT RENDERING STYLES
   ========================================================================== */
.word-content h1, 
.word-content h2, 
.word-content h3, 
.word-content h4 {
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--doc-heading);
    line-height: 1.3;
}

.word-content h1 { font-size: 1.6rem; border-bottom: 1px solid var(--doc-border); padding-bottom: 0.3rem; }
.word-content h2 { font-size: 1.35rem; }
.word-content h3 { font-size: 1.15rem; }

.word-content p {
    margin-bottom: 0.75rem;
    text-align: justify;
}

.word-content ul, 
.word-content ol {
    margin-left: 1.5rem;
    margin-bottom: 0.75rem;
}

.word-content li {
    margin-bottom: 0.25rem;
}

.word-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.25rem 0;
    font-size: 0.9rem;
}

.word-content th, 
.word-content td {
    border: 1px solid var(--doc-border);
    padding: 0.6rem 0.8rem;
    text-align: left;
    vertical-align: top;
}

.word-content th {
    background-color: rgba(0, 0, 0, 0.03);
    font-weight: 600;
}

.word-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1rem auto;
    border-radius: 0.25rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Bilingual text decoration */
.bilingual-translation {
    color: var(--doc-bilingual-text);
    font-style: italic;
    font-size: 0.9em;
    margin-top: 0.15rem;
    display: block;
}

.bilingual-translation-inline {
    color: var(--doc-bilingual-text);
    font-style: italic;
    font-size: 0.9em;
}

/* ==========================================================================
   ALERTS / ADVICE CARD
   ========================================================================== */
.alert-card {
    border-left: 4px solid var(--color-amber-500);
}

.card-warning {
    background-color: rgba(245, 158, 11, 0.02);
}

[data-theme="dark"] .card-warning {
    background-color: rgba(245, 158, 11, 0.01);
}

.alert-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem 1.5rem 0.5rem;
}

.alert-header h3 {
    font-size: 1rem;
    color: var(--color-amber-600);
}

.alert-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--color-amber-500);
}

.alert-content {
    padding: 0 1.5rem 1.25rem 1.5rem;
}

.alert-content ul {
    margin-left: 1.25rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

/* ==========================================================================
   AUTHOR CARD
   ========================================================================== */
.author-card {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 1.5rem;
    align-items: center;
    padding: 1.5rem;
}

.author-media {
    display: flex;
    justify-content: center;
}

.author-avatar {
    width: 160px;
    height: 160px;
    border-radius: 0.75rem;
    object-fit: cover;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.author-info {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.author-label {
    width: fit-content;
    padding: 0.25rem 0.55rem;
    border-radius: 0.35rem;
    background-color: rgba(99, 102, 241, 0.1);
    color: var(--color-indigo-500);
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
}

.author-info h2 {
    font-size: 1.35rem;
    color: var(--text-primary);
}

.author-info p {
    color: var(--text-secondary);
    font-size: 0.92rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

@media (max-width: 640px) {
    .app-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .header-logo {
        align-items: flex-start;
    }

    .author-card {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .author-info {
        align-items: center;
    }

    .author-info p {
        justify-content: center;
    }
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.app-footer {
    text-align: center;
    padding: 1.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
}

/* ==========================================================================
   ANIMATIONS & MISC UTILITIES
   ========================================================================== */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes progress-sweep {
    from { transform: translateX(-100%); }
    to { transform: translateX(100%); }
}

.text-indigo { color: var(--color-indigo-500); }
.text-red { color: var(--color-rose-500); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }

/* Tooltip and details */
.tooltip {
    position: relative;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}

.small-icon {
    width: 0.9rem;
    height: 0.9rem;
    color: var(--text-muted);
}

.tiny-icon {
    width: 0.75rem;
    height: 0.75rem;
    display: inline;
    vertical-align: middle;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #0f172a;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 0.35rem;
    font-size: 0.75rem;
    width: 200px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 10;
    font-weight: normal;
    line-height: 1.3;
}

.tooltip:hover::after {
    opacity: 1;
}

.link-small {
    color: var(--color-indigo-500);
    text-decoration: none;
    font-weight: 500;
}

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

/* ==========================================================================
   API KEY MODAL & HEADER WARNING STYLES
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    width: 90%;
    max-width: 500px;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.api-warning-text {
    color: var(--color-rose-500);
    font-weight: 700;
    font-size: 0.85rem;
    margin-right: 1rem;
    animation: headerWarningPulse 1.5s infinite;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background-color: rgba(244, 63, 94, 0.1);
    padding: 0.35rem 0.75rem;
    border-radius: 0.35rem;
    border: 1px solid rgba(244, 63, 94, 0.2);
}

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

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

@keyframes headerWarningPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
