:root {
    /* پالت رنگی Omni Browser (آبی و خاکستری مدرن - 2026 Standard) */
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: rgba(37, 99, 235, 0.1);
    --bg-color: #f8fafc;
    --surface-color: #ffffff;
    --nav-bg: #1e293b;
    --text-color: #334155;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --footer-bg: #1e293b;
    --footer-text: #94a3b8;
    /* سایه‌ها (Neumorphism hints) */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-focus: 0 0 0 3px rgba(37, 99, 235, 0.3);
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
}

/* تم تاریک (Dark Mode) */
[data-theme="dark"] {
    --bg-color: #0f172a;
    --surface-color: #1e293b;
    --nav-bg: #020617;
    --text-color: #e2e8f0;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --footer-bg: #020617;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
}

/* ریست و پایه */
* { box-sizing: border-box; outline: none; -webkit-tap-highlight-color: transparent; }
html {
    scroll-behavior: smooth;
}
html, body {
    margin: 0; padding: 0;
    font-family: 'Vazirmatn', Tahoma, 'Segoe UI', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    height: 100%;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* اسکرول‌بار سفارشی */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-color); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

.app-wrapper { display: flex; flex-direction: column; min-height: 100vh; }

/* --- نوار منو (Navigation) --- */
nav {
    background-color: var(--nav-bg);
    box-shadow: var(--shadow-md);
    z-index: 1000;
    height: 64px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    flex-shrink: 0;
    justify-content: space-between;
    position: sticky;
    top: 0;
    transition: background-color 0.3s;
}

.nav-left, .nav-right { display: flex; align-items: center; gap: 8px; }

nav a {
    color: #e2e8f0;
    text-decoration: none;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    white-space: nowrap;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
}

nav a:hover, nav a.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: translateY(-1px);
}

/* دراپ‌داون (Dropdown) - استایل کلی */
.dropdown { 
    position: relative; 
    display: inline-block; 
    height: 100%; 
    display: flex; 
    align-items: center; 
}

.dropdown-content {
    display: none; /* پیش‌فرض مخفی */
    position: fixed; /* ثابت نسبت به صفحه برای جلوگیری از خروج */
    right: 0; /* چسبیده به سمت چپ دکمه */
    top: 64px; /* دقیقا زیر نوار ناوبری */
    background-color: var(--surface-color);
    width: 280px; /* عرض استاندارد و خوانا */
    box-shadow: var(--shadow-lg);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    z-index: 2000;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-top: none;
    
    /* انیمیشن ورود */
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(10px); /* افکت بلور مدرن */
}

/* کلاس فعال برای نمایش منو */
.dropdown-content.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* آیتم‌های منو */
.dropdown-content a {
    color: var(--text-color);
    padding: 14px 20px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.15s ease;
}

.dropdown-content a:last-child { border-bottom: none; }

.dropdown-content a:hover {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

.dropdown-content a:active {
    background-color: var(--primary-color);
    color: white;
}

/* جداکننده */
.dropdown-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 4px 0;
}

/* دکمه نصب PWA */
.install-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    display: none; /* پیش‌فرض مخفی */
    align-items: center;
    gap: 6px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s;
}
.install-btn:hover { transform: scale(1.05); background-color: var(--primary-hover); }

