:root {
    --primary-color: #6366f1; /* Modern Indigo */
    --primary-hover: #4f46e5;
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --bg-color: #f5f7fa;
    --text-color: #1f2937;
    --text-muted: #6b7280;
    --white: #ffffff;
    --card-bg: rgba(255, 255, 255, 0.85);
    --card-border: rgba(255, 255, 255, 0.4);
    --error-color: #ef4444;
    --error-bg: #fee2e2;
    --success-color: #10b981;
    --input-border: #e5e7eb;
    --input-bg: #ffffff;
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] {
    --primary-color: #818cf8;
    --primary-hover: #6366f1;
    --primary-gradient: linear-gradient(135deg, #818cf8 0%, #c084fc 100%);
    --bg-color: #111827;
    --text-color: #f3f4f6;
    --text-muted: #9ca3af;
    --white: #1f2937;
    --card-bg: rgba(31, 41, 55, 0.85);
    --card-border: rgba(255, 255, 255, 0.1);
    --error-color: #f87171;
    --error-bg: #7f1d1d;
    --success-color: #34d399;
    --input-border: #374151;
    --input-bg: #1f2937;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Phetsarath', 'Outfit', 'Inter', -apple-system, sans-serif;
    background-color: var(--bg-color);
    background-attachment: fixed;
    color: var(--text-color);
    line-height: 1.5;
    margin: 0;
    padding-top: 80px;
    display: block;
    transition: background-color 0.3s, color 0.3s;
}

.container {
    width: 95%;
    max-width: 900px;
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 40px;
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--card-border);
    text-align: center;
    animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    margin: 20px auto 40px;
    transition: background-color 0.3s, border-color 0.3s;
}

/* ... (rest of the file with updated variables) ... */

header {
    margin-bottom: 30px;
    position: relative;
}

header h1 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 8px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.025em;
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 500;
}

/* User Nav & Language Selector */
.user-nav {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 25px;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.5);
    padding: 8px 16px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: var(--shadow-sm);
}

.nav-user-dropdown {
    position: relative;
    display: inline-block;
}

.user-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 5px 12px;
    border-radius: 50px;
    background: rgba(0, 0, 0, 0.05);
    transition: background 0.2s;
    font-size: 0.9rem;
    font-weight: 600;
}

.user-dropdown-trigger:hover {
    background: rgba(0, 0, 0, 0.1);
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 180px;
    box-shadow: var(--shadow-lg);
    border-radius: 12px;
    padding: 8px 0;
    z-index: 1100;
    border: 1px solid rgba(0, 0, 0, 0.1);
    animation: slideUp 0.2s ease-out;
}

.user-dropdown-menu a {
    display: block;
    padding: 10px 16px;
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s;
}

.user-dropdown-menu a:hover {
    background: #f3f4f6;
    color: var(--primary-color);
}

.user-dropdown-menu .btn-danger {
    color: var(--error-color);
    border-top: 1px solid #eee;
}

.user-dropdown-menu .btn-danger:hover {
    background: #fef2f2;
}

.nav-lang-item {
    display: flex;
    align-items: center;
}

.nav-lang-item .lang-selector-container {
    margin-right: 0 !important;
}

.lang-selector-container select {
    padding: 6px 12px;
    border-radius: 50px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    box-shadow: var(--shadow-sm);
}

.lang-selector-container select:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Ads Placeholder */
.ads-placeholder {
    width: 100%;
    background: rgba(243, 244, 246, 0.6);
    border: 1px dashed #d1d5db;
    padding: 12px;
    margin-bottom: 25px;
    border-radius: 12px;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Main Checker Inputs */
.input-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px 12px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    align-items: center;
}

.toolbar-btn {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-color);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
}

.toolbar-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.toolbar-btn.is-active {
    background: #eef2ff;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.toolbar-btn i {
    font-style: normal;
    font-weight: bold;
}

#inputText {
    width: 100%;
    min-height: 300px;
    padding: 20px;
    border: none;
    border-radius: 0;
    font-size: 1.15rem;
    line-height: 1.8;
    resize: vertical;
    font-family: inherit;
    background: #ffffff;
    box-shadow: none;
}

textarea {
    width: 100%;
    height: 220px;
    padding: 20px;
    border: 2px solid #e5e7eb;
    border-radius: 18px;
    font-size: 1.15rem;
    resize: none;
    transition: all 0.3s ease;
    outline: none;
    font-family: inherit;
    background: #ffffff;
    box-shadow: var(--shadow-sm);
}

.hidden {
    display: none !important;
}

