/* ═══════════════════════════════════════════════════
   AtaWeb Browser - Complete CSS Design System
   ═══════════════════════════════════════════════════ */

/* ── Theme Variables ── */
:root, [data-theme="dark"] {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-tertiary: #0f3460;
    --bg-surface: #1c1c2e;
    --bg-hover: rgba(255,255,255,0.06);
    --bg-active: rgba(255,255,255,0.1);
    --text-primary: #e8e8f0;
    --text-secondary: #9aa0b8;
    --text-muted: #6b7094;
    --accent: #6c63ff;
    --accent-hover: #8b83ff;
    --accent-glow: rgba(108,99,255,0.3);
    --border: rgba(255,255,255,0.08);
    --border-strong: rgba(255,255,255,0.15);
    --success: #00d68f;
    --danger: #ff5252;
    --warning: #ffb74d;
    --info: #56ccf2;
    --tab-bg: rgba(255,255,255,0.04);
    --tab-active: rgba(108,99,255,0.15);
    --radius: 8px;
    --radius-lg: 14px;
    --shadow: 0 8px 32px rgba(0,0,0,0.3);
    --glass: rgba(255,255,255,0.05);
    --glass-border: rgba(255,255,255,0.1);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

[data-theme="light"] {
    --bg-primary: #f5f5fa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #eef0f7;
    --bg-surface: #ffffff;
    --bg-hover: rgba(0,0,0,0.04);
    --bg-active: rgba(0,0,0,0.08);
    --text-primary: #1a1a2e;
    --text-secondary: #555577;
    --text-muted: #8888aa;
    --accent: #6c63ff;
    --accent-hover: #5a52e0;
    --border: rgba(0,0,0,0.08);
    --border-strong: rgba(0,0,0,0.15);
    --tab-bg: rgba(0,0,0,0.03);
    --tab-active: rgba(108,99,255,0.12);
    --glass: rgba(255,255,255,0.7);
    --glass-border: rgba(0,0,0,0.1);
    --shadow: 0 8px 32px rgba(0,0,0,0.1);
}

[data-theme="midnight"] {
    --bg-primary: #0d0d0d;
    --bg-secondary: #111111;
    --bg-tertiary: #1a1a1a;
    --bg-surface: #151515;
    --accent: #00d68f;
    --accent-hover: #00f0a0;
    --accent-glow: rgba(0,214,143,0.3);
    --tab-active: rgba(0,214,143,0.15);
}

[data-theme="ocean"] {
    --bg-primary: #0a192f;
    --bg-secondary: #112240;
    --bg-tertiary: #1d3557;
    --bg-surface: #0e1e36;
    --accent: #56ccf2;
    --accent-hover: #7fddff;
    --accent-glow: rgba(86,204,242,0.3);
    --tab-active: rgba(86,204,242,0.15);
}

[data-theme="rose"] {
    --bg-primary: #1a1020;
    --bg-secondary: #221530;
    --bg-tertiary: #2d1b3d;
    --bg-surface: #1e1228;
    --accent: #f472b6;
    --accent-hover: #f9a8d4;
    --accent-glow: rgba(244,114,182,0.3);
    --tab-active: rgba(244,114,182,0.15);
}

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

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* ── Browser Shell ── */
#browser-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
}

/* ── Tab Bar ── */
#tab-bar {
    display: flex;
    align-items: center;
    height: 40px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 0 8px;
    gap: 2px;
    -webkit-app-region: drag;
    user-select: none;
}

#tabs-container {
    display: flex;
    align-items: flex-end;
    height: 100%;
    gap: 2px;
    overflow-x: auto;
    flex: 1;
    scrollbar-width: none;
}
#tabs-container::-webkit-scrollbar { display: none; }

.tab {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 12px 0 14px;
    background: var(--tab-bg);
    border-radius: 10px 10px 0 0;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-secondary);
    min-width: 120px;
    max-width: 220px;
    transition: all 0.15s ease;
    position: relative;
    border: 1px solid transparent;
    border-bottom: none;
    white-space: nowrap;
    overflow: hidden;
    -webkit-app-region: no-drag;
}
.tab:hover { background: var(--bg-hover); color: var(--text-primary); }
.tab.active {
    background: var(--tab-active);
    color: var(--text-primary);
    border-color: var(--border);
}
.tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
}
.tab.pinned { min-width: 40px; max-width: 40px; padding: 0; justify-content: center; }
.tab.pinned .tab-title, .tab.pinned .tab-close { display: none; }
.tab.incognito { border-top: 2px solid var(--danger); }

