/* Free AI Humanizer - Dark Theme Styles */

:root {
    /* Primary Colors - Dark Theme */
    --bg-primary: #0D0C1D;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: rgba(255, 255, 255, 0.05);

    /* Glass Effects */
    --glass-background: rgba(26, 26, 46, 0.6);
--glass-background-hover: rgba(26, 26, 46, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);

    /* Accent Colors */
    --primary-color: #4F46E5;
    --primary-gradient: linear-gradient(135deg, #4F46E5, #7C3AED);
    --secondary-color: #A855F7;
    --success-color: #10B981;
    --warning-color: #F59E0B;
    --error-color: #EF4444;

    /* Text Colors */
    --text-primary: #E5E7EB;
    --text-secondary: #9CA3AF;
    --text-muted: #6B7280;
    --text-headings: #FFFFFF;
    --text-color: #E5E7EB; /* Added for nav compatibility */

    /* Border Colors */
    --border-color: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(255, 255, 255, 0.2);

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.3);

    --transition-speed: 0.3s;
    --io-body-height: clamp(320px, 45vh, 600px);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    position: relative;
    min-height: 100vh;
}

/* Aurora Background Effect */
body::before {
    content: '';
    position: fixed;
    top: -30%;
    left: -20%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, #4F46E5 0%, transparent 70%);
    opacity: 0.15;
    filter: blur(120px);
    z-index: -1;
    animation: aurora-1 20s infinite alternate;
}

body::after {
    content: '';
    position: fixed;
    bottom: -30%;
    right: -20%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, #A855F7 0%, transparent 70%);
    opacity: 0.15;
    filter: blur(120px);
    z-index: -1;
    animation: aurora-2 15s infinite alternate;
}

@keyframes aurora-1 {
    from { transform: scale(0.8) rotate(0deg); opacity: 0.1; }
    to { transform: scale(1.2) rotate(45deg); opacity: 0.2; }
}

@keyframes aurora-2 {
    from { transform: scale(1.2) rotate(0deg); opacity: 0.2; }
    to { transform: scale(0.8) rotate(-45deg); opacity: 0.1; }
}

/* Hero Section */
.hero { 
    text-align: center; 
    padding: 1.5rem 1rem 2rem; 
    position: relative; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
}

.hero-container { 
    max-width: 900px; 
    margin: 0 auto; 
    width: 100%; 
}

