﻿/* ==========================================================================
   Word to HTML Converter - Premium Tabbed CSS Styling
   Author: WebVK
   ========================================================================== */

/* --- Design Tokens & Variables --- */
:root {
    /* Fonts */
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'Fira Code', 'Courier New', Courier, monospace;

    /* Light Theme Palette */
    --bg-app: #f1f5f9;
    --bg-surface: #ffffff;
    --bg-surface-alt: #f8fafc;
    --bg-header: rgba(255, 255, 255, 0.85);
    
    --border-color: #cbd5e1;
    --border-color-hover: #94a3b8;
    --border-color-focus: #175d69;
    
    --text-main: #1e293b;
    --text-muted: #475569;
    --text-light: #64748b;
    
    /* Branding specific colors */
    --teal-brand: #175d69;
    --teal-brand-dark: #0e454f;
    --teal-brand-light: #e0f2f1;
    --yellow-brand: #f7c04a;
    --yellow-brand-light: #ffd87d;
    --yellow-toolbar: #fbe6b5;
    
    --primary: #175d69;
    --primary-hover: #0e454f;
    --primary-light: #e0f2f1;
    
    --accent: #f7c04a;
    --accent-hover: #e0a82e;
    --accent-light: #fef3c7;
    
    --success: #10b981;
    --success-hover: #059669;
    --success-light: #d1fae5;
    
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --danger-light: #fee2e2;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
    --shadow-glow: 0 0 20px rgba(23, 93, 105, 0.15);
    
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    --transition-fast: 0.12s ease;
    --transition-normal: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Theme Palette Override */
[data-theme="dark"] {
    --bg-app: #080d12;
    --bg-surface: #0f1821;
    --bg-surface-alt: #16222f;
    --bg-header: rgba(15, 24, 33, 0.85);
    
    --border-color: #273b4d;
    --border-color-hover: #3d566e;
    --border-color-focus: #38bdf8;
    
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --text-light: #64748b;
    
    --teal-brand: #0f4049;
    --teal-brand-dark: #07252b;
    --teal-brand-light: #162d33;
    --yellow-brand: #d99c1c;
    --yellow-brand-light: #aa7608;
    --yellow-toolbar: #2f2510;
    
    --primary: #38bdf8;
    --primary-hover: #0ea5e9;
    --primary-light: #0c4a6e;
    
    --accent: #ffd87d;
    --accent-hover: #f7c04a;
    --accent-light: #78350f;
    
    --success: #34d399;
    --success-hover: #059669;
    --success-light: #064e3b;
    
    --danger: #f87171;
    --danger-hover: #ef4444;
    --danger-light: #7f1d1d;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4), 0 2px 4px -1px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 25px rgba(56, 189, 248, 0.2);
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-app);
    color: var(--text-main);
    line-height: 1.6;
    transition: background-color var(--transition-normal), color var(--transition-normal);
    min-height: 100vh;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--border-color-hover);
}

/* --- Layout --- */
.app-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- Header --- */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 0;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background-color: var(--bg-header);
    backdrop-filter: blur(12px);
    z-index: 100;
    transition: border-color var(--transition-normal);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-links {
    display: flex;
    gap: 10px;
}

.nav-item-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}
.nav-item-link:hover {
    color: var(--text-main);
    border-color: var(--border-color-hover);
    background-color: var(--bg-surface-alt);
}

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

.brand-badge {
    background: linear-gradient(135deg, var(--teal-brand), var(--yellow-brand));
    color: #ffffff;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    padding: 4px 12px;
    border-radius: 50px;
    box-shadow: var(--shadow-sm);
    font-family: var(--font-heading);
}

.brand-logo {
    height: 52px;
    width: auto;
    border-radius: var(--radius-sm);
    display: block;
    background-color: #ffffff;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    padding: 1px;
}

.app-title {
    font-family: var(--font-heading);
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--text-main);
}

.gradient-text {
    background: linear-gradient(90deg, var(--teal-brand), var(--yellow-brand));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--transition-fast);
    gap: 8px;
    outline: none;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.82rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 14px 28px;
    font-size: 0.98rem;
    border-radius: var(--radius-lg);
}

.btn-primary {
    background-color: var(--teal-brand);
    color: #ffffff;
}
.btn-primary:hover {
    background-color: var(--teal-brand-dark);
    transform: translateY(-1px);
}
.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background-color: var(--bg-surface-alt);
    border-color: var(--border-color);
    color: var(--text-main);
}
.btn-secondary:hover {
    background-color: var(--border-color);
    border-color: var(--border-color-hover);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    border-color: var(--border-color);
    background-color: var(--bg-surface);
    color: var(--text-muted);
}
.btn-icon:hover {
    color: var(--text-main);
    border-color: var(--border-color-hover);
}

