/* ============================================
   Endis Browser - Chrome-like UI
   ============================================ */

/* Wine Theme (Default) */
:root {
    --bg-primary: #1a0a10;
    --bg-secondary: #2d1520;
    --bg-tertiary: #3d1f2d;
    --bg-hover: #4d2a3a;
    --text-primary: #f5e6ea;
    --text-secondary: #c9a8b3;
    --text-muted: #8a6070;
    --accent: #d4647a;
    --accent-hover: #e87d92;
    --accent-glow: rgba(212, 100, 122, 0.3);
    --border: rgba(212, 100, 122, 0.2);
    --border-hover: rgba(212, 100, 122, 0.4);
    --tab-active: #1a0a10;
    --tab-hover: #3d1f2d;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --logo-filter: none;
}

/* Theme: Light */
[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f1f3f4;
    --bg-tertiary: #e8eaed;
    --bg-hover: #dadce0;
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --text-muted: #9aa0a6;
    --accent: #1a73e8;
    --accent-hover: #1967d2;
    --accent-glow: rgba(26, 115, 232, 0.2);
    --border: rgba(0, 0, 0, 0.1);
    --border-hover: rgba(0, 0, 0, 0.2);
    --tab-active: #ffffff;
    --tab-hover: #e8eaed;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    --logo-filter: hue-rotate(200deg) saturate(1.2);
}

/* Theme: Midnight */
[data-theme="midnight"] {
    --bg-primary: #0d0d1a;
    --bg-secondary: #151528;
    --bg-tertiary: #1e1e38;
    --bg-hover: #282848;
    --text-primary: #e8e8ff;
    --text-secondary: #a8a8d0;
    --text-muted: #6868a0;
    --accent: #7c5cff;
    --accent-hover: #9580ff;
    --accent-glow: rgba(124, 92, 255, 0.3);
    --border: rgba(124, 92, 255, 0.2);
    --border-hover: rgba(124, 92, 255, 0.4);
    --tab-active: #0d0d1a;
    --tab-hover: #1e1e38;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    --logo-filter: hue-rotate(260deg) saturate(1.5);
}

/* Theme: Ocean */
[data-theme="ocean"] {
    --bg-primary: #0a1628;
    --bg-secondary: #0f2238;
    --bg-tertiary: #163050;
    --bg-hover: #1e4068;
    --text-primary: #e6f0fa;
    --text-secondary: #8eb8e0;
    --text-muted: #4a7aaa;
    --accent: #00b4d8;
    --accent-hover: #48cae4;
    --accent-glow: rgba(0, 180, 216, 0.3);
    --border: rgba(0, 180, 216, 0.2);
    --border-hover: rgba(0, 180, 216, 0.4);
    --tab-active: #0a1628;
    --tab-hover: #163050;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --logo-filter: hue-rotate(180deg) saturate(1.3);
}

/* Theme: Forest */
[data-theme="forest"] {
    --bg-primary: #0a1a10;
    --bg-secondary: #122818;
    --bg-tertiary: #1a3820;
    --bg-hover: #224828;
    --text-primary: #e6f5ea;
    --text-secondary: #8ec9a0;
    --text-muted: #4a8a5a;
    --accent: #4ade80;
    --accent-hover: #6ee7a0;
    --accent-glow: rgba(74, 222, 128, 0.3);
    --border: rgba(74, 222, 128, 0.2);
    --border-hover: rgba(74, 222, 128, 0.4);
    --tab-active: #0a1a10;
    --tab-hover: #1a3820;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --logo-filter: hue-rotate(100deg) saturate(1.2);
}

/* Theme: Sunset */
[data-theme="sunset"] {
    --bg-primary: #1a0f0a;
    --bg-secondary: #2d1810;
    --bg-tertiary: #442218;
    --bg-hover: #5a2c20;
    --text-primary: #fff0e6;
    --text-secondary: #e0a888;
    --text-muted: #a06040;
    --accent: #ff7b54;
    --accent-hover: #ff9a76;
    --accent-glow: rgba(255, 123, 84, 0.3);
    --border: rgba(255, 123, 84, 0.2);
    --border-hover: rgba(255, 123, 84, 0.4);
    --tab-active: #1a0f0a;
    --tab-hover: #442218;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --logo-filter: hue-rotate(20deg) saturate(1.4);
}