.hero-title {
    font-size: clamp(1.75rem, 5vw, 2.75rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin: 0 0 0.75rem 0;
    background: linear-gradient(135deg, #FFFFFF 30%, #A78BFA 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
    width: 100%;
    text-align: center;
    padding-top: 15px;
}

.hero-subtitle { 
    font-size: clamp(0.95rem, 2.5vw, 1.125rem); 
    color: var(--text-secondary); 
    margin: 0 auto 1.5rem; 
    max-width: 600px; 
    line-height: 1.5; 
    opacity: 0.9; 
    text-align: center;
}

/* App Container */
.app-container { 
    max-width: 1600px; 
    margin: -0.5rem auto 0; 
    padding: 0 1rem; 
}

.app-layout {
    display: flex;
    background: var(--glass-background);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    min-height: 700px;
}

/* Sidebar */
.sidebar { 
    width: 320px; 
    background: rgba(255, 255, 255, 0.02); 
    border-right: 1px solid var(--border-color); 
    display: flex; 
    flex-direction: column; 
}

.sidebar-header { 
    padding: 2rem 1.5rem; 
    background: var(--glass-background); 
    border-bottom: 1px solid var(--border-color); 
}

.sidebar-title { 
    font-size: 1.5rem; 
    font-weight: 700; 
    margin-bottom: 0.5rem; 
    color: var(--text-headings); 
}

.sidebar-subtitle { 
    color: var(--text-secondary); 
    font-size: 0.875rem; 
}

.sidebar-nav { 
    flex: 1; 
    padding: 1rem; 
    overflow-y: auto; 
}

.tab-list { 
    display: flex; 
    flex-direction: column; 
    gap: 0.5rem; 
}

.tab-button { 
    display: flex; 
    align-items: center; 
    width: 100%; 
    padding: 1rem; 
    background: transparent; 
    border: 1px solid transparent; 
    border-radius: 0.75rem; 
    cursor: pointer; 
    transition: all var(--transition-speed); 
    text-align: left; 
    color: var(--text-secondary); 
}

.tab-button:hover { 
    background: var(--glass-background-hover); 
    border-color: var(--border-hover); 
    transform: translateX(4px); 
}

.tab-button.active { 
    background: var(--primary-gradient); 
    color: white; 
    border: none; 
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3); 
}

.tab-icon { 
    font-size: 1.25rem; 
    margin-right: 1rem; 
    width: 2rem; 
    text-align: center; 
}

.tab-content { 
    flex: 1; 
}

.tab-title { 
    font-weight: 600; 
    margin-bottom: 0.25rem; 
    font-size: 0.95rem; 
}

.tab-desc { 
    font-size: 0.75rem; 
    opacity: 0.7; 
}

.sidebar-footer { 
    padding: 1.5rem; 
    background: var(--glass-background); 
    border-top: 1px solid var(--border-color); 
    font-size: 0.75rem; 
    color: var(--text-secondary); 
}

.usage-info { 
    margin-bottom: 0.5rem; 
}

.usage-tier { 
    font-weight: 600; 
    background: var(--primary-gradient); 
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent; 
    background-clip: text; 
}

/* Main Content */
.main-content { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    background: rgba(255, 255, 255, 0.02); 
}

.content-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 1.5rem 2rem; 
    background: var(--glass-background); 
    border-bottom: 1px solid var(--border-color); 
}

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

.content-title { 
    font-size: 1.5rem; 
    font-weight: 600; 
    margin: 0; 
    color: var(--text-headings); 
}

.content-badge { 
    padding: 0.25rem 0.75rem; 
    background: var(--primary-gradient); 
    color: white; 
    border-radius: 9999px; 
    font-size: 0.75rem; 
    font-weight: 600; 
}

.btn-icon { 
    padding: 0.5rem; 
    background: var(--glass-background); 
    border: 1px solid var(--border-color); 
    border-radius: 0.5rem; 
    cursor: pointer; 
    transition: all var(--transition-speed); 
    color: var(--text-secondary); 
}

.btn-icon:hover { 
    background: var(--glass-background-hover); 
    border-color: var(--border-hover); 
    transform: translateY(-2px); 
}

/* Content Area */
.content-area { 
    flex: 1; 
    padding: 2rem; 
    overflow-y: auto; 
}

.description-card { 
    background: var(--glass-background); 
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px); 
    padding: 1.5rem; 
    border-radius: 1rem; 
    margin-bottom: 2rem; 
    border: 1px solid var(--border-color); 
}
.description-card p { 
    margin: 0; 
    color: var(--text-secondary); 
    line-height: 1.7; 
}

/* Input/Output Grid */
.io-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 2rem; 
}

.io-panel { 
    background: var(--glass-background); 
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px); 
    border: 1px solid var(--border-color); 
    border-radius: 1rem; 
    display: flex; 
    flex-direction: column; 
    transition: all var(--transition-speed);
    position: relative;
    z-index: 1;
}

.io-panel:hover { 
    border-color: var(--border-hover); 
    box-shadow: var(--shadow-lg);
    z-index: 10;
}

.panel-header { 
    padding: 1.25rem 1.5rem; 
    background: rgba(255, 255, 255, 0.03); 
    border-bottom: 1px solid var(--border-color); 
}

.panel-header h3 { 
    margin: 0 0 0.25rem 0; 
    font-size: 1.125rem; 
    font-weight: 600; 
    color: var(--text-headings); 
}

.panel-subtitle { 
    font-size: 0.875rem; 
    color: var(--text-secondary); 
}