.file-upload-check {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 0.95rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.5);
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.file-upload-check input[type="file"] {
    font-family: inherit;
    font-size: 0.85rem;
}

button {
    padding: 14px 36px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: inherit;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

button:active {
    transform: translateY(0);
}

/* Spinner Loader */
.loader-container {
    margin-top: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.spinner {
    width: 44px;
    height: 44px;
    border: 4px solid rgba(99, 102, 241, 0.1);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Results Content */
.result-section {
    margin-top: 35px;
    text-align: left;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.result-section h2 {
    font-size: 1.4rem;
    margin-bottom: 12px;
    font-weight: 700;
    color: var(--text-color);
}

.result-content {
    padding: 24px;
    background: #ffffff;
    border-radius: 16px;
    line-height: 1.8;
    font-size: 1.15rem;
    border: 1px solid #e5e7eb;
    box-shadow: var(--shadow-sm);
}

.misspelled {
    color: var(--error-color);
    text-decoration: underline wavy var(--error-color);
    cursor: help;
    background: var(--error-bg);
    padding: 2px 6px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.misspelled:hover {
    filter: brightness(0.95);
}

/* Recent Sessions */
.recent-sessions {
    margin-top: 40px;
    text-align: left;
    border-top: 1px solid #e5e7eb;
    padding-top: 25px;
}

.recent-sessions h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    font-weight: 700;
}

.recent-sessions ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.recent-sessions li {
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    border: 1px solid rgba(229, 231, 235, 0.5);
    font-size: 0.95rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.recent-sessions li:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: translateX(4px);
}

/* Form Styles & Admin panels */
.admin-container {
    width: 100%;
    max-width: 520px;
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 40px;
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.4);
    text-align: center;
    margin: 100px auto 40px;
}

.auth-box {
    background: #ffffff;
    padding: 30px;
    border-radius: 18px;
    border: 1px solid #e5e7eb;
    box-shadow: var(--shadow-md);
    animation: fadeIn 0.4s ease-out;
}

.auth-box h3 {
    margin-bottom: 20px;
    font-size: 1.4rem;
    font-weight: 700;
}

.admin-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    text-align: left;
}

.admin-form input,
.admin-form textarea {
    padding: 12px 16px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    width: 100% !important;
    display: block;
    transition: all 0.2s ease;
    outline: none;
    box-sizing: border-box;
    min-width: 100%;
}

.admin-form input:focus,
.admin-form textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3.5px rgba(99, 102, 241, 0.1);
}

.admin-form button {
    margin-top: 5px;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: #ffffff;
    padding: 20px;
    border-radius: 14px;
    text-align: center;
    border: 1px solid #e5e7eb;
    box-shadow: var(--shadow-sm);
}

.stat-card h3 {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 5px;
}

.stat-card p {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary-color);
}

.upload-section {
    background: #ffffff;
    padding: 25px;
    border-radius: 16px;
    border: 2px dashed #cbd5e1;
    margin-top: 20px;
    text-align: left;
}

.upload-section h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.hidden {
    display: none;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}

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

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

footer {
    margin-top: 35px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Premium Mobile Nav & File Upload Elements */
.btn-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 18px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid transparent;
    cursor: pointer;
}

.btn-nav-primary {
    background: var(--primary-gradient);
    color: white !important;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.2);
}

.btn-nav-primary:hover {
    transform: translateY(-1.5px);
    box-shadow: 0 6px 14px rgba(99, 102, 241, 0.3);
}

.btn-nav-secondary {
    background: #ffffff;
    color: var(--text-color) !important;
    border-color: #e5e7eb;
    box-shadow: var(--shadow-sm);
}

.btn-nav-secondary:hover {
    background: #f9fafb;
    border-color: #cbd5e1;
    transform: translateY(-1.5px);
}

.btn-nav-danger {
    background: #fef2f2;
    color: #ef4444 !important;
    border-color: #fee2e2;
}

.btn-nav-danger:hover {
    background: #fee2e2;
    transform: translateY(-1.5px);
}

.custom-file-upload {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border: 2px dashed var(--primary-color);
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.04);
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.custom-file-upload:hover {
    background: rgba(99, 102, 241, 0.08);
    transform: translateY(-1.5px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.08);
}

.file-name-display {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 8px;
    text-align: center;
    min-height: 20px;
    transition: all 0.2s ease;
}

/* Mode Selector */
.mode-selector {
    display: none !important;
}
.mode-selector label {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}
.mode-selector input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

