:root {
    /* Premium Dashboard - Blue & White Theme */
    --accent: #0062FF;
    --accent-light: rgba(0, 98, 255, 0.1);
    --accent-glow: rgba(0, 98, 255, 0.3);

    --bg-page: #F8FAFC;
    --bg-surface: #FFFFFF;
    --bg-sidebar: #001242;
    /* Deeper, Rugged Navy Blue */

    --text-primary: #1E293B;
    --text-secondary: #475569;
    --text-muted: #94A3B8;
    --text-on-sidebar: #FFFFFF;
    /* Maximum Contrast White */

    --brand-blue: #0062FF;
    --brand-purple: #6366F1;

    --success: #10B981;
    --error: #EF4444;
    --warning: #F59E0B;

    --border: rgba(226, 232, 240, 0.8);
    --radius-xl: 24px;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-premium: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

.error-spelling {
    color: #EF4444;
    text-decoration: underline wavy #EF4444;
    text-underline-offset: 4px;
    cursor: pointer;
    transition: 0.2s;
}

.error-spelling:hover {
    background: rgba(239, 68, 68, 0.1);
    border-radius: 4px;
}

.error-grammar {
    color: #F59E0B;
    text-decoration: underline wavy #F59E0B;
    text-underline-offset: 4px;
    cursor: pointer;
}

.error-grammar:hover {
    background: rgba(245, 158, 11, 0.1);
    border-radius: 4px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-page);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* --- Global Wrapper --- */
.global-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: #F8FAFC;
    background-image: radial-gradient(at 0% 0%, rgba(0, 98, 255, 0.03) 0px, transparent 50%), radial-gradient(at 100% 100%, rgba(0, 198, 255, 0.03) 0px, transparent 50%);
}

[data-bs-theme="dark"] .global-wrapper {
    background: #0B1120;
    background-image: radial-gradient(at 0% 0%, rgba(37, 99, 235, 0.06) 0px, transparent 50%), radial-gradient(at 100% 100%, rgba(0, 198, 255, 0.04) 0px, transparent 50%);
}

.main-navbar {
    height: 72px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
    z-index: 2000;
}