.panel-body { 
    flex: 1; 
    padding: 1.5rem; 
    display: flex; 
    flex-direction: column;
    position: relative;
    height: var(--io-body-height);
    min-height: 300px;
    max-height: 65vh;
    overflow: hidden; /* critical: scroll stays inside editors */
}


.text-input,
.text-output {
    flex: 1;
    width: 100%;
    height: 100%;
    border: none;
    outline: none;
    font-size: 1rem;
    line-height: 1.7;
    resize: none;
    font-family: inherit;
    background: transparent;
    color: var(--text-primary);
    position: relative;
    z-index: 1;
    overflow-y: auto;
}



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

#detection-score { 
    display: none !important; 
}

.text-output {
    background: rgba(255, 255, 255, 0.02);
    padding: 1rem;
    border-radius: 0.5rem;
    height: 100%;
    min-height: 0;               /* lets flex sizing work */
    white-space: pre-wrap;
    word-wrap: break-word;
    border: 1px solid var(--border-color);
    position: relative;
    display: block;
    overflow-y: auto;            /* scrolls inside this box */
}

/* hide scrollbar when empty, show placeholder */
.text-output:not(.has-content) {
    overflow-y: hidden;
}
.text-output:not(.has-content)::before {
    content: attr(data-placeholder);
    position: absolute;
    inset: 1rem auto auto 1rem;
    color: var(--text-muted);
    pointer-events: none;
}


.empty-state { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    height: 100%; 
    color: var(--text-muted); 
}

.empty-state i { 
    font-size: 3rem; 
    margin-bottom: 1rem; 
    opacity: 0.3; 
}

.panel-stats { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-top: 1rem; 
    padding-top: 1rem; 
    border-top: 1px solid var(--border-color); 
    font-size: 0.875rem; 
    color: var(--text-secondary); 
}

.panel-stats .warning { 
    color: var(--warning-color); 
}

.detection-low { 
    color: var(--success-color); 
}

.detection-medium { 
    color: var(--warning-color); 
}

.detection-high { 
    color: var(--error-color); 
}

.panel-footer { 
    padding: 1.5rem; 
    background: rgba(255, 255, 255, 0.02); 
    border-top: 1px solid var(--border-color); 
}

.panel-footer .footer-controls { 
    display: flex; 
    flex-direction: column; 
    gap: 1rem; 
}

/* Buttons */
.btn-primary,
.btn-secondary {
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 0.5rem;
    width: 100%; 
    padding: 0.875rem 1.5rem; 
    border: none; 
    border-radius: 0.75rem;
    font-size: 1rem; 
    font-weight: 600; 
    cursor: pointer; 
    transition: all var(--transition-speed);
}

.btn-primary { 
    background: var(--primary-gradient); 
    color: white; 
    position: relative; 
    overflow: hidden; 
}

.btn-primary::before { 
    content: ''; 
    position: absolute; 
    top: 0; 
    left: -100%; 
    width: 100%; 
    height: 100%; 
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent); 
    transition: left 0.5s; 
}

.btn-primary:hover:not(:disabled) { 
    transform: translateY(-2px); 
    box-shadow: 0 10px 25px rgba(79, 70, 229, 0.3); 
}

.btn-primary:hover::before { 
    left: 100%; 
}

.btn-secondary { 
    background: var(--glass-background); 
    color: var(--text-primary); 
    border: 1px solid var(--border-color); 
}

.btn-secondary:hover:not(:disabled) { 
    background: var(--glass-background-hover); 
    border-color: var(--border-hover); 
    transform: translateY(-1px); 
}

.btn-primary:disabled, 
.btn-secondary:disabled { 
    opacity: 0.5; 
    cursor: not-allowed; 
}

.btn-secondary.success { 
    background: rgba(16, 185, 129, 0.1); 
    color: var(--success-color); 
    border-color: rgba(16, 185, 129, 0.3); 
}

/* Status Messages */
#status-container { 
    margin-top: 1rem; 
}