.tab-favicon { width: 16px; height: 16px; flex-shrink: 0; border-radius: 3px; }
.tab-title { flex: 1; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.tab-close {
    width: 18px; height: 18px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; opacity: 0; transition: 0.15s;
    background: none; border: none; color: var(--text-muted); cursor: pointer;
}
.tab:hover .tab-close { opacity: 1; }
.tab-close:hover { background: var(--danger); color: white; }

.tab-bar-spacer { flex: 1; }

#new-tab-btn, .tb-action {
    -webkit-app-region: no-drag;
    width: 30px; height: 30px; border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    background: none; border: none; color: var(--text-secondary);
    cursor: pointer; font-size: 14px; transition: 0.15s;
}
#new-tab-btn:hover, .tb-action:hover { background: var(--bg-hover); color: var(--accent); }

/* ── Navigation Bar ── */
#nav-bar {
    display: flex;
    align-items: center;
    padding: 6px 10px;
    gap: 6px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.nav-left, .nav-right { display: flex; gap: 4px; }

.nav-btn {
    width: 32px; height: 32px; border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    background: none; border: none; color: var(--text-secondary);
    cursor: pointer; font-size: 14px; transition: 0.15s;
}
.nav-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-btn.active { color: var(--accent); background: var(--accent-glow); }

.nav-center { flex: 1; position: relative; max-width: 800px; margin: 0 auto; }

.address-bar-wrapper {
    display: flex; align-items: center; height: 36px;
    background: var(--bg-primary); border: 1px solid var(--border);
    border-radius: 20px; padding: 0 12px; gap: 8px;
    transition: 0.25s;
}
.address-bar-wrapper:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.address-icon { font-size: 13px; color: var(--success); }

#address-bar {
    flex: 1; height: 100%; background: none; border: none;
    color: var(--text-primary); font-size: 14px;
    font-family: var(--font); outline: none;
}
#address-bar::placeholder { color: var(--text-muted); }

.addr-action {
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; font-size: 14px; transition: 0.15s; padding: 4px;
}
.addr-action:hover { color: var(--warning); }
.addr-action.bookmarked { color: var(--warning); }
.addr-action.bookmarked i { font-weight: 900; }

/* Suggestions */
.suggestions-box {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0;
    background: var(--bg-surface); border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg); box-shadow: var(--shadow);
    z-index: 200; max-height: 380px; overflow-y: auto;
    padding: 6px;
}
.suggestions-box.hidden { display: none; }

.sugg-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px; border-radius: var(--radius);
    cursor: pointer; transition: 0.1s; color: var(--text-primary);
}
.sugg-item:hover { background: var(--bg-hover); }
.sugg-item i { width: 18px; color: var(--text-muted); font-size: 13px; }
.sugg-item .sugg-label { flex: 1; font-size: 14px; }
.sugg-item .sugg-type { font-size: 11px; color: var(--text-muted); }

/* ── Bookmarks Bar ── */
#bookmarks-bar {
    display: flex; align-items: center;
    height: 30px; padding: 0 10px;
    background: var(--bg-secondary); border-bottom: 1px solid var(--border);
    overflow-x: auto; gap: 4px;
    scrollbar-width: none;
}
#bookmarks-bar::-webkit-scrollbar { display: none; }

.bm-item {
    display: flex; align-items: center; gap: 6px;
    padding: 3px 10px; border-radius: 6px; font-size: 12px;
    color: var(--text-secondary); cursor: pointer; white-space: nowrap;
    transition: 0.15s; text-decoration: none;
}
.bm-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.bm-item i { font-size: 11px; }

/* ── Content Area ── */
#content-area {
    flex: 1;
    overflow: hidden;
    position: relative;
    background: var(--bg-primary);
}