/* AI Results Grid */
.ai-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}
.ai-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: transform 0.2s;
}
.ai-card:hover {
    transform: translateY(-5px);
}
.ai-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 8px;
}
.ai-line {
    font-weight: bold;
    color: #888;
    font-size: 0.8rem;
}
.ai-action {
    background: #e3f2fd;
    color: #1976d2;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: bold;
}
.ai-word-pair {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 1.2rem;
}
.ai-error {
    color: #d32f2f;
    text-decoration: line-through;
    font-weight: 500;
}
.ai-arrow {
    color: #aaa;
}
.ai-suggested {
    color: #388e3c;
    font-weight: bold;
}
.ai-guidance {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.5;
    background: #f9f9f9;
    padding: 10px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}
.ai-symbols {
    margin-top: 10px;
    font-size: 0.8rem;
    color: #d32f2f;
    font-weight: bold;
}

.pro-badge {
    background: var(--primary-gradient);
    color: white;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 1px;
    margin-right: 10px;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 25px;
    margin: 0;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
    opacity: 0.8;
}

.nav-menu a:hover, .nav-menu a.active {
    color: var(--primary-color);
    opacity: 1;
}

/* Language & Tools Dropdowns in Menu */
.lang-dropdown, .tools-dropdown {
    position: relative;
    display: inline-block;
}

.lang-dropdown-btn {
    background: none;
    border: 1px solid #ddd;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    color: var(--text-color);
    box-shadow: var(--shadow-sm);
}

.nav-dropdown-content {
    display: none !important;
    position: absolute;
    right: 0;
    background-color: white;
    min-width: 120px;
    box-shadow: var(--shadow-lg);
    z-index: 1100;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #eee;
}

.nav-dropdown-content a {
    color: var(--text-color);
    padding: 10px 15px;
    text-decoration: none;
    display: block;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.nav-dropdown-content a:hover {
    background-color: #f8f9fa;
    color: var(--primary-color);
}

.lang-dropdown:hover .nav-dropdown-content, 
.tools-dropdown:hover .nav-dropdown-content {
    display: block !important;
}

/* Navigation Base Styles */
.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(0,0,0,0.08);
    padding: 12px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* ... (previous styles) ... */
.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    position: relative;
}

/* --- Professional Converter Components --- */
.conv-drop-zone {
    border: 2px dashed #cbd5e1;
    border-radius: 24px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}
.conv-drop-zone:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
    transform: translateY(-2px);
}
.conv-drop-zone.drag-over {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}
.conv-drop-zone .icon {
    font-size: 3.5rem;
    margin-bottom: 10px;
    display: block;
}