.status-message { 
    padding: 1rem; 
    border-radius: 0.75rem; 
    margin-bottom: 1rem; 
    animation: slideDown 0.3s ease-out; 
    backdrop-filter: blur(10px); 
}

.status-processing { 
    background: rgba(79, 70, 229, 0.1); 
    border: 1px solid rgba(79, 70, 229, 0.3); 
}

.status-success { 
    background: rgba(16, 185, 129, 0.1); 
    color: var(--success-color); 
    border: 1px solid rgba(16, 185, 129, 0.3); 
}

.status-error { 
    background: rgba(239, 68, 68, 0.1); 
    color: var(--error-color); 
    border: 1px solid rgba(239, 68, 68, 0.3); 
}

.status-message.fade-out { 
    animation: fadeOut 0.3s ease-out forwards; 
}

/* SEO Content */
.seo-content {
    margin-top: 4rem;
    padding: 4rem 0;
    background: var(--glass-background);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color);
}

.seo-content h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 2rem;
    text-align: center;
    color: var(--text-headings);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.feature-card {
    text-align: center;
    padding: 2.5rem;
    background: var(--glass-background);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    transition: all var(--transition-speed);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity var(--transition-speed);
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 15px 35px rgba(79, 70, 229, 0.2);
}

.feature-card:hover::before {
    opacity: 0.05;
}

.feature-card i {
    font-size: 3rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--text-headings);
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.seo-text {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
    color: var(--text-secondary);
}

.seo-text h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text-headings);
}

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

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: rgba(13, 12, 29, 0.98);
    border-radius: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    color: var(--text-color);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 0;
    position: relative;
    overflow: hidden;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.05);
}

.modal-header h2 {
    margin: 0;
    color: var(--text-headings);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 500;
    margin: 0;
    color: var(--text-color);
}

.modal-body {
    padding: 2rem 1.5rem;
    font-size: 1.25rem;
    line-height: 1.5;
    color: var(--text-color);
}

.modal-features ul {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.modal-features li {
    padding: 0.75rem 0;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.modal-features li::before {
    content: '✓';
    color: var(--success-color);
    font-weight: bold;
}

.modal-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.05);
}

.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 999;
}

.modal-dialog {
    margin: 1.75rem auto;
    max-width: 500px;
    width: calc(100% - 2rem);
}

/* Navigation */
.nav-container {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--glass-background);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

.nav-content {
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    height: 4rem;
    background-color: #0D0C1D !important;
}

.nav-links {
    display: none;
}

.auth-buttons {
    display: none;
}

.nav-link {
    padding: 0.5rem 0.75rem;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 0.375rem;
    transition: background-color var(--transition-speed), color var(--transition-speed);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    position: relative;
    z-index: 1;
}

.nav-link:hover {
    background-color: var(--glass-background-hover);
    color: var(--text-color);
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.08);
}

/* Dropdown styles */
.nav-item.nav-dropdown {
    position: relative;
    display: inline-block;
}

.nav-dropdown-toggle {
    cursor: pointer;
}

.dropdown-arrow {
    margin-left: 0.4em;
    font-size: 0.7em;
    transition: transform var(--transition-speed) ease;
    display: inline-block;
    vertical-align: middle;
}

.nav-dropdown-menu {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    min-width: 200px;
    padding: 0.5rem 0;
    background: #0D0C1D;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0.5rem;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(5px);
    pointer-events: none;
    transition: opacity var(--transition-speed) ease,
                visibility var(--transition-speed) ease,
                transform var(--transition-speed) ease;
}

.nav-item.nav-dropdown:hover > .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.nav-item.nav-dropdown:hover > .nav-dropdown-toggle .dropdown-arrow {
    transform: rotate(180deg);
}