/* Theme: Lavender */
[data-theme="lavender"] {
    --bg-primary: #1a101a;
    --bg-secondary: #281828;
    --bg-tertiary: #382038;
    --bg-hover: #482848;
    --text-primary: #f5e6f5;
    --text-secondary: #c9a8c9;
    --text-muted: #8a608a;
    --accent: #c084fc;
    --accent-hover: #d4a0ff;
    --accent-glow: rgba(192, 132, 252, 0.3);
    --border: rgba(192, 132, 252, 0.2);
    --border-hover: rgba(192, 132, 252, 0.4);
    --tab-active: #1a101a;
    --tab-hover: #382038;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --logo-filter: hue-rotate(280deg) saturate(1.3);
}

/* Theme: Rose Gold */
[data-theme="rosegold"] {
    --bg-primary: #1a1210;
    --bg-secondary: #2d1e1a;
    --bg-tertiary: #3d2a24;
    --bg-hover: #4d362e;
    --text-primary: #fff0ea;
    --text-secondary: #e0b8a8;
    --text-muted: #a07868;
    --accent: #f0a090;
    --accent-hover: #ffb8a8;
    --accent-glow: rgba(240, 160, 144, 0.3);
    --border: rgba(240, 160, 144, 0.2);
    --border-hover: rgba(240, 160, 144, 0.4);
    --tab-active: #1a1210;
    --tab-hover: #3d2a24;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --logo-filter: hue-rotate(350deg) saturate(0.8);
}

/* Theme: Mint */
[data-theme="mint"] {
    --bg-primary: #0a1a18;
    --bg-secondary: #102824;
    --bg-tertiary: #183830;
    --bg-hover: #20483c;
    --text-primary: #e6fff8;
    --text-secondary: #88d8c0;
    --text-muted: #48a890;
    --accent: #2dd4bf;
    --accent-hover: #5ee9d8;
    --accent-glow: rgba(45, 212, 191, 0.3);
    --border: rgba(45, 212, 191, 0.2);
    --border-hover: rgba(45, 212, 191, 0.4);
    --tab-active: #0a1a18;
    --tab-hover: #183830;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --logo-filter: hue-rotate(160deg) saturate(1.2);
}

/* Theme: Cherry */
[data-theme="cherry"] {
    --bg-primary: #1a0508;
    --bg-secondary: #300810;
    --bg-tertiary: #480c18;
    --bg-hover: #601020;
    --text-primary: #ffe6ea;
    --text-secondary: #e88898;
    --text-muted: #a84858;
    --accent: #ef4444;
    --accent-hover: #f87171;
    --accent-glow: rgba(239, 68, 68, 0.3);
    --border: rgba(239, 68, 68, 0.2);
    --border-hover: rgba(239, 68, 68, 0.4);
    --tab-active: #1a0508;
    --tab-hover: #480c18;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --logo-filter: hue-rotate(0deg) saturate(1.5);
}

/* Theme: Gold */
[data-theme="gold"] {
    --bg-primary: #1a1608;
    --bg-secondary: #2d2510;
    --bg-tertiary: #443618;
    --bg-hover: #5a4820;
    --text-primary: #fff8e6;
    --text-secondary: #e0c888;
    --text-muted: #a08848;
    --accent: #f59e0b;
    --accent-hover: #fbbf24;
    --accent-glow: rgba(245, 158, 11, 0.3);
    --border: rgba(245, 158, 11, 0.2);
    --border-hover: rgba(245, 158, 11, 0.4);
    --tab-active: #1a1608;
    --tab-hover: #443618;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --logo-filter: hue-rotate(40deg) saturate(1.3);
}

/* Theme: Steel */
[data-theme="steel"] {
    --bg-primary: #101418;
    --bg-secondary: #1a2028;
    --bg-tertiary: #242c38;
    --bg-hover: #303848;
    --text-primary: #e8eef5;
    --text-secondary: #98a8c0;
    --text-muted: #607080;
    --accent: #64748b;
    --accent-hover: #94a3b8;
    --accent-glow: rgba(100, 116, 139, 0.3);
    --border: rgba(100, 116, 139, 0.2);
    --border-hover: rgba(100, 116, 139, 0.4);
    --tab-active: #101418;
    --tab-hover: #242c38;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --logo-filter: grayscale(0.5) brightness(1.2);
}