/* --- نوار آدرس (Address Bar) --- */
.address-bar {
    background-color: var(--surface-color);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.address-bar form {
    display: flex;
    width: 100%;
    max-width: 900px;
    background: var(--bg-color);
    border-radius: var(--radius-md);
    padding: 4px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.address-bar form:focus-within {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-focus);
}

.engine-select {
    padding: 0 12px;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 13px;
    color: var(--text-color);
    cursor: pointer;
    border-left: 1px solid var(--border-color);
    border-radius: 0;
    height: 40px;
    font-weight: 500;
}

.address-bar input {
    padding: 0 12px;
    flex-grow: 1;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 15px;
    color: var(--text-color);
    height: 40px;
}

.address-bar button {
    padding: 0 24px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-weight: bold;
    font-size: 14px;
    height: 40px;
    transition: background-color 0.2s, transform 0.1s;
}
.address-bar button:hover { background-color: var(--primary-hover); }
.address-bar button:active { transform: scale(0.98); }

/* --- کانتینر اصلی --- */
.main-container { flex-grow: 1; position: relative; width: 100%; display: flex; flex-direction: column; overflow: hidden; }
.browser-frame { width: 100%; height: 100%; border: none; display: block; position: absolute; top: 0; left: 0; background: white; }

/* --- صفحات داخلی (Internal Pages) --- */
.page-screen {
    min-height: calc(100vh - 140px);
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: var(--bg-color);
    padding: 40px 20px 100px 20px;
    box-sizing: border-box;
    overflow-y: auto;
}

.page-content { text-align: center; width: 100%; max-width: 1100px; animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.logo-area { margin-bottom: 40px; display: flex; flex-direction: column; align-items: center; }
.logo-icon-svg { width: 90px; height: 90px; margin-bottom: 20px; filter: drop-shadow(0 10px 20px rgba(37, 99, 235, 0.2)); animation: float 6s ease-in-out infinite; }
@keyframes float { 0% { transform: translateY(0px); } 50% { transform: translateY(-10px); } 100% { transform: translateY(0px); } }

.page-title { font-size: 32px; font-weight: 800; color: var(--text-color); margin: 0 0 12px 0; letter-spacing: -0.5px; }
.page-subtitle { font-size: 16px; color: var(--text-muted); margin-bottom: 40px; line-height: 1.7; max-width: 600px; margin-left: auto; margin-right: auto; }

/* --- کارت‌ها (Features Grid) --- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* ۳ ستون ثابت برای دسکتاپ */
    gap: 24px;
    width: 100%;
    margin-top: 20px;
}

.feature-card {
    background: var(--surface-color);
    padding: 30px 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    text-align: center;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 4px;
    background: var(--primary-color);
    opacity: 0;
    transition: opacity 0.3s;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}
.feature-card:hover::before { opacity: 1; }

.feature-icon { font-size: 36px; margin-bottom: 16px; display: block; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1)); }
.feature-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; color: var(--text-color); }
.feature-desc { font-size: 14px; color: var(--text-muted); line-height: 1.6; }

/* --- تنظیمات (Settings) --- */
.settings-container {
    background: var(--surface-color);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 650px;
    text-align: right;
    border: 1px solid var(--border-color);
    margin: 0 auto;
}

.setting-item { margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--border-color); }
.setting-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.setting-label { display: block; font-weight: 700; margin-bottom: 12px; font-size: 15px; color: var(--text-color); }

.form-control {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-color);
    font-family: inherit;
    font-size: 14px;
    transition: all 0.2s;
}
.form-control:focus { border-color: var(--primary-color); box-shadow: var(--shadow-focus); background: var(--surface-color); }

.btn-save {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    width: 100%;
    font-weight: bold;
    font-size: 15px;
    margin-top: 10px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}
.btn-save:hover { background-color: var(--primary-hover); transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* --- بوکمارک‌ها (Bookmarks) --- */
.bookmarks-bar {
    display: flex;
    gap: 12px;
    padding: 12px 24px;
    background: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none; /* Firefox */
}
.bookmarks-bar::-webkit-scrollbar { display: none; }

.bookmark-item {
    background: var(--bg-color);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: 13px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    user-select: none;
}
.bookmark-item:hover { background: var(--primary-color); color: white; border-color: var(--primary-color); transform: translateY(-2px); }
.bookmark-remove { color: var(--text-muted); font-weight: bold; margin-right: 4px; opacity: 0.6; }
.bookmark-item:hover .bookmark-remove { color: white; opacity: 1; }

/* --- مدیریت بوکمارک (Bookmark Manager) --- */
.bookmark-manager-container {
    width: 100%;
    max-width: 950px;
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    margin: 0 auto;
}

.bm-toolbar { display: flex; gap: 10px; margin-bottom: 24px; flex-wrap: wrap; align-items: center; }
.bm-btn {
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    background: var(--bg-color);
    color: var(--text-color);
    transition: all 0.2s;
}
.bm-btn:hover { background: var(--border-color); }
.bm-btn.active { background: var(--primary-color); color: white; border-color: var(--primary-color); box-shadow: var(--shadow-sm); }
.bm-btn.add-cat-btn { border-style: dashed; color: var(--primary-color); border-color: var(--primary-color); }

.bm-list { list-style: none; padding: 0; margin: 0; }
.bm-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
    border-radius: var(--radius-sm);
}
.bm-item:last-child { border-bottom: none; }
.bm-item:hover { background-color: var(--bg-color); }