.nav-dropdown-item {
    display: block;
    padding: 0.6rem 1.2rem;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem;
    white-space: nowrap;
    background-color: transparent;
    border: 0;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

.nav-dropdown-item:hover,
.nav-dropdown-item:focus,
.nav-dropdown-item.active {
    background-color: var(--secondary-color);
    color: var(--text-color);
    text-decoration: none;
}

/* Mobile Menu */
.mobile-menu-button {
    display: block;
    background: none;
    border: none;
    color: var(--text-color);
    padding: 0.5rem;
    cursor: pointer;
    transition: opacity var(--transition-speed);
    margin-left: auto;
    z-index: 51;
}

.mobile-menu-button:hover {
    opacity: 0.8;
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 4rem;
    left: 0;
    right: 0;
    background: #0D0C1D !important;
    backdrop-filter: blur(12px);
    padding: 1rem 0;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    transform: translateY(-100%);
    transition: transform var(--transition-speed) ease-out;
    z-index: 49;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.mobile-menu.active {
    transform: translateY(0);
    display: block;
}

.mobile-menu .nav-link:not(.sub-link),
.mobile-menu .mobile-submenu-toggle {
    display: block;
    padding: 0.9rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-decoration: none;
    font-size: 1rem;
    width: 100%;
    box-sizing: border-box;
    color: var(--text-color);
}

.mobile-submenu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-submenu {
    background-color: rgba(0, 0, 0, 0.1);
    padding-left: 0;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease-out;
}

.mobile-submenu .sub-link {
    display: block;
    padding: 0.75rem 1.5rem 0.75rem 2.5rem;
    text-align: left;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-decoration: none;
}

.mobile-menu .auth-buttons-mobile {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1.5rem 1.5rem 1rem;
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 0.75rem;
}

.mobile-menu .button {
    width: 100%;
    padding: 0.75rem 0.5rem;
    font-size: 1rem;
}

.mobile-menu .button-primary {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.mobile-menu .button-outline {
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: transparent;
}

/* Logo Styling */
.nav-logo-link {
    display: inline-flex;
    align-items: center;
    height: 100%;
    padding: 0.25rem 0;
    margin-right: 1rem;
}

.nav-logo-img {
    height: 2.5rem;
    width: auto;
    max-height: calc(100% - 0.5rem);
    transition: height var(--transition-speed) ease;
    display: block;
}

/* General Buttons */
.button {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: all var(--transition-speed);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.button-primary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-color);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.button-primary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.button-outline {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-color);
}

.button-outline:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.copy-success {
    background: rgba(34, 197, 94, 0.15) !important;
    border-color: rgba(34, 197, 94, 0.3) !important;
}

.copy-error {
    background: rgba(239, 68, 68, 0.15) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
}

/* Banner */
.banner-container {
    width: 100%;
    background: #0D0C1D !important;
    position: relative;
    overflow: hidden;
    z-index: 60;
}

.banner-content {
    margin: 0 auto;
    position: relative;
    z-index: 10;
}

.banner-link {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.75rem;
    text-decoration: none;
    color: var(--text-color);
    background: var(--glass-background);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    font-size: 0.875rem;
    transition: opacity 0.3s ease;
}

.banner-link:hover {
    opacity: 0.9;
    color: var(--text-color);
}

/* Footer */
.footer {
    background: var(--glass-background);
    backdrop-filter: blur(10px);
    padding: 4rem 0 0;
    margin-top: 4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 4rem;
}

.footer-section h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.footer-description {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition-speed);
}

.footer-links a:hover {
    color: var(--text-color);
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-color);
    transition: all var(--transition-speed);
}

.social-link:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
    color: var(--text-color);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem 0;
    margin-top: 2rem;
}

.footer-bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-bottom p {
    margin: 0;
    color: var(--text-muted);
}