/* --- Drag & Drop Area --- */
.upload-banner {
    background-color: var(--bg-surface);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    margin: 20px 0;
    padding: 22px;
    cursor: pointer;
    transition: all var(--transition-normal);
}
.upload-banner:hover, .upload-banner.dragover {
    border-color: var(--teal-brand);
    background-color: var(--primary-light);
}

.upload-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.upload-icon {
    width: 42px;
    height: 42px;
    color: var(--teal-brand);
    background-color: var(--primary-light);
    padding: 10px;
    border-radius: 50%;
    transition: transform var(--transition-normal);
}
.upload-banner:hover .upload-icon {
    transform: translateY(-2px);
}

.upload-text h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
}
.upload-text p {
    font-size: 0.88rem;
    color: var(--text-muted);
}
.browse-link {
    color: var(--teal-brand);
    text-decoration: underline;
    font-weight: 600;
}
.file-limits {
    display: block;
    font-size: 0.72rem;
    color: var(--text-light);
    margin-top: 1px;
}

/* --- Tabbed Editor Frame --- */
.editor-card-container {
    background-color: var(--teal-brand);
    padding: 14px 14px 14px 14px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
}

[data-theme="dark"] .editor-card-container {
    background-color: var(--bg-surface-alt);
    border: 1px solid var(--border-color);
}

/* Header bar inside teal container */
.editor-header-tabs {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 0px;
    padding-left: 8px;
}

.editor-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    padding-bottom: 12px;
}
.header-decor-icon {
    width: 18px;
    height: 18px;
    color: var(--yellow-brand);
}

.editor-tabs {
    display: flex;
    gap: 4px;
}

.editor-tab {
    border: none;
    outline: none;
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    padding: 8px 32px;
    cursor: pointer;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    transition: all var(--transition-fast);
}

/* Word tab: Yellow / Orange theme */
#tab-word {
    background-color: var(--teal-brand-dark);
    color: rgba(255, 255, 255, 0.7);
}
#tab-word.active {
    background-color: var(--yellow-brand);
    color: #000000;
}

/* HTML tab: Dark Teal theme */
#tab-html {
    background-color: var(--teal-brand-dark);
    color: rgba(255, 255, 255, 0.7);
}
#tab-html.active {
    background-color: #ffffff;
    color: var(--teal-brand);
}
[data-theme="dark"] #tab-html.active {
    background-color: var(--bg-surface);
    color: var(--text-main);
}

/* Tab Hover */
.editor-tab:not(.active):hover {
    background-color: var(--teal-brand-light);
    color: var(--teal-brand);
}

/* Main white editor card container */
.editor-card {
    background-color: var(--bg-surface);
    border-radius: var(--radius-md) 0 var(--radius-md) var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 620px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0,0,0,0.05);
}

/* Menu Bar */
.editor-menu-bar {
    display: flex;
    background-color: var(--bg-surface-alt);
    border-bottom: 1px solid var(--border-color);
    padding: 4px 10px;
    z-index: 200;
}

.menu-item {
    position: relative;
}

.menu-trigger {
    background: transparent;
    border: none;
    outline: none;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 6px 14px;
    cursor: pointer;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 4px;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}
.menu-trigger:hover, .menu-item.active .menu-trigger {
    background-color: var(--border-color);
}
.menu-trigger i {
    width: 10px;
    height: 10px;
    color: var(--text-muted);
}