/* Theme: Neon */
[data-theme="neon"] {
    --bg-primary: #0a0a0f;
    --bg-secondary: #101018;
    --bg-tertiary: #181820;
    --bg-hover: #202028;
    --text-primary: #f0f0ff;
    --text-secondary: #c0c0e0;
    --text-muted: #8080a0;
    --accent: #00ff88;
    --accent-hover: #40ffa8;
    --accent-glow: rgba(0, 255, 136, 0.4);
    --border: rgba(0, 255, 136, 0.3);
    --border-hover: rgba(0, 255, 136, 0.5);
    --tab-active: #0a0a0f;
    --tab-hover: #181820;
    --shadow: 0 4px 20px rgba(0, 255, 136, 0.2);
    --logo-filter: hue-rotate(140deg) saturate(2) brightness(1.2);
}

/* Theme: Coral */
[data-theme="coral"] {
    --bg-primary: #1a100f;
    --bg-secondary: #2d1a18;
    --bg-tertiary: #3d2422;
    --bg-hover: #4d2e2c;
    --text-primary: #fff0ee;
    --text-secondary: #e0a8a0;
    --text-muted: #a06858;
    --accent: #ff6b6b;
    --accent-hover: #ff8888;
    --accent-glow: rgba(255, 107, 107, 0.3);
    --border: rgba(255, 107, 107, 0.2);
    --border-hover: rgba(255, 107, 107, 0.4);
    --tab-active: #1a100f;
    --tab-hover: #3d2422;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --logo-filter: hue-rotate(10deg) saturate(1.3);
}

/* Theme: Grape */
[data-theme="grape"] {
    --bg-primary: #140a1a;
    --bg-secondary: #20102d;
    --bg-tertiary: #2c1640;
    --bg-hover: #381c53;
    --text-primary: #f5e6ff;
    --text-secondary: #c8a8e0;
    --text-muted: #8860a0;
    --accent: #a855f7;
    --accent-hover: #c084fc;
    --accent-glow: rgba(168, 85, 247, 0.3);
    --border: rgba(168, 85, 247, 0.2);
    --border-hover: rgba(168, 85, 247, 0.4);
    --tab-active: #140a1a;
    --tab-hover: #2c1640;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --logo-filter: hue-rotate(300deg) saturate(1.4);
}

/* Theme: Azure */
[data-theme="azure"] {
    --bg-primary: #0a1420;
    --bg-secondary: #101e30;
    --bg-tertiary: #182840;
    --bg-hover: #203250;
    --text-primary: #e6f2ff;
    --text-secondary: #88b8e8;
    --text-muted: #4878a8;
    --accent: #3b82f6;
    --accent-hover: #60a5fa;
    --accent-glow: rgba(59, 130, 246, 0.3);
    --border: rgba(59, 130, 246, 0.2);
    --border-hover: rgba(59, 130, 246, 0.4);
    --tab-active: #0a1420;
    --tab-hover: #182840;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --logo-filter: hue-rotate(210deg) saturate(1.3);
}

/* Theme: Slate */
[data-theme="slate"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-hover: #475569;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --accent: #38bdf8;
    --accent-hover: #7dd3fc;
    --accent-glow: rgba(56, 189, 248, 0.3);
    --border: rgba(56, 189, 248, 0.2);
    --border-hover: rgba(56, 189, 248, 0.4);
    --tab-active: #0f172a;
    --tab-hover: #334155;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --logo-filter: hue-rotate(190deg) saturate(1.2);
}

/* Theme: Emerald */
[data-theme="emerald"] {
    --bg-primary: #052e16;
    --bg-secondary: #064e27;
    --bg-tertiary: #086f38;
    --bg-hover: #0a9049;
    --text-primary: #dcfce7;
    --text-secondary: #86efac;
    --text-muted: #4ade80;
    --accent: #10b981;
    --accent-hover: #34d399;
    --accent-glow: rgba(16, 185, 129, 0.3);
    --border: rgba(16, 185, 129, 0.2);
    --border-hover: rgba(16, 185, 129, 0.4);
    --tab-active: #052e16;
    --tab-hover: #086f38;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --logo-filter: hue-rotate(130deg) saturate(1.4);
}