.footer-bottom-links {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.footer-bottom-links a,
.footer-bottom-links button {
    color: var(--text-muted);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-size: inherit;
    transition: color var(--transition-speed);
}

.footer-bottom-links a:hover,
.footer-bottom-links button:hover {
    color: var(--text-color);
}

/* Unicode Detection Toggle */
.unicode-detection-toggle {
    margin-bottom: 1rem;
}

.toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.toggle-switch input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    position: relative;
    width: 48px;
    height: 24px;
    background: var(--glass-background);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    transition: all 0.3s ease;
    margin-right: 0.75rem;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 2px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--primary-gradient);
    border-color: var(--primary-color);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(24px);
    background: white;
}

.toggle-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    vertical-align: middle;
}

.toggle-switch input:checked ~ .toggle-label {
    color: white;
}

/* Live Unicode Stats */
.unicode-live-stats {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: rgba(79, 70, 229, 0.1);
    border: 1px solid rgba(79, 70, 229, 0.3);
    border-radius: 0.5rem;
    animation: slideDown 0.3s ease-out;
}

.unicode-live-stats .stats-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.5rem;
    background: var(--glass-background);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.stat-badge.active {
    background: rgba(79, 70, 229, 0.2);
    border-color: var(--primary-color);
    color: var(--text-primary);
    transform: scale(1.05);
}

.stat-badge i {
    font-size: 0.7rem;
    opacity: 0.8;
}

.stat-badge strong {
    color: var(--text-primary);
}

/* Editor overlay for in-place Unicode highlighting */
.editor-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1;
    height: 100%;
    min-height: 0;   /* important for flex children to shrink */
    overflow: hidden;
}



/* The ghost overlay sits behind the textarea and mirrors its text */
.input-highlight {
    position: absolute;
    inset: 0;
    overflow: auto;             /* mirrors textarea scroll */
    pointer-events: auto;       /* allow hover tooltips */
    color: var(--text-primary);
    visibility: hidden;         /* only visible when toggle ON */
    background: transparent;    /* no “second box” look */
    border: none;
    /* EXACT text layout match with textarea */
    white-space: break-spaces;  /* preserves spaces + trailing spaces */
    word-break: normal;
    overflow-wrap: break-word;  /* long words can still wrap */
    z-index: 2;
}



/* When toggled ON, make the textarea text transparent but keep caret visible */
.editor-wrap.unicode-on .text-input,
.editor-wrap.unicode-on #input-text {
    color: transparent !important;
    background: transparent !important;
    caret-color: var(--text-primary) !important;
}

/* Show overlay only when ON */
.editor-wrap.unicode-on .input-highlight {
    visibility: visible;
}


.input-highlight .uc.hidden-char {
    display: inline-block;
    width: 0;
    overflow: visible;
}
.input-highlight .uc.hidden-char::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.2em;
    bottom: 0.2em;
    width: 0.55em;
    background: rgba(239, 68, 68, 0.45);
    box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.7);
    border-radius: 3px;
    pointer-events: none;
    transform: translateX(-50%);
}

/* Visible-width characters: background + inset border (no padding/border) */
.input-highlight .uc.space-char {
    background: rgba(59, 130, 246, 0.28);
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.55);
    border-radius: 3px;
}
.input-highlight .uc.quote-char {
    background: rgba(168, 85, 247, 0.28);
    box-shadow: inset 0 0 0 1px rgba(168, 85, 247, 0.55);
    border-radius: 3px;
}
.input-highlight .uc.dash-char {
    background: rgba(251, 146, 60, 0.28);
    box-shadow: inset 0 0 0 1px rgba(251, 146, 60, 0.55);
    border-radius: 3px;
}
.input-highlight .uc.other-char {
    background: rgba(34, 197, 94, 0.28);
    box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.55);
    border-radius: 3px;
}