/* Dropdown Menu contents */
.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-md);
    min-width: 200px;
    padding: 6px 0;
    z-index: 500;
    animation: menu-pop-in 0.15s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes menu-pop-in {
    from {
        transform: translateY(4px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.menu-item.active .dropdown-content {
    display: block;
}

.dropdown-content button {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    text-align: left;
    padding: 8px 16px;
    font-family: var(--font-body);
    font-size: 0.88rem;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background var(--transition-fast);
}

.dropdown-content button:hover {
    background-color: var(--bg-surface-alt);
    color: var(--teal-brand);
}
[data-theme="dark"] .dropdown-content button:hover {
    color: var(--primary);
}

.dropdown-content button i {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
}

.dropdown-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 4px 0;
}

.active-check {
    position: relative;
}
.check-icon {
    width: 14px;
    height: 14px;
    position: absolute;
    right: 12px;
    color: var(--success) !important;
}

/* Toolbar customization to yellow-orange */
.editor-toolbar {
    background-color: var(--yellow-toolbar);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 8px 14px;
    gap: 4px;
    transition: background-color var(--transition-normal);
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 2px;
}

.toolbar-divider {
    width: 1px;
    height: 18px;
    background-color: rgba(0,0,0,0.15);
    margin: 0 6px;
}

[data-theme="dark"] .toolbar-divider {
    background-color: var(--border-color);
}

/* Toolbar buttons styled like wordhtml.com icons */
.tb-btn {
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-main);
    transition: all var(--transition-fast);
    outline: none;
}
.tb-btn:hover {
    background-color: rgba(0,0,0,0.06);
    border-color: rgba(0,0,0,0.12);
}
.tb-btn.active {
    background-color: rgba(0,0,0,0.12);
    border-color: rgba(0,0,0,0.18);
}
[data-theme="dark"] .tb-btn {
    color: var(--text-main);
}
[data-theme="dark"] .tb-btn:hover {
    background-color: rgba(255,255,255,0.06);
    border-color: var(--border-color);
}
.tb-btn i {
    width: 16px;
    height: 16px;
}

.tb-btn-text {
    background: rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: var(--radius-sm);
    padding: 4px 10px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
    gap: 6px;
}
.tb-btn-text:hover {
    background-color: rgba(0,0,0,0.08);
}

.tb-select {
    height: 30px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(0,0,0,0.12);
    padding: 0 6px;
    font-family: var(--font-body);
    font-size: 0.82rem;
    background-color: var(--bg-surface);
    color: var(--text-main);
    outline: none;
    cursor: pointer;
}

/* Workspace stack body */
.editor-workspace-body {
    flex: 1;
    position: relative;
    overflow: hidden;
    background-color: var(--bg-surface);
}

.editor-view {
    display: none;
    height: 100%;
    width: 100%;
    overflow-y: auto;
}
.editor-view.active {
    display: block;
}

#visual-editor-view {
    padding: 16px 20px;
}

#visual-editor {
    height: 100%;
    outline: none;
    overflow-y: auto;
    font-family: var(--font-body);
    font-size: 0.98rem;
    color: var(--text-main);
    /* Document page design inside card */
    background-color: #ffffff;
}

#visual-editor[placeholder]:empty::before {
    content: attr(placeholder);
    color: var(--text-light);
    font-style: italic;
}

/* Styling document structures */
#visual-editor p { margin-bottom: 0.9rem; }
#visual-editor h1, #visual-editor h2, #visual-editor h3, #visual-editor h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-main);
    margin-top: 1.4rem;
    margin-bottom: 0.6rem;
}
#visual-editor h1 { font-size: 1.7rem; }
#visual-editor h2 { font-size: 1.4rem; }
#visual-editor h3 { font-size: 1.2rem; }

#visual-editor ul, #visual-editor ol {
    margin-bottom: 0.9rem;
    padding-left: 20px;
}
#visual-editor li { margin-bottom: 0.2rem; }

#visual-editor blockquote {
    border-left: 4px solid var(--teal-brand);
    padding: 8px 16px;
    margin: 1.2rem 0;
    background-color: var(--bg-surface-alt);
    font-style: italic;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

#visual-editor pre {
    background-color: var(--bg-surface-alt);
    padding: 12px;
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    border: 1px solid var(--border-color);
    margin: 0.9rem 0;
}

#visual-editor table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.2rem 0;
}
#visual-editor th, #visual-editor td {
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    text-align: left;
}
#visual-editor th {
    background-color: var(--bg-surface-alt);
    font-weight: 600;
}

#visual-editor a {
    color: var(--teal-brand);
    text-decoration: underline;
}

/* HTML Source Editor View */
#html-editor-view {
    background-color: #0d131a; /* Dark theme editor specifically */
}

.code-editor-container {
    display: flex;
    height: 100%;
    width: 100%;
    font-family: var(--font-mono);
}

.line-numbers {
    padding: 20px 0;
    width: 46px;
    text-align: right;
    color: #4b637a;
    font-size: 0.82rem;
    user-select: none;
    border-right: 1px solid #1a2736;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.line-numbers span {
    display: block;
    line-height: 1.6;
    padding-right: 12px;
}

#html-editor {
    flex: 1;
    height: 100%;
    background-color: transparent;
    border: none;
    outline: none;
    padding: 20px;
    color: #d1dcde;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    line-height: 1.6;
    resize: none;
    overflow-y: auto;
}