/* Theme: Crimson */
[data-theme="crimson"] {
    --bg-primary: #1a0000;
    --bg-secondary: #300000;
    --bg-tertiary: #480000;
    --bg-hover: #600000;
    --text-primary: #ffe6e6;
    --text-secondary: #ff9999;
    --text-muted: #cc4444;
    --accent: #dc2626;
    --accent-hover: #ef4444;
    --accent-glow: rgba(220, 38, 38, 0.4);
    --border: rgba(220, 38, 38, 0.3);
    --border-hover: rgba(220, 38, 38, 0.5);
    --tab-active: #1a0000;
    --tab-hover: #480000;
    --shadow: 0 4px 20px rgba(220, 38, 38, 0.2);
    --logo-filter: hue-rotate(0deg) saturate(2);
}

/* Theme: Obsidian */
[data-theme="obsidian"] {
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-tertiary: #141414;
    --bg-hover: #1e1e1e;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #606060;
    --accent: #ffffff;
    --accent-hover: #e0e0e0;
    --accent-glow: rgba(255, 255, 255, 0.2);
    --border: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(255, 255, 255, 0.2);
    --tab-active: #000000;
    --tab-hover: #141414;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
    --logo-filter: grayscale(1) brightness(2);
}

/* Theme: Cyber */
[data-theme="cyber"] {
    --bg-primary: #0a0014;
    --bg-secondary: #140020;
    --bg-tertiary: #1e002e;
    --bg-hover: #28003c;
    --text-primary: #f0e0ff;
    --text-secondary: #c080ff;
    --text-muted: #8040c0;
    --accent: #ff00ff;
    --accent-hover: #ff40ff;
    --accent-glow: rgba(255, 0, 255, 0.4);
    --border: rgba(255, 0, 255, 0.3);
    --border-hover: rgba(255, 0, 255, 0.5);
    --tab-active: #0a0014;
    --tab-hover: #1e002e;
    --shadow: 0 4px 20px rgba(255, 0, 255, 0.3);
    --logo-filter: hue-rotate(320deg) saturate(2) brightness(1.2);
}

/* ============================================
   Base Styles
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

.browser {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: var(--bg-primary);
}

/* ============================================
   Tab Bar - Chrome Style
   ============================================ */
.tab-bar {
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    padding: 8px 8px 0;
    min-height: 42px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.tab-bar.collapsed {
    transform: translateY(-100%);
    opacity: 0;
    position: absolute;
    pointer-events: none;
}

.tab-bar-left {
    display: flex;
    align-items: center;
    padding-right: 8px;
}

.browser-icon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    filter: var(--logo-filter);
    transition: filter 0.3s ease;
}

.tabs-wrapper {
    flex: 1;
    display: flex;
    align-items: flex-end;
    min-width: 0;
    gap: 4px;
    justify-content: flex-start;
}

.tabs-container {
    display: flex;
    gap: 1px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    max-width: calc(100% - 40px);
}

.tabs-container::-webkit-scrollbar {
    display: none;
}

.tab {
    display: flex;
    align-items: center;
    min-width: 60px;
    max-width: 240px;
    flex: 0 1 240px;
    padding: 8px 4px 8px 12px;
    background: var(--bg-tertiary);
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    position: relative;
    transition: background 0.15s ease;
    user-select: none;
}

.tab:hover {
    background: var(--tab-hover);
}

.tab.active {
    background: var(--tab-active);
}

.tab.dragging {
    opacity: 0.5;
}

.tab.drag-over-left::before,
.tab.drag-over-right::after {
    content: '';
    position: absolute;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background: var(--accent);
    border-radius: 1px;
}

.tab.drag-over-left::before { left: -2px; }
.tab.drag-over-right::after { right: -2px; }

.tab-favicon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
}

.tab-favicon img {
    width: 16px;
    height: 16px;
    border-radius: 2px;
}

.tab-favicon i {
    font-size: 12px;
    color: var(--text-muted);
}