.input-highlight .uc {
    position: relative;
    display: inline;                 /* no inline-block width quirks */
    cursor: help;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.input-highlight .uc:hover {
    z-index: 10001;
}

.input-highlight .uc::after {
    content: attr(data-code);
    position: fixed; /* ESCAPES parent overflow */
    top: auto;
    bottom: auto;
    left: auto;
    transform: none;
    background: rgba(20, 20, 30, 0.95);
    color: var(--text-primary);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-family: 'Monaco', 'Courier New', monospace;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 99999;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Reposition dynamically on hover (uses --mouse-x / --mouse-y set in JS) */
.input-highlight .uc:hover::after {
    opacity: 1;
    visibility: visible;
    
}


/* Unicode Removal Alert */
.unicode-removal-alert {
    margin-top: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.08));
    border: 1px solid rgba(16, 185, 129, 0.4);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
    border-radius: 0.5rem;
    animation: slideDown 0.3s ease-out;
}

.unicode-removal-alert .removal-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    color: var(--success-color);
    font-weight: 600;
    font-size: 0.95rem;
}

.removal-header i {
    font-size: 1.25rem;
}

.removal-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.removal-count {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.unicode-removal-alert .removal-count strong {
    font-size: 1.25rem;
    color: var(--success-color);
}

.removal-breakdown {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.removal-item {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.25rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.removal-item i {
    font-size: 0.7rem;
    opacity: 0.7;
}

/* Unicode removal notification */
.unicode-removed-notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--glass-background);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    animation: slideInRight 0.3s ease-out;
    max-width: 400px;
}

.unicode-removed-notification h5 {
    color: var(--primary-color);
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
}

.unicode-removed-notification .removal-stats {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes highlightPulse {
    0% {
        transform: scale(1);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

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

/* Loading Animation */
.fa-spinner.fa-spin {
    animation: spin 1s linear infinite;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: var(--glass-background-hover);
    border-radius: 5px;
    border: 1px solid var(--border-color);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Focus Styles */
*:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

button:focus,
.btn-primary:focus,
.btn-secondary:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .app-layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .sidebar-nav {
        max-height: 400px;
    }
    
    .io-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .content-area {
        padding: 1rem;
    }
    
    .tab-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tab-button {
        padding: 0.75rem;
    }
    
    .tab-icon {
        margin-right: 0.5rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .content-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.75rem;
    }
    
    .app-layout {
        border-radius: 0;
    }
    
    .tab-list {
        grid-template-columns: 1fr;
    }
    
    .panel-header h3 {
        font-size: 1rem;
    }
    
    .text-input,
    .text-output {
        font-size: 0.9rem;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .sidebar,
    .content-header,
    .panel-footer,
    .hero-section,
    .seo-content {
        display: none;
    }
    
    .main-content {
        width: 100%;
    }
    
    .text-output {
        border: 1px solid #ccc;
        background: white;
    }
}

/* Touch devices: don't show hover tooltips (taps should focus the input) */
@media (hover: none) and (pointer: coarse) {
    .input-highlight .uc::after { display: none; }
}

/* Tablets and below */
@media (max-width: 768px) {
    .content-area { padding: 0.75rem; }
    .panel-body { padding: 1rem; }

    /* So the editor doesn't dominate the viewport */
    .editor-wrap { min-height: 220px; }
    .text-output { min-height: 220px; }

    /* Live stats readability + wrapping */
    .unicode-live-stats .stats-row { gap: 0.5rem; }
    .stat-badge { font-size: 0.75rem; padding: 0.2rem 0.45rem; }
}

/* Small phones */
@media (max-width: 480px) {
    .app-layout { border-radius: 0; }

    /* Tighter typography to fit more text on screen */
    .text-input,
    .text-output { font-size: 0.9rem; line-height: 1.6; }

    .editor-wrap { min-height: 180px; }
    .text-output { min-height: 180px; }

    /* Buttons: full width stacking already handled; just add a little breathing room */
    .panel-footer { padding: 1rem; }
}

/* Plan/usage badge */
.plan-badge {
    display: inline-flex;
    align-items: center;
    
    margin-left: 0.5rem;
    
    font-weight: 600;
    border-radius: 9999px;
    background: #c9ac0e!important;
    border: 1px solid var(--border-color, rgba(0,0,0,0.1))!important;
    
    backdrop-filter: blur(8px)!important;
    white-space: nowrap!important;
        padding: 0.25rem 0.75rem!important;
    
    color: white!important;
    font-size: 0.75rem!important;
    font-weight: 600!important;
}
.usage-counter {
    display: inline-block;
    margin-left: 8px;
    opacity: 0.85;
    font-weight: 600;
}

/* Desktop breakpoint: show full nav / hide mobile toggle */
@media (min-width: 1025px) {
  .nav-links {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: 1rem;
  }

  .auth-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
  }

  .mobile-menu-button {
    display: none;
  }

  /* Ensure the slide-down mobile panel never shows on desktop */
  .mobile-menu {
    display: none !important;
    transform: none !important;
  }
}
.profile-icon, .submit-icon {
    padding: 10px!important;
}

.profile-menu.show {
    background: #0D0C1D !important;
}
@media (max-width: 768px) {
  :root { --io-body-height: clamp(220px, 38vh, 420px); }
}
@media (max-width: 480px) {
  :root { --io-body-height: clamp(180px, 40vh, 360px); }
}
/* === Modals: CTA polish (NEW) === */
.modal-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.limit-chip, .plan-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    font-size: 0.875rem;
    color: var(--text-primary);
}
/* === Upgrade / Gate Modal Polish (NEW) === */

/* Backdrop feel (your .modal likely already sets display/position) */
.modal.show {
    backdrop-filter: blur(4px);
}

/* Card styling */
.modal .modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow:
        0 20px 60px rgba(0,0,0,0.55),
        inset 0 1px 0 rgba(255,255,255,0.06);
    overflow: hidden;
}

/* Header */
.modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.modal .modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.2px;
}

.modal .modal-title i {
    font-size: 1.05em;
    opacity: 0.9;
}

/* Close button */
.modal .btn-icon {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.12);
    width: 34px;
    height: 34px;
    border-radius: 10px;
    color: var(--text-primary);
    display: grid;
    place-items: center;
    line-height: 1;
    cursor: pointer;
}
.modal .btn-icon:hover {
    background: rgba(255,255,255,0.06);
}