[data-bs-theme="dark"] .main-navbar {
    background: rgba(15, 23, 42, 0.92);
    border-bottom-color: rgba(30, 41, 59, 0.9);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.navbar .brand {
    text-decoration: none;
}

.brand-text {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 800;
    color: #0F172A;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

[data-bs-theme="dark"] .brand-text {
    color: #F8FAFC;
}

.brand-badge {
    background: linear-gradient(135deg, #0062FF 0%, #00C6FF 100%);
    color: white;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 6px;
    margin-left: 6px;
    vertical-align: middle;
}

.brand-subtext {
    font-size: 0.76rem;
    font-weight: 600;
    color: #64748B;
    letter-spacing: 0.02em;
}

[data-bs-theme="dark"] .brand-subtext {
    color: #94A3B8;
}

.nav-link {
    font-weight: 600;
    color: #475569 !important;
    font-size: 0.9rem;
    transition: 0.2s;
}

.nav-link:hover {
    color: var(--brand-blue) !important;
}

[data-bs-theme="dark"] .nav-link {
    color: #94A3B8 !important;
}

[data-bs-theme="dark"] .nav-link:hover {
    color: #38BDF8 !important;
}

.btn-glow-small {
    background: linear-gradient(135deg, #0062FF 0%, #0084FF 100%);
    color: white !important;
    padding: 9px 22px;
    border-radius: 100px;
    font-weight: 700;
    font-size: 0.88rem;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(0, 98, 255, 0.3);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
}

.btn-glow-small:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 98, 255, 0.45);
    color: white !important;
}

/* User Dropdown & Trigger */
.user-dropdown {
    position: relative;
}

.user-trigger {
    padding: 6px 14px 6px 8px;
    background: #FFFFFF;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 100px;
    font-size: 0.88rem;
    font-weight: 700;
    color: #1E293B;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

.user-trigger:hover {
    background: #F8FAFC;
    border-color: #93C5FD;
    box-shadow: 0 4px 12px rgba(0, 98, 255, 0.12);
    color: #0062FF;
}

.user-trigger svg {
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.user-dropdown.active .user-trigger svg {
    transform: rotate(180deg);
}

[data-bs-theme="dark"] .user-trigger {
    background: #151D2C;
    border-color: #233148;
    color: #F8FAFC;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .user-trigger:hover {
    background: #1E293B;
    border-color: #38BDF8;
    color: #38BDF8;
}

.user-dropdown .dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 250px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 20px;
    padding: 8px;
    box-shadow: 0 20px 40px -6px rgba(15, 23, 42, 0.15), 0 4px 14px -2px rgba(15, 23, 42, 0.06);
    z-index: 3000;
    animation: dropdownFade 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.user-dropdown.active .dropdown-menu {
    display: block;
}

[data-bs-theme="dark"] .user-dropdown .dropdown-menu {
    background: rgba(21, 29, 44, 0.98);
    border-color: #233148;
    box-shadow: 0 20px 40px -6px rgba(0, 0, 0, 0.6);
}

@keyframes dropdownFade {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.user-dropdown-header {
    padding: 12px 14px;
    background: #F8FAFC;
    border-radius: 14px;
    margin-bottom: 6px;
    border: 1px solid rgba(226, 232, 240, 0.7);
}

[data-bs-theme="dark"] .user-dropdown-header {
    background: #0B0F19;
    border-color: #233148;
}

.user-dropdown .dropdown-section-title {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: #94A3B8;
    padding: 6px 12px 4px 12px;
    text-transform: uppercase;
}

.user-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #475569;
    text-decoration: none;
    transition: all 0.18s ease;
}

.user-dropdown .dropdown-item:hover {
    background: #EEF4FF;
    color: #0062FF;
    transform: translateX(3px);
}

.user-dropdown .dropdown-item svg {
    color: #64748B;
    transition: color 0.18s ease;
}

.user-dropdown .dropdown-item:hover svg {
    color: #0062FF;
}

[data-bs-theme="dark"] .user-dropdown .dropdown-item {
    color: #94A3B8;
}

[data-bs-theme="dark"] .user-dropdown .dropdown-item:hover {
    background: rgba(37, 99, 235, 0.2);
    color: #93C5FD;
}

[data-bs-theme="dark"] .user-dropdown .dropdown-item:hover svg {
    color: #93C5FD;
}

.user-dropdown .dropdown-item.text-danger:hover {
    background: #FEF2F2 !important;
    color: #DC2626 !important;
}

.user-dropdown .dropdown-item.text-danger:hover svg {
    color: #DC2626 !important;
}

[data-bs-theme="dark"] .user-dropdown .dropdown-item.text-danger:hover {
    background: rgba(220, 38, 38, 0.2) !important;
    color: #F87171 !important;
}

/* Mobile Hamburger Button */
.btn-mobile-hamburger {
    background: rgba(241, 245, 249, 0.9);
    border: 1px solid rgba(226, 232, 240, 0.85);
    border-radius: 10px;
    padding: 7px 9px;
    color: #1E293B;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-mobile-hamburger:hover {
    background: #EEF4FF;
    color: #0062FF;
    border-color: #93C5FD;
}

[data-bs-theme="dark"] .btn-mobile-hamburger {
    background: rgba(30, 41, 59, 0.9);
    border-color: #334155;
    color: #F8FAFC;
}

/* Mobile Drawer & Backdrop */
.mobile-nav-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.mobile-nav-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

.mobile-nav-drawer {
    position: fixed;
    top: 0;
    right: -320px;
    width: 300px;
    max-width: 85vw;
    height: 100vh;
    background: #FFFFFF;
    border-left: 1px solid rgba(226, 232, 240, 0.85);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-nav-drawer.show {
    right: 0;
}

[data-bs-theme="dark"] .mobile-nav-drawer {
    background: #111827;
    border-left-color: #1F2937;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
}

.btn-close-mobile-nav {
    background: transparent;
    border: none;
    color: #94A3B8;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.btn-close-mobile-nav:hover {
    color: #EF4444;
    background: rgba(239, 68, 68, 0.1);
}

.mobile-nav-section-label {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: #94A3B8;
    margin-bottom: 8px;
    padding-left: 8px;
}

[data-bs-theme="dark"] .mobile-nav-section-label {
    color: #64748B;
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mobile-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 12px;
    color: #334155;
    font-weight: 600;
    font-size: 0.92rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.mobile-nav-item:hover, .mobile-nav-item.active {
    background: #EEF4FF;
    color: #0062FF;
    transform: translateX(3px);
}

[data-bs-theme="dark"] .mobile-nav-item {
    color: #CBD5E1;
}

[data-bs-theme="dark"] .mobile-nav-item:hover, [data-bs-theme="dark"] .mobile-nav-item.active {
    background: rgba(37, 99, 235, 0.2);
    color: #93C5FD;
}

.btn-mobile-logout {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #DC2626;
    padding: 10px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.9rem;
    transition: 0.2s;
}

.btn-mobile-logout:hover {
    background: #DC2626;
    color: #FFFFFF;
}

[data-bs-theme="dark"] .btn-mobile-logout {
    background: rgba(220, 38, 38, 0.15);
    border-color: rgba(220, 38, 38, 0.3);
    color: #F87171;
}

[data-bs-theme="dark"] .btn-mobile-logout:hover {
    background: #DC2626;
    color: #FFFFFF;
}

.avatar-md {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0062FF 0%, #00C6FF 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
}

/* --- App Layout --- */
.app-container {
    flex: 1;
    padding: 24px 0;
    background: transparent;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Sidebar Styles */
.landing-sidebar {
    padding-top: 0;
}

.sidebar-card-elevated {
    background: #FFFFFF;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 20px;
    padding: 20px 14px;
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.03);
}

[data-bs-theme="dark"] .sidebar-card-elevated {
    background: #151D2C;
    border-color: #233148;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.3);
}

.label-category {
    font-size: 0.72rem;
    font-weight: 800;
    color: #94A3B8;
    letter-spacing: 0.1em;
    margin-bottom: 14px;
    padding-left: 12px;
}

[data-bs-theme="dark"] .label-category {
    color: #64748B;
}

.mode-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mode-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    color: #475569;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.mode-item.active {
    background: #EEF4FF;
    color: #0062FF;
    font-weight: 700;
    border: 1px solid rgba(0, 98, 255, 0.12);
    box-shadow: 0 2px 8px rgba(0, 98, 255, 0.08);
}

.mode-item:hover:not(.active) {
    background: #F8FAFC;
    color: #0F172A;
    transform: translateX(3px);
}

[data-bs-theme="dark"] .mode-item {
    color: #94A3B8;
}

[data-bs-theme="dark"] .mode-item.active {
    background: rgba(37, 99, 235, 0.2);
    color: #93C5FD;
    border-color: rgba(37, 99, 235, 0.35);
}

[data-bs-theme="dark"] .mode-item:hover:not(.active) {
    background: rgba(255, 255, 255, 0.04);
    color: #F8FAFC;
}
/* Editor Section */
.editor-glass-card {
    background: #FFFFFF;
    border-radius: 20px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 10px 30px -5px rgba(15, 23, 42, 0.04), 0 2px 8px -2px rgba(15, 23, 42, 0.02);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

[data-bs-theme="dark"] .editor-glass-card {
    background: #151D2C;
    border-color: #233148;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.4);
}

.editor-toolbar {
    min-height: 52px;
    background: #FAFCFF;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    gap: 10px;
}

[data-bs-theme="dark"] .editor-toolbar {
    background: #101726;
    border-color: #233148;
}

.tool-link {
    background: transparent;
    border: none;
    color: #475569;
    font-weight: 600;
    font-size: 0.84rem;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 6px 10px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    line-height: 1;
}

.tool-link:hover {
    color: #0062FF;
    background: #EEF4FF;
}

[data-bs-theme="dark"] .tool-link {
    color: #94A3B8;
}

[data-bs-theme="dark"] .tool-link:hover {
    color: #38BDF8;
    background: rgba(37, 99, 235, 0.2);
}

.tool-link svg {
    stroke-width: 2.2px;
}

.lang-pill {
    background: #F1F5F9;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 100px;
    padding: 5px 12px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #334155;
    outline: none;
}

[data-bs-theme="dark"] .lang-pill {
    background: rgba(255, 255, 255, 0.08);
    border-color: #233148;
    color: #CBD5E1;
}

.text-danger-hover:hover {
    color: var(--error) !important;
    background: #FEF2F2 !important;
}

#editor {
    outline: none;
    font-size: 1.08rem;
    line-height: 1.75;
    color: #1E293B;
    overflow-y: auto;
    min-height: 480px;
    padding: 24px;
    font-family: var(--font-body);
}

[data-bs-theme="dark"] #editor {
    color: #F1F5F9;
}

#editor[placeholder]:empty:before {
    content: attr(placeholder);
    color: #94A3B8;
    opacity: 0.7;
    font-size: 1.02rem;
    font-weight: 400;
}

/* Assistant Area */
.assistant-glass {
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 20px;
    background: #FFFFFF;
    box-shadow: 0 10px 30px -5px rgba(15, 23, 42, 0.04), 0 2px 8px -2px rgba(15, 23, 42, 0.02);
}

[data-bs-theme="dark"] .assistant-glass {
    background: #151D2C;
    border-color: #233148;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.4);
}

/* --- Premium Suggestion Cards (Ultra-Beautiful) --- */
.suggestions-container {
    padding-bottom: 20px;
}

.suggestion-card-premium {
    background: #FFFFFF;
    border: 1px solid #F1F5F9;
    border-radius: 20px;
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    animation: cardEntry 0.5s ease-out backwards;
    white-space: pre-wrap;
    /* Maintains AI paragraph structure in preview */
}

@keyframes cardEntry {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.suggestion-card-premium:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.04);
    border-color: #E2E8F0;
}

.suggestion-card-premium.spelling {
    background: linear-gradient(to bottom right, #FFFFFF, #FFF5F5);
}

.suggestion-card-premium.grammar {
    background: linear-gradient(to bottom right, #FFFFFF, #FFFBEB);
}

.card-type-chip {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    padding: 2px 8px;
    border-radius: 100px;
    width: fit-content;
    margin-bottom: 12px;
}

.spelling .card-type-chip {
    background: #FEE2E2;
    color: #EF4444;
}

.grammar .card-type-chip {
    background: #FEF3C7;
    color: #D97706;
}

.diff-bubble {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #F8FAFC;
    padding: 8px 16px;
    border-radius: 12px;
    width: fit-content;
    margin-bottom: 16px;
}

.word-original {
    color: #94A3B8;
    text-decoration: line-through;
    font-weight: 500;
}

.word-suggested {
    color: #1E293B;
    font-weight: 700;
    font-size: 1.05rem;
}

.diff-arrow {
    color: #CBD5E1;
}

.card-footer-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.confidence-meter {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 60px;
}

.confidence-meter span {
    font-size: 0.65rem;
    font-weight: 700;
    color: #64748B;
}

.meter-bar {
    height: 3px;
    background: #E2E8F0;
    border-radius: 10px;
    position: relative;
}

.meter-bar::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: #10B981;
    border-radius: 10px;
    width: inherit;
}

.btn-apply-small {
    background: #1E293B;
    color: white;
    border: none;
    border-radius: 10px;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 700;
    transition: 0.2s;
}

.suggestion-card-premium:hover .btn-apply-small {
    background: #0062FF;
    transform: scale(1.05);
}

/* Suggestion Item Button */
.btn-suggestion-item {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    color: #1E293B;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: left;
    transition: all 0.2s;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-suggestion-item:hover {
    background: #F8FAFC;
    border-color: #0062FF;
    color: #0062FF;
    transform: translateX(4px);
}

.btn-suggestion-item small {
    font-size: 0.75rem;
    font-weight: 500;
}

/* Empty State Polish */
.empty-state h5 {
    font-weight: 800;
    color: #1E293B;
    margin-top: 16px;
}

/* Layout Primitives */
.dashboard-layout {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 32px 48px;
    background: #F8FAFC;
}

[data-bs-theme="dark"] .content-area {
    background: #0B0F19;
}

@media (max-width: 991px) {
    .dashboard-layout {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
    }
    .sidebar {
        width: 100% !important;
        padding: 16px 20px !important;
        min-height: auto;
    }
    .sidebar .brand {
        margin-bottom: 16px !important;
    }
    .sidebar .nav-group {
        margin-bottom: 14px !important;
    }
    .content-area {
        padding: 20px 14px !important;
        overflow-y: visible !important;
    }
}

/* Sidebar Styling - The Premium Anchor */
.sidebar {
    width: 280px;
    background: var(--bg-sidebar);
    color: var(--text-on-sidebar);
    display: flex;
    flex-direction: column;
    padding: 32px 24px;
    z-index: 1000;
    transition: all 0.3s ease;
}

.sidebar .brand {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 48px;
    text-decoration: none;
}

.sidebar .brand span {
    color: #FFFFFF;
    opacity: 0.7;
}

.nav-group {
    margin-bottom: 32px;
}

.sidebar .nav-label {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #FFFFFF !important;
    margin-bottom: 12px;
    padding-left: 12px;
    opacity: 0.95;
}

.sidebar .nav-link,
.sidebar .nav-link:link,
.sidebar .nav-link:visited,
.sidebar .nav-link:hover,
.sidebar .nav-link:active {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 14px 16px !important;
    border-radius: var(--radius-md) !important;
    color: #FFFFFF !important;
    /* Crystal Pure White */
    text-decoration: none !important;
    font-weight: 600 !important;
    transition: 0.25s ease !important;
    margin-bottom: 4px !important;
}

.sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}

.sidebar .nav-link svg,
.sidebar .nav-link i {
    stroke: #FFFFFF !important;
    color: #FFFFFF !important;
    opacity: 1 !important;
}

.sidebar .nav-link.active {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #FFFFFF !important;
    border-left: 4px solid #FFFFFF !important;
    border-radius: 4px 12px 12px 4px !important;
    padding-left: 12px !important;
    /* Adjust for border */
    font-weight: 700 !important;
    box-shadow: none !important;
}

.sidebar .nav-link.active svg {
    stroke: #FFFFFF !important;
    opacity: 1 !important;
}



.nav-icon {
    width: 20px;
    height: 20px;
}

/* Main Content Area */
.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 40px;
}

.header-glass {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.page-title h1 {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.page-title p {
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Cards & Components */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.premium-card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.premium-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-premium);
    border-color: var(--accent);
}

.stat-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--accent-light);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Data Tables */
.table-container {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.table-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.premium-table {
    width: 100%;
    border-collapse: collapse;
}

.premium-table th {
    background: #F8FAFC;
    padding: 16px 24px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.premium-table td {
    padding: 16px 24px;
    font-size: 0.9375rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
}

.premium-table tr:last-child td {
    border-bottom: none;
}

/* --- Premium Buttons --- */
.btn-premium {
    background: linear-gradient(135deg, #0062FF 0%, #0047BA 100%);
    color: #FFFFFF;
    padding: 14px 28px;
    border-radius: 12px;
    border: none;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    box-shadow: 0 8px 16px rgba(0, 98, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.btn-premium::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(255, 255, 255, 0.2), transparent);
    opacity: 0;
    transition: 0.3s;
}

.btn-premium:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(0, 98, 255, 0.3);
    background: linear-gradient(135deg, #1A73FF 0%, #0056E0 100%);
}

.btn-premium:hover::after {
    opacity: 1;
}

.btn-secondary {
    background: #FFFFFF;
    border: 2px solid #E2E8F0;
    color: #1E293B;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 700;
    transition: 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-secondary:hover {
    border-color: #0062FF;
    color: #0062FF;
    transform: translateY(-2px);
}

.btn-glow {
    background: linear-gradient(135deg, #0062FF 0%, #0047BA 100%);
    color: white;
    padding: 14px 36px;
    border-radius: 50px;
    font-weight: 800;
    font-size: 1rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 20px rgba(0, 98, 255, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.btn-glow:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 20px 40px rgba(0, 98, 255, 0.4);
    background: linear-gradient(135deg, #1A73FF 0%, #0056E0 100%);
}

/* Badges */
.badge {
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-success {
    background: #DCFCE7;
    color: #166534;
}

.badge-error {
    background: #FEE2E2;
    color: #991B1B;
}

.badge-warning {
    background: #FEF3C7;
    color: #92400E;
}

.badge-blue {
    background: #DBEAFE;
    color: #1E40AF;
}

/* --- High-Performance Chart Cards --- */
.charts-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 32px;
    margin-bottom: 48px;
}

.chart-card {
    background: #FFFFFF;
    border-radius: 28px;
    border: 1px solid rgba(226, 232, 240, 0.6);
    padding: 32px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.02);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    height: 450px;
    /* Fixed height to prevent stretching */
    display: flex;
    flex-direction: column;
}

.chart-wrapper {
    flex: 1;
    min-height: 0;
    position: relative;
}

.chart-card h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 800;
    color: #1E293B;
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.chart-card h3::before {
    content: '';
    width: 4px;
    height: 18px;
    background: var(--accent);
    border-radius: 10px;
}

@media (max-width: 991px) {
    .charts-row {
        grid-template-columns: 1fr;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Form Styling - Premium Inputs */
.form-input {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: #F1F5F9;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    transition: 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
    background: #FFFFFF;
    box-shadow: 0 0 0 4px var(--accent-light);
}

/* --- Editor & Assistant Panel --- */
.editor-wrapper {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.toolbar {
    height: 64px;
    padding: 0 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#editor {
    flex: 1;
    padding: 40px;
    font-size: 1.15rem;
    line-height: 1.8;
    outline: none;
    overflow-y: auto;
}

#editor[placeholder]:empty:before {
    content: attr(placeholder);
    color: var(--text-muted);
    opacity: 0.5;
}

.editor-footer {
    height: 48px;
    padding: 0 24px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.assistant-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.glass-card {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.score-container {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 32px auto;
}

.score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

#scoreVal {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
}

.score-ring-bg {
    fill: none;
    stroke: #f1f5f9;
    stroke-width: 10;
}

.score-ring-progress {
    fill: none;
    stroke: var(--accent);
    stroke-width: 10;
    stroke-linecap: round;
    transition: 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.suggestions-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

/* --- Smart Hover Tooltip (Premium Glassmorphism) --- */
.suggestion-tooltip {
    position: absolute;
    z-index: 3000;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 16px;
    padding: 16px;
    min-width: 240px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: tooltipFadeIn 0.2s cubic-bezier(0, 0, 0.2, 1);
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.suggestion-tooltip.hidden {
    display: none !important;
}

.tooltip-header {
    font-size: 0.65rem;
    font-weight: 800;
    color: #94A3B8;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 4px;
}

.tooltip-suggestion {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #F8FAFC;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
}

.tooltip-suggestion:hover {
    background: #1E293B;
    color: white;
}

.tooltip-suggestion .word {
    font-weight: 700;
    font-size: 0.95rem;
}

.tooltip-suggestion .conf {
    font-size: 0.75rem;
    font-weight: 600;
    opacity: 0.7;
}

.tooltip-footer {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid #F1F5F9;
}

.tooltip-btn {
    flex: 1;
    padding: 6px;
    border: none;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    transition: 0.2s;
}

.btn-ignore {
    background: #F1F5F9;
    color: #475569;
}

.btn-dictionary {
    background: #E0F2FE;
    color: #0369A1;
}

.tooltip-btn:hover {
    filter: brightness(0.95);
}

/* --- Success Flash Feedback --- */
.flash-success {
    animation: successFlash 0.5s ease-out;
}

@keyframes successFlash {
    100% {
        background-color: transparent;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.spin {
    animation: spin 1s linear infinite;
}

.badge-blue {
    background: #DBEAFE;
    color: #1E40AF;
}

.badge-success {
    background: #DCFCE7;
    color: #166534;
}

.suggestion-card-premium.style {
    border-left: 4px solid #0062FF;
}


/* --- User Dropdown --- */
.user-dropdown {
    position: relative;
    cursor: pointer;
}

.user-trigger {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px;
    border-radius: 100px;
    transition: 0.2s;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
}

.user-trigger:hover {
    background: #F1F5F9;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    background: var(--brand-blue);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

.user-name-text {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1E293B;
}

.user-dropdown .dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    min-width: 200px;
    background: white;
    border-radius: 16px;
    border: 1px solid #E2E8F0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2100;
    display: block;
    /* Custom display logic */
    padding: 10px 0;
}

.user-dropdown:hover .dropdown-menu,
.user-dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown .dropdown-menu a {
    display: block;
    padding: 10px 20px;
    color: #475569;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: 0.2s;
}

.user-dropdown .dropdown-menu a:hover {
    background: #F8FAFC;
    color: var(--brand-blue);
}

.user-dropdown .dropdown-menu hr {
    margin: 8px 0;
    border-color: #F1F5F9;
}

@media (max-width: 991px) {
    .user-dropdown .dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        padding: 0;
        opacity: 1;
        visibility: visible;
        transform: none;
        margin-top: 20px;
        background: transparent;
    }

    .user-dropdown .dropdown-menu a {
        padding: 12px 16px;
    }
}

/* --- PWA Modal Overlay --- */
.pwa-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9000;
}

.pwa-modal-card {
    background: white;
    width: 90%;
    max-width: 500px;
    border-radius: 32px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.pwa-icon-large {
    width: 80px;
    height: 80px;
    background: var(--brand-blue);
    color: white;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    margin: 0 auto;
    box-shadow: 0 10px 20px rgba(0, 98, 255, 0.2);
}

.animate-slide-up {
    animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ==========================================================================
   ONYINYECHI AI v5.0 - INTERACTIVE POPOVER, DARK THEME & AI MODALS
   ========================================================================== */

/* --- Dark Theme Variables --- */
[data-bs-theme="dark"] {
    --bg-page: #0B1120;
    --bg-surface: #1E293B;
    --text-primary: #F1F5F9;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    --border: rgba(51, 65, 85, 0.8);
    background-color: var(--bg-page);
    color: var(--text-primary);
}

[data-bs-theme="dark"] .global-wrapper,
[data-bs-theme="dark"] .navbar,
[data-bs-theme="dark"] .editor-glass-card,
[data-bs-theme="dark"] .assistant-glass,
[data-bs-theme="dark"] .editor-toolbar,
[data-bs-theme="dark"] .score-card,
[data-bs-theme="dark"] .suggestion-card-premium,
[data-bs-theme="dark"] .paraphrase-modal-card,
[data-bs-theme="dark"] .interactive-popover {
    background: #1E293B !important;
    color: #F1F5F9 !important;
    border-color: #334155 !important;
}

[data-bs-theme="dark"] .editor-content {
    color: #F8FAFC !important;
}

[data-bs-theme="dark"] .tool-link {
    color: #94A3B8;
    background: #0F172A;
}

[data-bs-theme="dark"] .tool-link:hover {
    color: #38BDF8;
    background: #1E293B;
}

/* --- Theme Toggle Button --- */
.theme-toggle-btn {
    background: rgba(148, 163, 184, 0.1);
    border: 1px solid var(--border);
    color: var(--text-primary);
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
    background: rgba(148, 163, 184, 0.2);
    transform: scale(1.05);
}

/* --- Error Highlight Styles --- */
.error-highlight {
    border-radius: 3px;
    padding: 1px 2px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.error-highlight.error-spelling {
    color: #EF4444;
    text-decoration: underline wavy #EF4444;
    text-underline-offset: 4px;
}

.error-highlight.error-spelling:hover {
    background: rgba(239, 68, 68, 0.15);
}

.error-highlight.error-grammar {
    color: #2563EB;
    text-decoration: underline wavy #2563EB;
    text-underline-offset: 4px;
}

.error-highlight.error-grammar:hover {
    background: rgba(37, 99, 235, 0.15);
}

.error-highlight.error-style {
    color: #D97706;
    text-decoration: underline wavy #D97706;
    text-underline-offset: 4px;
}

.error-highlight.error-style:hover {
    background: rgba(217, 119, 6, 0.15);
}

/* --- Interactive Popover Tooltip --- */
.interactive-popover {
    position: absolute;
    z-index: 3000;
    width: 280px;
    background: #FFFFFF;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 20px 30px -10px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    animation: popoverFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.interactive-popover.hidden {
    display: none !important;
}

@keyframes popoverFade {
    from {
        opacity: 0;
        transform: translateY(6px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.popover-type-badge {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 6px;
}

.popover-type-badge.spelling {
    background: #FEE2E2;
    color: #DC2626;
}

.popover-type-badge.grammar {
    background: #DBEAFE;
    color: #1D4ED8;
}

.popover-type-badge.style {
    background: #FEF3C7;
    color: #D97706;
}

.popover-close-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #94A3B8;
    cursor: pointer;
    line-height: 1;
}

.popover-reason {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.35;
}

.popover-suggestion-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 8px 12px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #0F172A;
    cursor: pointer;
    transition: all 0.15s ease;
}

[data-bs-theme="dark"] .popover-suggestion-btn {
    background: #0F172A;
    border-color: #334155;
    color: #F8FAFC;
}

.popover-suggestion-btn:hover {
    background: #2563EB;
    border-color: #2563EB;
    color: #FFFFFF;
    transform: translateX(2px);
}

.popover-suggestion-btn:hover .suggestion-conf-badge {
    background: rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
}

.suggestion-conf-badge {
    font-size: 0.72rem;
    padding: 2px 6px;
    border-radius: 6px;
    background: #E2E8F0;
    color: #475569;
}

[data-bs-theme="dark"] .suggestion-conf-badge {
    background: #334155;
    color: #CBD5E1;
}

.popover-action-btn {
    background: none;
    border: none;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 2px 4px;
    border-radius: 6px;
    transition: 0.15s;
}

.popover-action-btn:hover {
    opacity: 0.8;
}

/* --- Multi-Tone Paraphraser Modal --- */
.paraphrase-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(6px);
    z-index: 4000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.paraphrase-modal-backdrop.hidden {
    display: none !important;
}

.paraphrase-modal-card {
    background: #FFFFFF;
    width: 100%;
    max-width: 650px;
    border-radius: 24px;
    padding: 24px;
    max-height: 85vh;
    overflow-y: auto;
    animation: modalSlide 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlide {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.tone-pill {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: rgba(148, 163, 184, 0.1);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.tone-pill:hover,
.tone-pill.active {
    background: #2563EB;
    border-color: #2563EB;
    color: #FFFFFF;
}

.paraphrase-item-card {
    background: var(--bg-page);
    border: 1px solid var(--border);
}

.rewrite-text {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-primary);
}

.badge-tone {
    background: #E0E7FF;
    color: #4338CA;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
}

[data-bs-theme="dark"] .badge-tone {
    background: #312E81;
    color: #C7D2FE;
}

/* =========================================================
   ONYINYECHI AI v5.0 - ELEVATED UI/UX BRUSHUPS & TIGHTENING
   ========================================================= */

/* Writing Mode Selector Pill (Navbar) */
.mode-selector-pill {
    background: rgba(241, 245, 249, 0.8);
    border: 1px solid var(--border);
    gap: 4px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

.mode-pill {
    border: none;
    background: transparent;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 999px;
    color: var(--text-secondary);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.mode-pill:hover {
    color: var(--text-primary);
}

.mode-pill.active {
    background: #FFFFFF;
    color: #2563EB;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
}

[data-bs-theme="dark"] .mode-selector-pill {
    background: #1E293B;
    border-color: #334155;
}

[data-bs-theme="dark"] .mode-pill.active {
    background: #2563EB;
    color: #FFFFFF;
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.4);
}

/* Live Status Pulse Pill */
.live-status-pill {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.live-pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10B981;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Category-Specific Wavy Underlines */
.error-spelling {
    color: #DC2626;
    text-decoration: underline wavy #EF4444;
    text-underline-offset: 4px;
    text-decoration-thickness: 1.5px;
    cursor: pointer;
    border-radius: 3px;
    padding: 1px 2px;
    transition: all 0.15s ease;
}

.error-spelling:hover {
    background: rgba(239, 68, 68, 0.12);
}

.error-grammar {
    color: #2563EB;
    text-decoration: underline wavy #2563EB;
    text-underline-offset: 4px;
    text-decoration-thickness: 1.5px;
    cursor: pointer;
    border-radius: 3px;
    padding: 1px 2px;
    transition: all 0.15s ease;
}

.error-grammar:hover {
    background: rgba(37, 99, 235, 0.12);
}

.error-style {
    color: #8B5CF6;
    text-decoration: underline wavy #8B5CF6;
    text-underline-offset: 4px;
    text-decoration-thickness: 1.5px;
    cursor: pointer;
    border-radius: 3px;
    padding: 1px 2px;
    transition: all 0.15s ease;
}

.error-style:hover {
    background: rgba(139, 92, 246, 0.12);
}

.error-punctuation {
    color: #D97706;
    text-decoration: underline wavy #F59E0B;
    text-underline-offset: 4px;
    text-decoration-thickness: 1.5px;
    cursor: pointer;
    border-radius: 3px;
    padding: 1px 2px;
    transition: all 0.15s ease;
}

.error-punctuation:hover {
    background: rgba(245, 158, 11, 0.12);
}

/* Floating Popover Elevation */
.interactive-popover {
    position: absolute;
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    width: 290px;
    z-index: 3000;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    animation: popoverFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: top center;
}

[data-bs-theme="dark"] .interactive-popover {
    background: #1E293B;
    border-color: #334155;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

@keyframes popoverFade {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.interactive-popover.hidden {
    display: none !important;
}

/* Suggestion Buttons in Popover */
.btn-sug-replace {
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    color: #1D4ED8;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 8px 14px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 6px;
}

.btn-sug-replace:hover {
    background: #2563EB;
    border-color: #2563EB;
    color: #FFFFFF;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

[data-bs-theme="dark"] .btn-sug-replace {
    background: rgba(37, 99, 235, 0.2);
    border-color: rgba(37, 99, 235, 0.4);
    color: #93C5FD;
}

[data-bs-theme="dark"] .btn-sug-replace:hover {
    background: #2563EB;
    color: #FFFFFF;
}

/* Sidebar Suggestion Cards */
.suggestion-card-premium {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 10px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.suggestion-card-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.06);
    border-color: #93C5FD;
}

[data-bs-theme="dark"] .suggestion-card-premium {
    background: #151D2C;
    border-color: #233148;
}

[data-bs-theme="dark"] .suggestion-card-premium:hover {
    border-color: #3B82F6;
    box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.4);
}

/* Fix All Button */
.btn-fix-all-gradient {
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
    color: #FFFFFF;
    font-weight: 700;
    font-size: 0.88rem;
    padding: 10px 18px;
    border-radius: 12px;
    border: none;
    box-shadow: 0 6px 16px -3px rgba(37, 99, 235, 0.4);
    transition: all 0.2s ease;
    cursor: pointer;
    width: 100%;
}

.btn-fix-all-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px -3px rgba(37, 99, 235, 0.5);
    color: #FFFFFF;
}

/* Editor Scrollbar */
.editor-content::-webkit-scrollbar,
.suggestions-container::-webkit-scrollbar {
    width: 6px;
}

.editor-content::-webkit-scrollbar-thumb,
.suggestions-container::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.3);
    border-radius: 4px;
}

.editor-content::-webkit-scrollbar-thumb:hover,
.suggestions-container::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.5);
}

/* --- Clean Score Card with Reduced Typography --- */
.score-card {
    background: #F8FAFC;
    border: 1px solid rgba(226, 232, 240, 0.85);
    border-radius: 16px;
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
    margin-bottom: 2px;
}

[data-bs-theme="dark"] .score-card {
    background: #151D2C;
    border-color: #233148;
}

.score-circle-container {
    position: relative;
    width: 84px;
    height: 84px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.score-circle-container svg {
    width: 84px;
    height: 84px;
    transform: rotate(-90deg);
}

.score-ring-bg {
    fill: none;
    stroke: #E2E8F0;
    stroke-width: 8;
}

[data-bs-theme="dark"] .score-ring-bg {
    stroke: #1E293B;
}

.score-ring-progress {
    fill: none;
    stroke: #10B981;
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.6s cubic-bezier(0.4, 0, 0.2, 1), stroke 0.4s ease;
}

.score-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1;
    pointer-events: none;
    width: 100%;
    text-align: center;
}

#scoreVal {
    font-family: var(--font-heading);
    font-size: 1.45rem;
    font-weight: 800;
    color: #0F172A;
    letter-spacing: -0.03em;
    line-height: 1;
    margin: 0 0 1px 0;
}

[data-bs-theme="dark"] #scoreVal {
    color: #F8FAFC;
}

.score-label-text {
    font-size: 0.54rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: #94A3B8;
    line-height: 1;
    margin: 0;
}

.empty-check-icon {
    width: 52px;
    height: 52px;
    background: #ECFDF5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

[data-bs-theme="dark"] .empty-check-icon {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
}

#fixAllContainer {
    width: 100%;
    margin-top: 2px;
}

#fixAllContainer.d-none {
    display: none !important;
}

.btn-fix-all-gradient {
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
    color: #FFFFFF;
    font-weight: 700;
    font-size: 0.82rem;
    padding: 8px 14px;
    border-radius: 10px;
    border: none;
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.3);
    transition: all 0.2s ease;
    cursor: pointer;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    line-height: 1.3;
}

.btn-fix-all-gradient:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(37, 99, 235, 0.45);
    color: #FFFFFF;
}

/* --- Compact, Precision Action Toolbar --- */
.editor-toolbar {
    min-height: 48px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    padding: 6px 14px !important;
    gap: 8px;
}

[data-bs-theme="dark"] .editor-toolbar {
    background: #151D2C;
    border-color: #233148;
}

.lang-pill {
    background: rgba(148, 163, 184, 0.12);
    color: var(--text-secondary);
    font-size: 0.76rem;
    font-weight: 700;
    padding: 4px 9px;
    border-radius: 6px;
    letter-spacing: 0.02em;
    user-select: none;
}

[data-bs-theme="dark"] .lang-pill {
    background: rgba(255, 255, 255, 0.08);
    color: #CBD5E1;
}

.tool-link {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 5px 8px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    line-height: 1;
}

.tool-link:hover {
    background: rgba(37, 99, 235, 0.08);
    color: #2563EB;
}

.tool-link.text-danger-hover:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
}

[data-bs-theme="dark"] .tool-link {
    color: #94A3B8;
}

[data-bs-theme="dark"] .tool-link:hover {
    background: rgba(37, 99, 235, 0.2);
    color: #93C5FD;
}

/* Compact Check Spellings Button */
.btn-check-compact {
    background: #2563EB;
    color: #FFFFFF;
    border: none;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 6px 14px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
    transition: all 0.2s ease;
    line-height: 1.2;
    white-space: nowrap;
}

.btn-check-compact:hover {
    background: #1D4ED8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.45);
    color: #FFFFFF;
}

.btn-check-compact:active {
    transform: translateY(0);
}

/* =========================================================
   MOBILE RESPONSIVENESS & TOUCH OPTIMIZATIONS
   ========================================================= */

/* Mobile Mode Strip */
.mobile-mode-bar {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 70px;
    z-index: 1020;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Mobile Floating Drawer Trigger Pill */
.mobile-drawer-pill {
    position: fixed;
    bottom: 16px;
    left: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 18px;
    z-index: 1040;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 4px 10px -2px rgba(0, 0, 0, 0.05);
    animation: slideUpPill 0.3s ease;
}

[data-bs-theme="dark"] .mobile-drawer-pill {
    background: rgba(21, 29, 44, 0.94);
    border-color: #233148;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

@keyframes slideUpPill {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.mobile-score-badge {
    background: #10B981;
    color: #FFFFFF;
    font-weight: 800;
    font-size: 0.85rem;
    padding: 4px 10px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Mobile Responsive Breakpoints */
@media (max-width: 991px) {
    .app-container {
        padding: 12px 0 80px 0;
        height: auto;
        overflow-y: visible;
    }

    .editor-glass-card {
        border-radius: 16px;
        min-height: 55vh;
    }

    .editor-content {
        min-height: 40vh;
        font-size: 1rem;
        line-height: 1.6;
        padding: 16px !important;
    }

    .editor-toolbar {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 8px 12px !important;
    }

    .assistant-sidebar {
        margin-top: 20px;
    }

    .interactive-popover {
        position: fixed !important;
        top: auto !important;
        bottom: 24px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: 92vw !important;
        max-width: 380px !important;
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25) !important;
        z-index: 5000 !important;
    }

    .paraphrase-modal-card {
        border-radius: 20px 20px 0 0;
        max-height: 90vh;
        width: 100%;
        position: fixed;
        bottom: 0;
        margin: 0;
    }
}

@media (max-width: 576px) {
    .main-navbar {
        height: 64px;
    }

    .brand-text {
        font-size: 1.15rem;
    }

    .brand-subtext {
        display: none !important;
    }

    .editor-footer {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start !important;
        padding: 10px 14px;
    }
}

/* =========================================================
   SIDEBAR SUGGESTION CARDS & REPLACEMENT CHIPS
   ========================================================= */

.suggestions-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 24px;
}

.suggestion-card-premium {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 10px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    position: relative;
}

.suggestion-card-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.1);
    border-color: #93C5FD;
}

[data-bs-theme="dark"] .suggestion-card-premium {
    background: #151D2C;
    border-color: #233148;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

[data-bs-theme="dark"] .suggestion-card-premium:hover {
    border-color: #3B82F6;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

/* Card Type Badges */
.card-type-chip {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 3px 8px;
    border-radius: 6px;
    line-height: 1;
}

.card-type-chip.spelling {
    background: #FEE2E2;
    color: #DC2626;
}

.card-type-chip.grammar {
    background: #DBEAFE;
    color: #1D4ED8;
}

.card-type-chip.style {
    background: #EDE9FE;
    color: #6D28D9;
}

.card-type-chip.punctuation {
    background: #FEF3C7;
    color: #B45309;
}

[data-bs-theme="dark"] .card-type-chip.spelling {
    background: rgba(220, 38, 38, 0.2);
    color: #F87171;
}

[data-bs-theme="dark"] .card-type-chip.grammar {
    background: rgba(37, 99, 235, 0.2);
    color: #93C5FD;
}

[data-bs-theme="dark"] .card-type-chip.style {
    background: rgba(109, 40, 217, 0.2);
    color: #C4B5FD;
}

[data-bs-theme="dark"] .card-type-chip.punctuation {
    background: rgba(217, 119, 6, 0.2);
    color: #FCD34D;
}

/* Original Error Word Display */
.word-original {
    font-weight: 700;
    font-size: 0.95rem;
}

.card-reason-text {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Suggestion Clickable Action Buttons inside Card */
.btn-suggestion-item {
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    color: #1D4ED8;
    font-weight: 700;
    font-size: 0.88rem;
    padding: 7px 12px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
}

.btn-suggestion-item:hover {
    background: #2563EB;
    border-color: #2563EB;
    color: #FFFFFF;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.btn-suggestion-item .badge-conf {
    font-size: 0.72rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(37, 99, 235, 0.12);
    color: inherit;
}

.btn-suggestion-item:hover .badge-conf {
    background: rgba(255, 255, 255, 0.25);
    color: #FFFFFF;
}

[data-bs-theme="dark"] .btn-suggestion-item {
    background: rgba(37, 99, 235, 0.15);
    border-color: rgba(37, 99, 235, 0.35);
    color: #93C5FD;
}

[data-bs-theme="dark"] .btn-suggestion-item:hover {
    background: #2563EB;
    color: #FFFFFF;
}

/* Ignore Button */
.btn-ignore-card {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    border-radius: 4px;
    transition: 0.15s;
}

.btn-ignore-card:hover {
    color: #EF4444;
    background: rgba(239, 68, 68, 0.1);
}