.tab-favicon .spinner {
    width: 12px;
    height: 12px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.tab-title {
    flex: 1;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
    min-width: 0;
}

.tab-close {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-left: 4px;
    opacity: 0;
    transition: opacity 0.15s, background 0.15s;
    flex-shrink: 0;
}

.tab:hover .tab-close,
.tab.active .tab-close {
    opacity: 1;
}

.tab-close:hover {
    background: var(--bg-hover);
}

.tab-close i {
    font-size: 10px;
    color: var(--text-secondary);
}

.new-tab-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
    margin-bottom: 6px;
}

.new-tab-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.tab-bar-right {
    display: flex;
    align-items: center;
    padding-left: 8px;
}

.tab-bar-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s;
}

.tab-bar-btn:hover {
    background: var(--bg-hover);
}

.expand-tabs-btn {
    display: none;
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 8px 8px;
    color: var(--text-secondary);
    cursor: pointer;
    z-index: 100;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.expand-tabs-btn:hover {
    background: var(--bg-tertiary);
}

.tab-bar.collapsed ~ .expand-tabs-btn {
    display: flex;
}

/* ============================================
   Toolbar
   ============================================ */
.toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    transition: padding 0.3s ease;
}

.toolbar.no-tabs {
    padding-top: 8px;
}

.toolbar-nav {
    display: flex;
    gap: 2px;
}

.toolbar-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.toolbar-btn:hover:not(:disabled) {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.toolbar-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

.toolbar-btn i {
    font-size: 14px;
}

/* Omnibox */
.omnibox {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 6px 12px;
    margin: 0 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.omnibox:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.omnibox-security {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
}

.omnibox-security.secure {
    color: var(--accent);
}

.omnibox-security i {
    font-size: 14px;
}

.omnibox-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
}

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

.toolbar-actions {
    display: flex;
    gap: 2px;
}

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

.loading-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 100;
    overflow: hidden;
}

.loading-bar.active::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.tab-content {
    position: absolute;
    inset: 0;
    display: none;
    background: var(--bg-primary);
}

.tab-content.active {
    display: flex;
    flex-direction: column;
}

.proxy-frame {
    width: 100%;
    height: 100%;
    border: none;
    background: #fff;
}

/* ============================================
   New Tab Page
   ============================================ */
.new-tab-page {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 60px 20px 40px;
    overflow-y: auto;
}

.ntp-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 32px;
}

.ntp-icon {
    width: clamp(40px, 10vw, 64px);
    height: clamp(40px, 10vw, 64px);
    filter: var(--logo-filter, none);
}

.ntp-logo {
    font-family: 'BlocParty Outline', 'Figtree', sans-serif;
    font-size: clamp(48px, 12vw, 80px);
    font-weight: 400;
    color: var(--accent);
    text-shadow: 0 0 40px var(--accent-glow);
}

.ntp-logo.filled {
    font-family: 'BlocParty', 'Figtree', sans-serif;
    -webkit-text-stroke: 0;
    color: var(--accent);
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.ntp-search {
    width: 100%;
    max-width: 600px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 28px;
    padding: 14px 20px;
    margin-bottom: 48px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ntp-search:focus-within {
    border-color: var(--accent);
    box-shadow: 0 4px 24px var(--accent-glow);
}

.ntp-search i {
    font-size: 18px;
    color: var(--text-muted);
}

.ntp-search input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 16px;
    font-family: inherit;
}

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

.shortcuts-grid {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 500px;
}

.shortcut {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px;
    border-radius: 16px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, transform 0.2s;
    min-width: 120px;
}

.shortcut:hover {
    background: var(--bg-hover);
    transform: translateY(-4px);
}

.shortcut-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    border-radius: 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.shortcut:hover .shortcut-icon {
    border-color: var(--accent);
    box-shadow: 0 4px 16px var(--accent-glow);
}

.shortcut-icon i {
    font-size: 24px;
    color: var(--accent);
}

.shortcut-icon img {
    width: 28px;
    height: 28px;
}

.shortcut-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
}

/* ============================================
   Settings Panel
   ============================================ */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 900;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.overlay.open {
    opacity: 1;
    visibility: visible;
}