/* Body */
.modal .modal-body {
    padding: 18px 20px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.modal .modal-body p {
    margin: 0 0 14px 0;
}

/* Pill showing used/limit */
.limit-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.15);
    font-size: 0.9rem;
    color: var(--text-primary);
}

.modal-features {
    margin-top: 8px;
}

.modal-features ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    row-gap: 12px;               /* a little more breathing room */
}

.modal-features li {
    display: grid;
    grid-template-columns: 60px 1fr;  /* slightly wider tick column */
    align-items: start;
    column-gap: 12px;
    color: var(--text-secondary);
    line-height: 1.5;                 /* <<< prevents any line overlap */
    word-break: normal;
    overflow-wrap: anywhere;          /* safe wrapping if narrow */
}

/* ensure the plan name never visually merges with following text */
.modal-features li strong {
    display: inline-block;            /* creates a clean spacing box */
    margin-right: 0.35rem;            /* visible gap before “for …” */
    color: var(--text-primary);
    font-weight: 700;
}

.modal-features li::before {
    content: "✓";
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    line-height: 22px;
    text-align: center;
    border-radius: 6px;
    border: 1px solid rgba(46, 204, 113, 0.5);
    background: rgba(46, 204, 113, 0.12);
    color: #2ecc71;
    font-weight: 700;
    transform: translateY(2px);       /* aligns tick with text top line */
}

/* Footer */
.modal .modal-footer {
    padding: 14px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
    background: linear-gradient(to bottom, rgba(255,255,255,0.03), rgba(255,255,255,0.02));
}

.modal-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* Buttons inside modals inherit your existing .button styles: add subtle tweaks */
.modal .button-primary {
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}
.modal .button-outline {
    background: transparent;
}

/* Responsive width (optional if your modal system already sets a width) */
#app-modal-shell .modal-content {
    max-width: 560px;
    width: calc(100vw - 40px);
    margin: 10vh auto;
}