/* ── New Tab Page ── */
.new-tab-page {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    height: 100%; gap: 30px;
    padding: 40px;
    animation: fadeUp 0.4s ease;
}

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

.ntp-logo { width: 80px; height: 80px; border-radius: 16px; }
.ntp-title { font-size: 2.5rem; font-weight: 800; letter-spacing: -1px; }

.ntp-search-box {
    width: 100%; max-width: 620px;
    display: flex; align-items: center;
    background: var(--bg-surface); border: 1px solid var(--border-strong);
    border-radius: 28px; padding: 0 20px; height: 52px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    transition: 0.3s;
}
.ntp-search-box:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow), 0 8px 24px rgba(0,0,0,0.2);
}
.ntp-search-box i { color: var(--text-muted); font-size: 16px; margin-right: 14px; }
.ntp-search-box select {
    background: transparent; border: none; color: var(--text-secondary);
    font-size: 13px; font-family: inherit; outline: none; cursor: pointer;
    margin-right: 12px; padding-right: 8px; border-right: 1px solid var(--border);
}
.ntp-search-box select option { background: var(--bg-surface); color: var(--text-primary); }
.ntp-search-input {
    flex: 1; height: 100%; background: none; border: none;
    color: var(--text-primary); font-size: 16px; outline: none;
    font-family: var(--font);
}
.ntp-search-input::placeholder { color: var(--text-muted); }

.ntp-shortcuts {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px; width: 100%; max-width: 620px;
}
.ntp-shortcut {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 14px 8px; border-radius: var(--radius-lg); cursor: pointer;
    transition: 0.2s; text-decoration: none;
}
.ntp-shortcut:hover { background: var(--bg-hover); transform: translateY(-2px); }
.ntp-sc-icon {
    width: 46px; height: 46px; border-radius: 50%;
    background: var(--bg-tertiary); display: flex;
    align-items: center; justify-content: center;
    font-size: 18px; color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15); transition: 0.2s;
}
.ntp-shortcut:hover .ntp-sc-icon { background: var(--accent); color: white; }
.ntp-sc-title { font-size: 12px; color: var(--text-secondary); font-weight: 500; text-align: center; }

.ntp-add-shortcut .ntp-sc-icon { background: var(--bg-hover); }

/* ── Search Results Page ── */
.search-results-page {
    padding: 30px 40px; overflow-y: auto; height: 100%;
    max-width: 800px; margin: 0 auto;
}
.sr-header { margin-bottom: 24px; }
.sr-header h2 { font-size: 1.2rem; color: var(--text-secondary); font-weight: 400; }
.sr-header h2 strong { color: var(--text-primary); }

.sr-loading {
    display: flex; align-items: center; gap: 12px;
    color: var(--text-muted); padding: 40px 0;
}
.sr-loading .spinner {
    width: 24px; height: 24px; border: 3px solid var(--border);
    border-top-color: var(--accent); border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Instant Answer Card */
.sr-instant-answer {
    background: var(--bg-surface); border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg); padding: 24px; margin-bottom: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}