#html-editor.wrap-code {
    white-space: pre-wrap;
    word-break: break-all;
}
#html-editor:not(.wrap-code) {
    white-space: pre;
    word-wrap: normal;
}

/* Common Footer Stats Bar */
.editor-footer-stats {
    display: flex;
    justify-content: space-between;
    padding: 8px 16px;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-surface-alt);
    font-size: 0.78rem;
    color: var(--text-light);
    font-weight: 500;
}

.stats-left, .stats-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bullet {
    color: var(--border-color-hover);
}

/* --- Clean Up Dashboard --- */
.cleaning-dashboard, .find-replace-section, .seo-info-section {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 25px;
    margin-bottom: 25px;
}

.section-header-box {
    margin-bottom: 20px;
    position: relative;
    padding-left: 36px;
}
.section-icon {
    position: absolute;
    left: 0;
    top: 2px;
    width: 22px;
    height: 22px;
}

.section-header-box h2 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 2px;
}
.section-header-box p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Clean Cards Grid */
.clean-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 25px;
}

.clean-card {
    background-color: var(--bg-surface-alt);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
}

.clean-card h3 {
    font-family: var(--font-heading);
    font-size: 0.88rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 6px;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Custom Checkbox */
.custom-checkbox {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    user-select: none;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-main);
    gap: 8px;
}

.custom-checkbox input {
    display: none;
}

.checkbox-box {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color-hover);
    border-radius: 4px;
    display: inline-block;
    position: relative;
    flex-shrink: 0;
    margin-top: 2px;
    transition: all var(--transition-fast);
}

.custom-checkbox input:checked + .checkbox-box {
    background-color: var(--teal-brand);
    border-color: var(--teal-brand);
}

.checkbox-box::after {
    content: '';
    position: absolute;
    width: 3px;
    height: 7px;
    border: solid white;
    border-width: 0 2px 2px 0;
    top: 1px;
    left: 4px;
    transform: rotate(45deg) scale(0);
    transition: transform var(--transition-fast);
}

.custom-checkbox input:checked + .checkbox-box::after {
    transform: rotate(45deg) scale(1);
}

.custom-checkbox code {
    font-family: var(--font-mono);
    background-color: var(--border-color);
    padding: 1px 3px;
    border-radius: 3px;
    font-size: 0.72rem;
    color: var(--teal-brand);
}
[data-theme="dark"] .custom-checkbox code {
    color: var(--primary);
}

.clean-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* --- Find & Replace --- */
.find-replace-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    background-color: var(--bg-surface-alt);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
}

.fr-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.input-wrapper label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-light);
}

.input-wrapper input[type="text"],
.input-wrapper input[type="url"],
.input-wrapper input[type="number"] {
    height: 38px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0 12px;
    font-family: var(--font-body);
    font-size: 0.88rem;
    background-color: var(--bg-surface);
    color: var(--text-main);
    outline: none;
}
.input-wrapper input:focus {
    border-color: var(--teal-brand);
}

.fr-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
}

.fr-scope-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}
.scope-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-light);
}

/* Custom Radio */
.custom-radio {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    gap: 6px;
}
.custom-radio input {
    display: none;
}
.radio-circle {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color-hover);
    border-radius: 50%;
    display: inline-block;
    position: relative;
    transition: all var(--transition-fast);
}
.custom-radio input:checked + .radio-circle {
    border-color: var(--teal-brand);
}
.radio-circle::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background-color: var(--teal-brand);
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transform: scale(0);
    transition: transform var(--transition-fast);
}
.custom-radio input:checked + .radio-circle::after {
    transform: scale(1);
}

.fr-actions {
    display: flex;
    gap: 10px;
}
.fr-status {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--teal-brand);
    min-height: 18px;
}
[data-theme="dark"] .fr-status {
    color: var(--primary);
}

/* --- SEO & FAQ Section --- */
.info-layout {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 30px;
}

.info-guide h2 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 8px;
}
.info-guide > p {
    color: var(--text-muted);
    font-size: 0.92rem;
    margin-bottom: 20px;
}

.features-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.feature-item {
    display: flex;
    gap: 12px;
}

.feature-bullet {
    background-color: var(--primary-light);
    color: var(--teal-brand);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.feature-bullet i {
    width: 14px;
    height: 14px;
}

.feature-body h4 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 1px;
}
.feature-body p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.info-faqs h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 16px;
}

/* Accordion FAQs */
.accordion {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.accordion-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.accordion-trigger {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-surface-alt);
    border: none;
    outline: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    gap: 12px;
    transition: all var(--transition-fast);
}
.accordion-trigger:hover {
    background-color: var(--border-color);
}