.settings-panel {
    position: fixed;
    top: 0;
    right: -420px;
    width: 400px;
    height: 100%;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
    box-shadow: var(--shadow);
}

.settings-panel.open {
    right: 0;
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.settings-header h2 {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-header h2 i {
    color: var(--accent);
}

.close-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s;
}

.close-btn:hover {
    background: var(--bg-hover);
}

.settings-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.settings-section {
    margin-bottom: 28px;
}

.settings-section h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-section h3 i {
    font-size: 12px;
}

.theme-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.theme-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}

.theme-option:hover {
    background: var(--bg-hover);
}

.theme-option.active {
    background: var(--bg-tertiary);
}

.theme-preview {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--border);
    transition: border-color 0.15s;
}

.theme-option.active .theme-preview {
    border-color: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
}

.theme-name {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
}

/* Theme preview colors */
.theme-preview.wine { background: linear-gradient(135deg, #d4647a, #2d1520); }
.theme-preview.light { background: linear-gradient(135deg, #1a73e8, #f1f3f4); }
.theme-preview.midnight { background: linear-gradient(135deg, #7c5cff, #151528); }
.theme-preview.ocean { background: linear-gradient(135deg, #00b4d8, #0f2238); }
.theme-preview.forest { background: linear-gradient(135deg, #4ade80, #122818); }
.theme-preview.sunset { background: linear-gradient(135deg, #ff7b54, #2d1810); }
.theme-preview.lavender { background: linear-gradient(135deg, #c084fc, #281828); }
.theme-preview.rosegold { background: linear-gradient(135deg, #f0a090, #2d1e1a); }
.theme-preview.mint { background: linear-gradient(135deg, #2dd4bf, #102824); }
.theme-preview.cherry { background: linear-gradient(135deg, #ef4444, #300810); }
.theme-preview.gold { background: linear-gradient(135deg, #f59e0b, #2d2510); }
.theme-preview.steel { background: linear-gradient(135deg, #64748b, #1a2028); }
.theme-preview.neon { background: linear-gradient(135deg, #00ff88, #101018); }
.theme-preview.coral { background: linear-gradient(135deg, #ff6b6b, #2d1a18); }
.theme-preview.grape { background: linear-gradient(135deg, #a855f7, #20102d); }
.theme-preview.azure { background: linear-gradient(135deg, #3b82f6, #101e30); }
.theme-preview.slate { background: linear-gradient(135deg, #38bdf8, #1e293b); }
.theme-preview.emerald { background: linear-gradient(135deg, #10b981, #064e27); }
.theme-preview.crimson { background: linear-gradient(135deg, #dc2626, #300000); }
.theme-preview.obsidian { background: linear-gradient(135deg, #ffffff, #0a0a0a); }
.theme-preview.cyber { background: linear-gradient(135deg, #ff00ff, #140020); }

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.setting-row:last-child {
    border-bottom: none;
}

.setting-row label {
    font-size: 14px;
    color: var(--text-primary);
}

.setting-row select,
.setting-row input {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    padding: 8px 12px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.15s;
}

.setting-row select:hover,
.setting-row input:hover {
    border-color: var(--border-hover);
}

.setting-row select:focus,
.setting-row input:focus {
    outline: none;
    border-color: var(--accent);
}

.setting-row input[type="text"] {
    width: 140px;
}

.setting-row input#panic-key {
    width: 50px;
    text-align: center;
}

/* ============================================
   Context Menu
   ============================================ */
.context-menu {
    position: fixed;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 0;
    min-width: 180px;
    box-shadow: var(--shadow);
    z-index: 2000;
    display: none;
}

.context-menu.show {
    display: block;
}

.context-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.1s;
}

.context-item:hover {
    background: var(--bg-hover);
}

.context-item i {
    width: 16px;
    color: var(--text-muted);
    font-size: 12px;
}

.context-divider {
    height: 1px;
    background: var(--border);
    margin: 6px 0;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .tab {
        max-width: 150px;
    }
    
    .settings-panel {
        width: 100%;
        right: -100%;
    }
    
    .shortcuts-grid {
        gap: 16px;
    }
    
    .shortcut {
        padding: 16px;
        min-width: 100px;
    }
}