.sr-ia-title { font-size: 1.3rem; font-weight: 700; margin-bottom: 8px; }
.sr-ia-source { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.sr-ia-text { font-size: 15px; line-height: 1.7; color: var(--text-secondary); }
.sr-ia-image { width: 100%; max-width: 300px; border-radius: var(--radius); margin-top: 12px; }

/* Search Result Item */
.sr-item {
    margin-bottom: 24px; padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}
.sr-item:last-child { border-bottom: none; }
.sr-item-url { font-size: 13px; color: var(--success); margin-bottom: 4px; }
.sr-item-title {
    font-size: 18px; font-weight: 600; color: var(--accent);
    cursor: pointer; margin-bottom: 6px; text-decoration: none; display: block;
}
.sr-item-title:hover { text-decoration: underline; }
.sr-item-desc { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }

.sr-no-results { text-align: center; padding: 60px; color: var(--text-muted); }
.sr-no-results i { font-size: 48px; margin-bottom: 16px; display: block; }

/* Internal pages */
.internal-page {
    padding: 40px; overflow-y: auto; height: 100%;
}
.internal-page h1 { font-size: 1.8rem; margin-bottom: 24px; font-weight: 700; }
.internal-page .page-section { margin-bottom: 30px; }
.internal-page .page-section h2 { font-size: 1.1rem; color: var(--text-secondary); margin-bottom: 12px; }

.history-item, .bookmark-item-row {
    display: flex; align-items: center; gap: 12px; padding: 10px 14px;
    border-radius: var(--radius); transition: 0.15s; cursor: pointer;
}
.history-item:hover, .bookmark-item-row:hover { background: var(--bg-hover); }
.hi-time { font-size: 12px; color: var(--text-muted); width: 80px; }
.hi-title { flex: 1; font-size: 14px; color: var(--text-primary); }
.hi-url { font-size: 12px; color: var(--text-muted); }
.hi-delete { background: none; border: none; color: var(--text-muted); cursor: pointer; }
.hi-delete:hover { color: var(--danger); }

/* ── Status Bar ── */
#status-bar {
    display: flex; align-items: center; gap: 16px;
    height: 24px; padding: 0 12px;
    background: var(--bg-secondary); border-top: 1px solid var(--border);
    font-size: 11px; color: var(--text-muted);
}
#status-bar span { display: flex; align-items: center; gap: 4px; }
#status-text { flex: 1; }

/* ── Side Panels ── */
.side-panel {
    position: fixed; top: 0; right: 0; width: 340px; height: 100vh;
    background: var(--bg-surface); border-left: 1px solid var(--border-strong);
    box-shadow: -4px 0 20px rgba(0,0,0,0.2); z-index: 80;
    display: flex; flex-direction: column;
    animation: slideIn 0.2s ease;
}
.side-panel.hidden { display: none; }
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }

.panel-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px; border-bottom: 1px solid var(--border);
}
.panel-header h3 { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.panel-close {
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; font-size: 16px; transition: 0.15s;
}
.panel-close:hover { color: var(--text-primary); }

#notes-textarea {
    flex: 1; padding: 16px; background: none; border: none;
    color: var(--text-primary); font-family: var(--font);
    font-size: 14px; resize: none; outline: none; line-height: 1.7;
}

/* ── Bottom Panel (DevTools) ── */
.bottom-panel {
    position: fixed; bottom: 24px; left: 0; right: 0; height: 280px;
    background: var(--bg-surface); border-top: 1px solid var(--border-strong);
    z-index: 80; display: flex; flex-direction: column;
}
.bottom-panel.hidden { display: none; }

.devtools-tabs { display: flex; gap: 2px; }
.dt-tab {
    background: none; border: none; padding: 8px 16px;
    font-size: 12px; color: var(--text-muted); cursor: pointer;
    border-bottom: 2px solid transparent; font-family: var(--font); font-weight: 500;
}
.dt-tab:hover { color: var(--text-primary); }
.dt-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.dt-content { display: none; flex: 1; overflow-y: auto; padding: 12px; font-family: 'Consolas', monospace; font-size: 12px; }
.dt-content.active { display: flex; flex-direction: column; }

#console-output { flex: 1; overflow-y: auto; }
.console-line { padding: 3px 8px; border-bottom: 1px solid var(--border); }
.console-line.error { color: var(--danger); background: rgba(255,82,82,0.05); }
.console-line.warn { color: var(--warning); }
.console-line.info { color: var(--info); }

.console-input-row {
    display: flex; align-items: center; gap: 8px;
    border-top: 1px solid var(--border); padding: 8px;
}
.console-input-row span { color: var(--accent); }
#console-input {
    flex: 1; background: none; border: none; color: var(--text-primary);
    font-family: 'Consolas', monospace; font-size: 12px; outline: none;
}

/* ── Modals ── */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    z-index: 500;
}
.modal-overlay.hidden { display: none; }

.modal-box {
    width: 90%; max-width: 560px; max-height: 80vh;
    background: var(--bg-surface); border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg); box-shadow: var(--shadow);
    overflow-y: auto;
    animation: popUp 0.25s cubic-bezier(0.18, 0.89, 0.32, 1.18);
}
.modal-box.wide { max-width: 750px; }
.modal-box.narrow { max-width: 400px; }