.accordion-arrow {
    width: 16px;
    height: 16px;
    color: var(--text-light);
    transition: transform var(--transition-normal);
}
.accordion-item.active .accordion-arrow {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-normal);
    background-color: var(--bg-surface);
}

.accordion-content p {
    padding: 14px 18px;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
}

.accordion-item.active .accordion-content {
    max-height: 200px;
}

/* --- Footer --- */
.app-footer {
    border-top: 1px solid var(--border-color);
    padding: 20px 0;
    margin-top: auto;
    font-size: 0.85rem;
    color: var(--text-light);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-brand {
    font-weight: 700;
    color: var(--teal-brand);
    text-decoration: none;
}
.footer-brand:hover {
    text-decoration: underline;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 12px;
}
.footer-links a {
    color: var(--text-light);
    text-decoration: none;
}
.footer-links a:hover {
    color: var(--text-main);
    text-decoration: underline;
}

/* --- Modals --- */
.modal-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(9, 13, 22, 0.5);
    backdrop-filter: blur(3px);
    z-index: 1000;
}

.modal-box {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 420px;
    z-index: 1001;
    overflow: hidden;
    transition: transform var(--transition-normal);
}

.modal-box.active {
    display: block;
    animation: modal-in 0.22s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes modal-in {
    to { transform: translate(-50%, -50%) scale(1); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
}
.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
}
.modal-close {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-light);
}
.modal-close:hover {
    color: var(--text-main);
}
.modal-close i {
    width: 18px;
    height: 18px;
}

.modal-body {
    padding: 18px;
}

.grid-2-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 18px;
    background-color: var(--bg-surface-alt);
    border-top: 1px solid var(--border-color);
}

/* --- Toast Alerts --- */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 2000;
}

.toast {
    background-color: var(--bg-surface);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-md);
    padding: 12px 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    animation: toast-slide-in 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    min-width: 220px;
}

.toast-success { border-left: 4px solid var(--success); }
.toast-success i { color: var(--success); }

.toast-info { border-left: 4px solid var(--teal-brand); }
.toast-info i { color: var(--teal-brand); }
[data-theme="dark"] .toast-info i { color: var(--primary); }

.toast-danger { border-left: 4px solid var(--danger); }
.toast-danger i { color: var(--danger); }

@keyframes toast-slide-in {
    from {
        transform: translateY(15px) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.toast-fade-out {
    animation: toast-slide-out 0.22s ease forwards;
}

@keyframes toast-slide-out {
    to {
        transform: translateY(8px);
        opacity: 0;
    }
}

/* --- Responsive adjustments --- */
@media (max-width: 1024px) {
    .editor-card {
        height: 520px;
    }
    .clean-grid {
        grid-template-columns: 1fr 1fr;
    }
    .info-layout {
        grid-template-columns: 1fr;
        gap: 25px;
    }
}

@media (max-width: 768px) {
    .app-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
        padding: 12px 0;
    }
    .header-actions {
        width: 100%;
        display: flex;
        justify-content: flex-end;
    }
    .editor-header-tabs {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .editor-tabs {
        width: 100%;
    }
    .editor-tab {
        flex: 1;
        text-align: center;
        padding: 6px 10px;
    }
    .editor-card {
        border-radius: 0 0 var(--radius-md) var(--radius-md);
    }
    .editor-menu-bar {
        flex-wrap: wrap;
    }
    .menu-trigger {
        padding: 4px 8px;
        font-size: 0.8rem;
    }
    .upload-inner {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    .clean-grid {
        grid-template-columns: 1fr;
    }
    .fr-inputs {
        grid-template-columns: 1fr;
    }
    .fr-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .fr-scope-group {
        margin-left: 0;
    }
    .footer-content {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}

/* Nav dropdown styles added */
.nav-dropdown {
    position: relative;
    display: inline-block;
}
.btn-dropdown {
    display: flex;
    align-items: center;
    gap: 6px;
}
.dropdown-chevron {
    width: 14px;
    height: 14px;
}
.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    width: 200px;
    max-height: 280px;
    overflow-y: auto;
    z-index: 500;
}
.dropdown-item-link {
    color: var(--text-muted);
    text-decoration: none;
    display: block;
    padding: 10px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all var(--transition-fast);
}
.dropdown-item-link:hover {
    color: var(--text-main);
    background-color: var(--bg-surface-alt);
}
.nav-dropdown:hover .dropdown-menu {
    display: block;
}