.bm-info { display: flex; flex-direction: column; text-align: right; align-items: flex-start; gap: 4px; }
.bm-title { font-weight: 700; font-size: 15px; color: var(--text-color); }
.bm-url { font-size: 12px; color: var(--text-muted); direction: ltr; text-align: right; font-family: monospace; }
.bm-cat-tag { font-size: 11px; background: var(--bg-color); padding: 4px 8px; border-radius: 4px; margin-top: 4px; border: 1px solid var(--border-color); color: var(--text-muted); }

.bm-actions { display: flex; gap: 4px; }
.bm-action-btn {
    background: none; border: none; cursor: pointer; font-size: 18px; padding: 8px; border-radius: 50%;
    transition: background 0.2s;
}
.bm-action-btn:hover { background: rgba(255,0,0,0.1); color: #ef4444; }
.bm-action-btn.visit:hover { background: rgba(37, 99, 235, 0.1); color: var(--primary-color); }

/* --- تماس با ما (Contact) --- */
.contact-container {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 40px;
    background: var(--surface-color);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    width: 100%;
    text-align: right;
    margin-top: 20px;
}
.contact-info h3 { margin-top: 0; color: var(--primary-color); font-size: 20px; margin-bottom: 20px; }
.contact-info p { line-height: 2; color: var(--text-color); font-size: 15px; display: flex; align-items: center; gap: 10px; }
.contact-form { display: flex; flex-direction: column; gap: 16px; }
.submit-btn {
    background-color: var(--primary-color); color: white; padding: 14px;
    border: none; border-radius: var(--radius-sm); font-weight: bold; cursor: pointer;
    transition: all 0.2s; font-size: 15px;
}
.submit-btn:hover { background-color: var(--primary-hover); transform: translateY(-2px); }

/* --- مودال (Modal) --- */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0; top: 0; width: 100%; height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s;
}
.modal.show { display: block; opacity: 1; }
.modal-content {
    background-color: var(--surface-color);
    margin: 10% auto;
    padding: 30px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 450px;
    box-shadow: var(--shadow-lg);
    position: relative;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.close-btn {
    position: absolute;
    left: 20px;
    top: 20px;
    color: var(--text-muted);
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}
.close-btn:hover { color: var(--text-color); }

.cat-list-item { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border-color); align-items: center; }
.cat-actions button { background: none; border: none; cursor: pointer; font-size: 18px; margin-left: 8px; color: var(--text-muted); transition: color 0.2s; }
.cat-actions button:hover { color: #ef4444; }

/* --- فوتر (Footer) --- */
footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    text-align: center;
    padding: 16px;
    font-size: 12px;
    border-top: 1px solid #334155;
    flex-shrink: 0;
}

/* --- ریسپانسیو (Responsive) --- */
@media (max-width: 1024px) {
    .features-grid { grid-template-columns: repeat(2, 1fr); } /* تبلت: ۲ ستون */
    .contact-container { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .page-screen { padding: 20px 16px 80px 16px; justify-content: flex-start; }
    .page-title { font-size: 24px; }
    .features-grid { grid-template-columns: 1fr; } /* موبایل: ۱ ستون */
    nav { padding: 0 12px; height: 56px; }
    .nav-text { display: none; } /* مخفی کردن متن منو در موبایل */
    .logo-icon-svg { width: 70px; height: 70px; }
    .bm-item { flex-direction: column; align-items: flex-start; gap: 12px; }
    .bm-actions { width: 100%; justify-content: flex-end; }
    .settings-container, .bookmark-manager-container { padding: 20px; }
    .modal-content { width: 95%; margin: 20% auto; padding: 20px; }
}

/* =========================================
   استایل‌های جدید برای منوی سه‌نقطه (More Menu)
   نسخه 2026: پایدار، دقیق و تعاملی
   ========================================= */

/* دکمه منوی اصلی (سه‌نقطه) */
.more-menu-btn {
    background: transparent;
    border: none;
    color: #e2e8f0;
    font-size: 24px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1002;
}

.more-menu-btn:hover,
.more-menu-btn.active {
    background-color: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* موقعیت‌دهی منوی کشویی به سمت چپ */
.dropdown-left {
    right: 0; /* چسبیده به سمت چپ دکمه */
    left: auto;
}