@keyframes popUp { from { transform: scale(0.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 1.2rem; display: flex; align-items: center; gap: 10px; }
.modal-close {
    background: none; border: none; color: var(--text-muted);
    font-size: 18px; cursor: pointer; transition: 0.15s;
}
.modal-close:hover { color: var(--text-primary); transform: rotate(90deg); }

/* Command Palette */
.command-palette-box {
    width: 90%; max-width: 560px;
    background: var(--bg-surface); border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg); box-shadow: var(--shadow);
    overflow: hidden;
    animation: popUp 0.15s ease;
}
#cmd-input {
    width: 100%; padding: 16px 20px;
    background: none; border: none; border-bottom: 1px solid var(--border);
    color: var(--text-primary); font-size: 16px;
    font-family: var(--font); outline: none;
}
#cmd-results { max-height: 350px; overflow-y: auto; padding: 6px; }
.cmd-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 16px; border-radius: var(--radius);
    cursor: pointer; transition: 0.1s; color: var(--text-primary); font-size: 14px;
}
.cmd-item:hover, .cmd-item.selected { background: var(--accent); color: white; }
.cmd-item i { width: 20px; font-size: 14px; }
.cmd-item kbd { font-size: 11px; margin-left: auto; background: var(--bg-hover); padding: 2px 8px; border-radius: 4px; }

/* Settings */
.settings-grid { display: flex; min-height: 400px; }
.settings-sidebar {
    width: 180px; border-right: 1px solid var(--border);
    padding: 12px; display: flex; flex-direction: column; gap: 2px;
}
.settings-nav-item {
    padding: 10px 14px; border-radius: var(--radius);
    font-size: 13px; cursor: pointer; transition: 0.15s; color: var(--text-secondary);
}
.settings-nav-item:hover { background: var(--bg-hover); }
.settings-nav-item.active { background: var(--accent); color: white; }

.settings-content { flex: 1; padding: 24px; overflow-y: auto; }

.setting-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 0; border-bottom: 1px solid var(--border);
}
.setting-label { font-size: 14px; }
.setting-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* Toggle Switch */
.toggle {
    position: relative; width: 40px; height: 22px;
    background: var(--text-muted); border-radius: 11px;
    cursor: pointer; transition: 0.3s;
}
.toggle.on { background: var(--accent); }
.toggle::after {
    content: ''; position: absolute; top: 2px; left: 2px;
    width: 18px; height: 18px; background: white;
    border-radius: 50%; transition: 0.3s;
}
.toggle.on::after { left: 20px; }

/* Theme Grid */
.theme-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 12px; padding: 20px;
}
.theme-card {
    padding: 20px; border-radius: var(--radius-lg);
    border: 2px solid var(--border); cursor: pointer;
    transition: 0.2s; text-align: center;
}
.theme-card:hover { border-color: var(--accent); transform: scale(1.03); }
.theme-card.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.theme-preview {
    width: 100%; height: 50px; border-radius: var(--radius);
    margin-bottom: 10px;
}
.theme-card-name { font-size: 13px; font-weight: 600; }

/* Auth Tabs & Forms */
.auth-tabs { display: flex; border-bottom: 1px solid var(--border); }
.auth-tab {
    flex: 1; padding: 12px; text-align: center; background: none;
    border: none; color: var(--text-muted); font-size: 14px;
    font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent;
    font-family: var(--font); transition: 0.15s;
}
.auth-tab:hover { color: var(--text-primary); }
.auth-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.auth-form { padding: 20px 24px; }
.auth-form.hidden { display: none; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; font-weight: 500; }
.form-group input {
    width: 100%; padding: 10px 14px; border-radius: var(--radius);
    background: var(--bg-primary); border: 1px solid var(--border-strong);
    color: var(--text-primary); font-size: 14px; outline: none;
    font-family: var(--font); transition: 0.2s;
}
.form-group input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

.btn-primary {
    width: 100%; padding: 12px; border-radius: var(--radius);
    background: var(--accent); color: white; font-weight: 700;
    border: none; cursor: pointer; font-size: 14px; font-family: var(--font);
    transition: 0.2s;
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }

.form-msg { margin-top: 12px; padding: 10px; border-radius: var(--radius); font-size: 13px; text-align: center; }
.form-msg.hidden { display: none; }
.form-msg.success { background: rgba(0,214,143,0.1); color: var(--success); }
.form-msg.error { background: rgba(255,82,82,0.1); color: var(--danger); }

/* Dropdown Menu */
.dropdown-menu {
    position: fixed; background: var(--bg-surface);
    border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
    box-shadow: var(--shadow); z-index: 300;
    padding: 6px; min-width: 240px;
    animation: popUp 0.15s ease;
}
.dropdown-menu.hidden { display: none; }

.menu-item {
    display: flex; align-items: center; gap: 12px;
    padding: 9px 14px; border-radius: var(--radius);
    font-size: 13px; cursor: pointer; transition: 0.1s;
    color: var(--text-primary);
}
.menu-item:hover { background: var(--bg-hover); }
.menu-item i { width: 18px; color: var(--text-muted); }
.menu-item kbd { margin-left: auto; font-size: 11px; color: var(--text-muted); background: var(--bg-hover); padding: 2px 6px; border-radius: 4px; }
.menu-divider { height: 1px; background: var(--border); margin: 4px 8px; }

/* Focus Overlay */
#focus-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.85);
    display: flex; align-items: flex-start; justify-content: center;
    z-index: 1000; padding-top: 100px;
}
#focus-overlay.hidden { display: none; }

.focus-banner {
    display: flex; align-items: center; gap: 16px;
    background: var(--bg-surface); border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg); padding: 20px 30px;
    font-size: 15px; box-shadow: var(--shadow);
}
.focus-banner i { font-size: 24px; color: var(--danger); }
#exit-focus {
    background: var(--danger); color: white; border: none;
    padding: 8px 20px; border-radius: var(--radius);
    cursor: pointer; font-weight: 600; font-family: var(--font);
}

/* Draw Canvas */
#draw-canvas {
    position: fixed; inset: 0; z-index: 900;
    cursor: crosshair;
}
#draw-canvas.hidden { display: none; }

/* Utilities */
.hidden { display: none !important; }
.muted { color: var(--text-muted); }

/* Scrollbar Styling */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ═══════════════════════════════════════
   Premium Animations & Effects
   ═══════════════════════════════════════ */

/* Smooth glow pulse on active tab */
.tab.active {
    animation: tabGlow 2s ease-in-out infinite alternate;
}
@keyframes tabGlow {
    from { box-shadow: inset 0 -2px 0 var(--accent); }
    to { box-shadow: inset 0 -2px 8px var(--accent-glow); }
}

/* Incognito mode pulse */
body[data-theme] .nav-btn.active {
    animation: incognitoPulse 1.5s ease-in-out infinite;
}
@keyframes incognitoPulse {
    0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); }
    50% { box-shadow: 0 0 12px 4px var(--accent-glow); }
}

/* Search result items micro-animation */
.sr-item {
    animation: resultSlide 0.3s ease forwards;
    opacity: 0;
}
.sr-item:nth-child(1) { animation-delay: 0.05s; }
.sr-item:nth-child(2) { animation-delay: 0.1s; }
.sr-item:nth-child(3) { animation-delay: 0.15s; }
.sr-item:nth-child(4) { animation-delay: 0.2s; }
.sr-item:nth-child(5) { animation-delay: 0.25s; }
.sr-item:nth-child(6) { animation-delay: 0.3s; }
.sr-item:nth-child(7) { animation-delay: 0.35s; }
.sr-item:nth-child(8) { animation-delay: 0.4s; }

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

/* Instant answer card shimmer border */
.sr-instant-answer {
    position: relative;
    overflow: hidden;
}
.sr-instant-answer::before {
    content: '';
    position: absolute; top: -2px; left: -2px; right: -2px; bottom: -2px;
    background: linear-gradient(45deg, transparent, var(--accent-glow), transparent);
    background-size: 200% 200%;
    animation: shimmer 3s ease infinite;
    z-index: -1;
    border-radius: inherit;
}
@keyframes shimmer {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Address bar typing animation */
#address-bar:focus {
    caret-color: var(--accent);
}