.conv-segmented-control {
    display: inline-flex;
    background: #e5e7eb;
    padding: 4px;
    border-radius: 12px;
    gap: 4px;
}
.conv-segmented-control button {
    padding: 8px 20px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: none;
}
.conv-segmented-control button.active {
    background: white;
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.conv-chip-group {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
}
.conv-chip {
    padding: 8px 16px;
    border-radius: 50px;
    border: 1px solid #d1d5db;
    background: white;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    color: var(--text-muted);
}
.conv-chip.active {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

.conv-panel {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 650px;
    transition: all 0.3s ease;
}
.conv-panel-header {
    padding: 14px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.conv-panel-content {
    flex-grow: 1;
    padding: 25px;
    overflow-y: auto;
    outline: none;
    font-family: 'Phetsarath', serif;
    line-height: 1.7;
}
.conv-panel-footer {
    padding: 15px 20px;
    background: #f8fafc;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.conv-preview-img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    display: none;
}

/* --- Main Page Compact Drop Zone --- */
.main-drop-zone {
    border: 2px dashed #cbd5e1;
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
}
.main-drop-zone:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
}
.main-drop-zone.drag-over {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}
.main-drop-zone .upload-icon {
    font-size: 2rem;
    display: block;
}

/* ... (rest of the styles) ... */

/* ... (rest of the styles) ... */


.nav-logo {
    font-size: 2rem;
    font-weight: 800;
    text-decoration: none;
    color: var(--text-color);
    justify-self: start;
    display: flex;
    align-items: center;
}

.logo-text {
    background: linear-gradient(
        to right, 
        #ef4444, #f59e0b, #10b981, #3b82f6, #8b5cf6, #ef4444
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: rgb-glow 3s linear infinite;
}

.logo-dot {
    color: var(--primary-color);
    -webkit-text-fill-color: var(--primary-color);
}

@keyframes rgb-glow {
    to { background-position: 200% center; }
}

.nav-wrapper {
    display: flex;
    align-items: center;
    gap: 20px;
    justify-self: center;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 15px;
    justify-self: end;
}

.btn-nav-sm {
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.btn-nav-sm:hover {
    background: rgba(0,0,0,0.05);
}

.btn-nav-sm.btn-primary {
    background: var(--primary-gradient);
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    transition: all 0.3s ease;
}

.menu-toggle span {
    width: 30px;
    height: 3px;
    background: var(--text-color);
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.68, -0.6, 0.32, 1.6);
}

.menu-toggle.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-20px);
}

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

@media (max-width: 768px) {
    .container {
        padding: 20px 15px;
        border-radius: 16px;
        width: 96%;
        margin-top: 10px;
        margin-bottom: 20px;
    }
    .nav-container {
        display: flex;
        justify-content: space-between;
        grid-template-columns: none; /* Disable grid on mobile to prevent centering issues */
    }

    .menu-toggle {
        display: flex;
    }

    .nav-wrapper {
        position: fixed;
        top: 0;
        right: -100%;
        width: 260px;
        height: 100vh;
        background: rgba(255, 255, 255, 0.7);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 40px;
        transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: -10px 0 30px rgba(0,0,0,0.1);
        z-index: 1000;
        padding: 20px;
        pointer-events: none;
        border-left: 1px solid rgba(255, 255, 255, 0.4);
    }

    .nav-wrapper.active {
        right: 0;
        pointer-events: auto;
    }

    .nav-menu {
        margin: 0;
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .nav-menu a {
        font-size: 1.2rem;
        opacity: 1;
    }

    .nav-user {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        width: 100%;
    }

    /* Fix for Main Page Input Section on Mobile */
    .input-section {
        gap: 15px;
    }
    .controls-row {
        flex-direction: column;
        gap: 15px;
    }
    .mode-selector {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    button {
        width: 100%;
        padding: 16px;
        font-size: 1.2rem;
    }

    /* Fix for Converter Panels on Mobile */
    .conv-panel {
        height: auto;
        min-height: 500px;
    }
    .conv-panel-footer {
        flex-direction: column;
        gap: 15px;
        padding: 20px;
    }
    .conv-chip-group {
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }
    .conv-panel-footer button {
        width: 100%;
        padding: 12px;
    }
}

/* New Correction Cards UI */
.corrections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    margin-top: 20px;
    text-align: left;
}

.correction-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.correction-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.correction-pair {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 12px;
}

.word-wrong {
    color: var(--error-color);
    text-decoration: line-through;
    font-weight: 600;
    background: var(--error-bg);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 1.1rem;
}

.word-right {
    color: var(--success-color);
    font-weight: 700;
    background: #ecfdf5;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 1.1rem;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.1);
}

.correction-arrow {
    color: #9ca3af;
    font-weight: bold;
}

.correction-guidance {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
    background: #f9fafb;
    padding: 8px;
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);
}

.correction-meta {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
}

.rate-limit-timer {
    margin-top: 12px;
    font-size: 0.9rem;
    color: var(--error-color);
    font-weight: 600;
    animation: fadeIn 0.3s ease;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.export-dropdown {
    position: relative;
    display: inline-block;
}

.export-menu {
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    box-shadow: var(--shadow-lg);
    border-radius: 12px;
    padding: 10px 0;
    z-index: 1000;
    min-width: 120px;
    border: 1px solid #eee;
    margin-top: 5px;
}

.export-menu a {
    display: block;
    padding: 10px 20px;
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.2s;
}

.export-menu a:hover {
    background: #f8f9fa;
    color: var(--primary-color);
}

/* Document View Simulation */
.document-view {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    text-align: left;
    font-family: 'Phetsarath', serif;
    font-size: 1.2rem;
    line-height: 1.8;
    margin-bottom: 30px;
    border: 1px solid #ddd;
    white-space: pre-wrap;
    min-height: 200px;
}

.document-view .misspelled {
    cursor: pointer;
    transition: background 0.2s;
}

.document-view .misspelled:hover {
    background: #fef2f2;
    outline: 2px solid var(--error-color);
}

.results-layout {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.suggestions-section {
    text-align: left;
}

.suggestions-header {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 10px;
}

.line-num {
    background: #f1f5f9;
    color: #64748b;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 0.8rem;
    min-width: 45px;
    text-align: center;
}

.error-context {
    flex-grow: 1;
    text-align: left;
}

.highlight-error {
    background: #fee2e2;
    color: #ef4444;
    padding: 2px 4px;
    border-radius: 4px;
    text-decoration: line-through;
    font-weight: 600;
}

.suggestion-box {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
}

.suggestion-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

.suggestion-val {
    color: var(--success-color);
    font-weight: 700;
    background: #ecfdf5;
    padding: 2px 8px;
    border-radius: 4px;
}

/* Modal and Preview Diff */
.preview-diff-container {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
    font-family: 'Courier New', Courier, monospace;
    white-space: pre-wrap;
    line-height: 1.6;
    text-align: left;
}

.diff-added { background: #dcfce7; color: #166534; padding: 0 2px; border-radius: 4px; }
.diff-removed { background: #fee2e2; color: #991b1b; padding: 0 2px; text-decoration: line-through; border-radius: 4px; }

.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease-out;
    position: relative;
}

/* ── Landing Page (Enterprise) Styles ────────────────────────── */
.landing-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.hero-enterprise {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    padding: 80px 0;
    text-align: left;
}

.hero-content {
    flex: 1;
    max-width: 600px;
}

.hero-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 50px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 20px;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.hero-content h1 {
    font-size: 3.2rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 20px;
    color: var(--text-color);
}

.gradient-text {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-content p {
    color: var(--text-muted);
    font-size: 1.2rem;
    line-height: 1.6;
    margin-bottom: 30px;
}

.hero-ctas {
    display: flex;
    gap: 15px;
}

.btn-enterprise {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-enterprise.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

.btn-enterprise.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-enterprise.btn-secondary {
    background: white;
    color: var(--text-color);
    border: 1px solid #e2e8f0;
}

.btn-enterprise.btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-2px);
}

.hero-visual {
    flex: 1;
    display: flex;
    justify-content: center;
}

.mockup-container {
    width: 100%;
    max-width: 480px;
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0,0,0,0.05);
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.mockup-header {
    background: #f8fafc;
    padding: 12px 16px;
    display: flex;
    gap: 6px;
    border-bottom: 1px solid #e2e8f0;
}

.mockup-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.mockup-dot.red { background: #ef4444; }
.mockup-dot.yellow { background: #eab308; }
.mockup-dot.green { background: #22c55e; }

.mockup-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mockup-line {
    height: 8px;
    background: #f1f5f9;
    border-radius: 4px;
    width: 100%;
}
.mockup-line.short { width: 40%; }
.mockup-line.medium { width: 75%; }

.mockup-highlight {
    height: 24px;
    background: #fee2e2;
    border-radius: 4px;
    width: 90%;
    border-left: 4px solid #ef4444;
    position: relative;
    margin-top: 10px;
}
.mockup-highlight::after {
    content: "ພາສາລາວ (ບໍ່ພົບໃນພົດຈະນານຸກົມ)";
    position: absolute;
    left: 10px;
    top: 3px;
    font-size: 10px;
    color: #991b1b;
    font-family: 'Phetsarath', sans-serif;
}

/* ── Features Section ───────────────────────────────────────── */
.features-enterprise {
    padding: 80px 0;
    text-align: center;
}

.section-header {
    max-width: 600px;
    margin: 0 auto 50px;
}

.section-header h2 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-color);
}

.section-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.feature-card {
    background: white;
    padding: 35px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    text-align: left;
    transition: all 0.2s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: rgba(99, 102, 241, 0.3);
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 20px;
    display: inline-block;
    padding: 10px;
    border-radius: 12px;
    background: #f1f5f9;
}

.feature-card h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-color);
}

.feature-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ── Trust Section ────────────────────────────────────────── */
.trust-enterprise {
    padding: 60px 0;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    text-align: center;
}

.trust-content h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.trust-content p {
    color: var(--text-muted);
    margin-bottom: 30px;
}

.trust-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 40px;
}

.logo-placeholder {
    font-size: 1.1rem;
    font-weight: 700;
    color: #cbd5e1;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* ── Final CTA Section ────────────────────────────────────── */
.final-cta {
    padding: 80px 0;
}

.cta-box {
    background: var(--primary-gradient);
    border-radius: 30px;
    padding: 60px;
    color: white;
    text-align: center;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.35);
}

.cta-box h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.cta-box p {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cta-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.cta-actions .btn-enterprise.btn-secondary {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.cta-actions .btn-enterprise.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ── Mobile Responsiveness ────────────────────────────────── */
@media (max-width: 768px) {
    .hero-enterprise {
        flex-direction: column;
        text-align: center;
        padding: 40px 0;
    }
    .hero-content h1 {
        font-size: 2.2rem;
    }
    .hero-ctas {
        justify-content: center;
    }
    .features-grid {
        grid-template-columns: 1fr;
    }
    .cta-box {
        padding: 40px 20px;
    }
    .cta-box h2 {
        font-size: 1.8rem;
    }
    .cta-actions {
        flex-direction: column;
        gap: 10px;
    }
}