/* NTP Logo hover */
.ntp-logo {
    transition: 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}
.ntp-logo:hover {
    transform: rotateY(180deg) scale(1.1);
}

/* NTP Title gradient */
.ntp-title {
    background: linear-gradient(135deg, var(--accent), var(--text-primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Button ripple effect */
.nav-btn:active, .glass-btn:active, .menu-item:active, .btn-primary:active {
    transform: scale(0.95);
}

/* Status bar RAM indicator */
#status-time-tracker {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.3px;
    transition: color 0.5s;
}

#status-time-tracker i {
    margin-right: 3px;
    font-size: 10px;
}

/* Loading skeleton for search */
.sr-loading {
    animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Modal backdrop blur transition */
.modal-overlay {
    animation: modalFadeIn 0.2s ease;
}
@keyframes modalFadeIn {
    from { opacity: 0; backdrop-filter: blur(0); }
    to { opacity: 1; backdrop-filter: blur(6px); }
}

/* Command palette selection */
.cmd-item.selected, .cmd-item:hover {
    transition: 0.1s;
}

/* Theme card hover shine */
.theme-card::after {
    content: '';
    position: absolute; top: 0; left: -75%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transform: skewX(-25deg);
    transition: 0.6s;
}
.theme-card:hover::after {
    left: 125%;
}
.theme-card {
    position: relative;
    overflow: hidden;
}

/* Settings toggle animation */
.toggle { transition: background 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28); }
.toggle::after { transition: left 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28); }

/* Focus mode dramatic entrance */
#focus-overlay {
    animation: focusIn 0.5s ease;
}
@keyframes focusIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.focus-banner {
    animation: focusBounce 0.6s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}
@keyframes focusBounce {
    from { transform: scale(0.7) translateY(-30px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

/* Auth form input animations */
.auth-form .form-group input {
    transition: 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}
.auth-form .form-group input:focus {
    transform: translateY(-1px);
}

/* Bookmark item hover glow */
.bm-item:hover {
    box-shadow: 0 2px 8px var(--accent-glow);
}

/* Shortcut hover 3D lift */
.ntp-shortcut:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

/* Side panel slide animation */
.side-panel {
    animation: panelSlide 0.25s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}
@keyframes panelSlide {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Bottom panel slide up */
.bottom-panel {
    animation: panelUp 0.25s ease;
}
@keyframes panelUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* ═══════════════════════════════════════
   Responsive Design
   ═══════════════════════════════════════ */

@media (max-width: 900px) {
    .nav-center { max-width: 400px; }
    .ntp-search-box { max-width: 100%; }
    .ntp-shortcuts { grid-template-columns: repeat(4, 1fr); }
    .tab { min-width: 80px; max-width: 150px; }
    .settings-grid { flex-direction: column; }
    .settings-sidebar { width: 100%; flex-direction: row; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--border); }
    .modal-box.wide { max-width: 95%; }
    .theme-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    #tab-bar { height: 36px; }
    .tab { font-size: 11px; min-width: 60px; max-width: 100px; padding: 0 8px; }
    #nav-bar { padding: 4px 6px; gap: 4px; }
    .nav-btn { width: 28px; height: 28px; font-size: 12px; }
    .address-bar-wrapper { height: 32px; }
    #address-bar { font-size: 13px; }
    #bookmarks-bar { height: 26px; }
    .bm-item { font-size: 11px; padding: 2px 8px; }
    #status-bar { font-size: 10px; height: 20px; }
    .ntp-title { font-size: 1.8rem; }
    .ntp-search-box { height: 44px; }
    .ntp-shortcuts { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .search-results-page { padding: 16px; }
    .sr-item-title { font-size: 15px; }
    .modal-box { max-width: 95%; padding: 0; }
    .side-panel { width: 100%; }
    .command-palette-box { width: 95%; }
}

/* Print styling */
@media print {
    #tab-bar, #nav-bar, #bookmarks-bar, #status-bar,
    .side-panel, .bottom-panel, .modal-overlay { display: none !important; }
    #content-area { height: auto; overflow: visible; }
    body { background: white; color: black; }
}
