/* ============================================================
   JooGra — Design System
   ------------------------------------------------------------
   Direction: quiet, precise, content-first. Neutral cool ink on
   near-white (and deep blue-black in dark), one brand blue taken
   from the logo, and ONE signature moment: the search bar, whose
   focus state is wrapped in a slowly rotating brand-gradient ring.
   Everything else stays flat and disciplined so results lead.
   ============================================================ */

@font-face {
    font-family: IRANSansX;
    font-style: normal;
    /* One physical file: declare the range so the browser does not
       fake-bold (smeared glyphs). Hierarchy comes from size + color. */
    font-weight: 400 700;
    font-display: swap;
    src: url('../fonts/woff2/IRANSansX-MediumD4.woff2') format('woff2'),
         url('../fonts/woff/IRANSansX-MediumD4.woff') format('woff');
}

/* animatable angle for the signature search ring */
@property --ring-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: true;
}

/* ============================================================
   Tokens
   ============================================================ */
:root {
    color-scheme: light;

    --font: IRANSansX, Vazirmatn, "Segoe UI", Tahoma, system-ui, sans-serif;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

    /* Surfaces */
    --bg: #FAFBFD;
    --bg-solid: #FAFBFD;
    --surface: #FFFFFF;
    --surface-2: #F1F3F8;
    --card-solid: #FFFFFF;

    /* Ink */
    --text-main: #0E1322;
    --text-muted: #566078;
    --text-faint: #8791A8;
    --secondary: #566078;

    /* Brand */
    --accent: #0A66E8;
    --accb: #0A66E8;
    --primary: #0A66E8;
    --accent-strong: #0850BA;
    --accent-soft: rgba(10, 102, 232, 0.09);
    --accent-ring: rgba(10, 102, 232, 0.28);
    --visited: #6A4BD6;
    --hot: #EF6A1F;
    --grad-brand: linear-gradient(135deg, #0078FE 0%, #5B6CF5 55%, #8B5CF6 100%);
    --logo-start: #0078FE;
    --logo-end: #4A70AE;

    /* Gold — kept for legacy components */
    --gold: #B8863E;
    --gold-strong: #96692C;
    --gold-soft: rgba(184, 134, 62, 0.13);

    /* Lines */
    --border: rgba(14, 19, 34, 0.13);
    --border-subtle: rgba(14, 19, 34, 0.08);
    --divider: rgba(14, 19, 34, 0.08);
    --hover-bg: rgba(14, 19, 34, 0.04);

    /* Elevation */
    --radius: 18px;
    --shadow-xs: 0 1px 2px rgba(14, 19, 34, 0.06);
    --shadow-sm: 0 1px 2px rgba(14, 19, 34, 0.05), 0 4px 14px rgba(14, 19, 34, 0.05);
    --shadow-md: 0 2px 6px rgba(14, 19, 34, 0.06), 0 14px 32px rgba(14, 19, 34, 0.09);
    --shadow-lg: 0 8px 20px rgba(14, 19, 34, 0.08), 0 30px 70px rgba(14, 19, 34, 0.16);
    --shadow: var(--shadow-xs);
    --glass-shadow: var(--shadow-lg);
    --gold-shadow: 0 10px 26px rgba(184, 134, 62, 0.18), 0 2px 6px rgba(14, 19, 34, 0.06);
    --accent-shadow: 0 6px 20px rgba(10, 102, 232, 0.2);

    /* Glass — only for header / dropdowns / overlays */
    --glass-bg: rgba(255, 255, 255, 0.88);
    --glass-bg-strong: rgba(255, 255, 255, 0.97);
    --glass-blur: blur(14px);
    --glass-border: 1px solid rgba(14, 19, 34, 0.10);
    --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.6);
    --header-bg: rgba(250, 251, 253, 0.82);
    --input-bg: #FFFFFF;

    /* Component tokens */
    --btn-bg: #FFFFFF;
    --btn-text: #0A66E8;
    --btn-hover-border: rgba(10, 102, 232, 0.4);
    --btn-hover-text: #0E1322;
    --news-border: rgba(14, 19, 34, 0.08);
    --news-bg: transparent;
    --news-title: #0E1322;
    --news-text: #566078;
    --favicon-bg: transparent;
    --skeleton: rgba(14, 19, 34, 0.07);
    --skeleton-hi: rgba(14, 19, 34, 0.13);

    /* Image viewer (always dark) */
    --viewer-bg: rgba(8, 10, 16, 0.92);
    --viewer-img-bg: rgba(255, 255, 255, 0.04);
    --viewer-text: #F1F4FA;
    --viewer-text-muted: rgba(241, 244, 250, 0.64);
    --close-btn-bg: rgba(255, 255, 255, 0.12);

    /* Home atmosphere */
    --glow-1: rgba(0, 120, 254, 0.12);
    --glow-2: rgba(139, 92, 246, 0.10);
    --glow-3: rgba(20, 184, 166, 0.05);
}

[data-theme="dark"] {
    color-scheme: dark;

    --bg: #0A0C12;
    --bg-solid: #0A0C12;
    --surface: #12151E;
    --surface-2: #1A1E2A;
    --card-solid: #12151E;

    --text-main: #E9EDF7;
    --text-muted: #98A2BA;
    --text-faint: #6C7690;
    --secondary: #98A2BA;

    --accent: #6AB0FF;
    --accb: #6AB0FF;
    --primary: #6AB0FF;
    --accent-strong: #9CCBFF;
    --accent-soft: rgba(106, 176, 255, 0.13);
    --accent-ring: rgba(106, 176, 255, 0.34);
    --visited: #B79CFF;
    --hot: #FF8A4C;

    --gold: #E4B96E;
    --gold-strong: #F0CA85;
    --gold-soft: rgba(228, 185, 110, 0.16);

    --border: rgba(255, 255, 255, 0.14);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --divider: rgba(255, 255, 255, 0.08);
    --hover-bg: rgba(255, 255, 255, 0.05);

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35), 0 4px 14px rgba(0, 0, 0, 0.28);
    --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.4), 0 14px 32px rgba(0, 0, 0, 0.42);
    --shadow-lg: 0 8px 20px rgba(0, 0, 0, 0.45), 0 30px 70px rgba(0, 0, 0, 0.6);
    --gold-shadow: 0 12px 28px rgba(228, 185, 110, 0.14), 0 2px 6px rgba(0, 0, 0, 0.3);
    --accent-shadow: 0 6px 22px rgba(106, 176, 255, 0.26);

    --glass-bg: rgba(18, 21, 30, 0.86);
    --glass-bg-strong: rgba(22, 26, 38, 0.97);
    --glass-border: 1px solid rgba(255, 255, 255, 0.11);
    --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    --header-bg: rgba(10, 12, 18, 0.80);
    --input-bg: #161A25;

    --btn-bg: rgba(255, 255, 255, 0.06);
    --btn-text: #E9EDF7;
    --btn-hover-border: rgba(106, 176, 255, 0.45);
    --btn-hover-text: #FFFFFF;
    --news-border: rgba(255, 255, 255, 0.08);
    --news-title: #E9EDF7;
    --news-text: #98A2BA;
    --skeleton: rgba(255, 255, 255, 0.06);
    --skeleton-hi: rgba(255, 255, 255, 0.12);

    --viewer-bg: rgba(5, 6, 10, 0.94);
    --close-btn-bg: rgba(255, 255, 255, 0.12);

    --glow-1: rgba(61, 150, 255, 0.17);
    --glow-2: rgba(139, 92, 246, 0.15);
    --glow-3: rgba(20, 184, 166, 0.07);
}

/* ============================================================
   Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-main);
    background: var(--bg-solid);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    font-feature-settings: "kern" on, "liga" on, "calt" on;
    transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}

a { text-decoration: none; color: inherit; }
button, input, select, textarea { font-family: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }

::selection { background: var(--accent-ring); }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 8px;
}

/* thin, quiet scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 20px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); background-clip: content-box; border: 3px solid transparent; }

.skip-link {
    position: absolute; top: -60px; right: 16px; z-index: 10001;
    background: var(--accent); color: #fff; padding: 10px 18px; border-radius: 12px;
    transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 12px; }

/* Glass utility */
.glass {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    box-shadow: var(--glass-shadow), var(--glass-highlight);
}

/* Skeleton */
@keyframes shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}
.skeleton {
    background: linear-gradient(90deg, var(--skeleton) 25%, var(--skeleton-hi) 50%, var(--skeleton) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite linear;
    border-radius: 8px;
}
.skeleton-img { aspect-ratio: 4 / 3; border-radius: 16px; }

/* ============================================================
   Search box — the signature element
   ============================================================ */
.search-box-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    z-index: 1001;
    --ring-angle: 0deg;
    animation: ringSpin 7s linear infinite paused;
}
.search-box-wrapper:focus-within { animation-play-state: running; }
@keyframes ringSpin { to { --ring-angle: 360deg; } }

/* gradient ring (becomes the border on focus) */
.search-box-wrapper::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 999px;
    background: conic-gradient(from var(--ring-angle), #0078FE, #8B5CF6, #14B8A6, #0078FE);
    opacity: 0;
    z-index: -1;
    transition: opacity 0.35s var(--ease);
    pointer-events: none;
}
/* soft glow under it */
.search-box-wrapper::after {
    content: '';
    position: absolute;
    inset: 6px 14px -8px;
    border-radius: 999px;
    background: conic-gradient(from var(--ring-angle), #0078FE, #8B5CF6, #14B8A6, #0078FE);
    filter: blur(22px);
    opacity: 0;
    z-index: -2;
    transition: opacity 0.45s var(--ease);
    pointer-events: none;
}
.search-box-wrapper:focus-within::before { opacity: 1; }
.search-box-wrapper:focus-within::after { opacity: 0.30; }
[data-theme="dark"] .search-box-wrapper:focus-within::after { opacity: 0.38; }

.search-input {
    width: 100%;
    height: 58px;
    padding: 0 60px 0 54px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--input-bg);
    color: var(--text-main);
    font-size: 16.5px;
    line-height: 1.5;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), background-color 0.25s var(--ease);
    -webkit-appearance: none;
    appearance: none;
}
.search-input::placeholder { color: var(--text-faint); opacity: 1; }
.search-input:hover { box-shadow: var(--shadow-md); border-color: var(--border); }
.search-input:focus { outline: none; border-color: transparent; box-shadow: none; }

/* submit button (right edge in RTL) */
.search-icon-btn {
    position: absolute;
    right: 9px;
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    border-radius: 50%;
    padding: 0;
    transition: background-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
}
.search-icon-btn:hover { background: var(--hover-bg); color: var(--text-main); }
.search-box-wrapper:focus-within .search-icon-btn { color: var(--accent); }
/* once there is something to submit, the button becomes the call to action */
.search-input:not(:placeholder-shown) ~ .search-icon-btn { background: var(--accent); color: #fff; }
[data-theme="dark"] .search-input:not(:placeholder-shown) ~ .search-icon-btn { color: #07101F; }
.search-input:not(:placeholder-shown) ~ .search-icon-btn:hover { transform: scale(1.06); background: var(--accent-strong); }
[data-theme="dark"] .search-input:not(:placeholder-shown) ~ .search-icon-btn:hover { background: var(--accent-strong); }

/* clear button (left edge) */
.search-clear {
    position: absolute;
    left: 12px;
    width: 32px; height: 32px;
    display: none;
    align-items: center; justify-content: center;
    background: transparent; border: none; border-radius: 50%;
    color: var(--text-faint); padding: 0;
    transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.search-clear:hover { background: var(--hover-bg); color: var(--text-main); }
.search-input:not(:placeholder-shown) ~ .search-clear { display: flex; }

/* "/" shortcut hint */
.search-kbd {
    position: absolute;
    left: 18px;
    display: none;
    align-items: center; justify-content: center;
    min-width: 26px; height: 26px; padding: 0 8px;
    font-family: inherit; font-size: 13px; color: var(--text-faint);
    border: 1px solid var(--border); border-radius: 8px;
    background: var(--surface-2);
    pointer-events: none;
}
.search-input:placeholder-shown:not(:focus) ~ .search-kbd { display: flex; }
@media (hover: none) { .search-kbd { display: none !important; } }

/* Autocomplete */
.autocomplete-results {
    position: absolute;
    top: calc(100% + 10px);
    left: 0; right: 0;
    background: var(--glass-bg-strong);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--border-subtle);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    max-height: 360px;
    overflow-y: auto;
    display: none;
    padding: 8px;
    text-align: right;
    animation: popIn 0.18s var(--ease-out);
}
@keyframes popIn { from { opacity: 0; transform: translateY(-6px) scale(0.99); } to { opacity: 1; transform: none; } }

.suggestion-item {
    padding: 11px 14px;
    display: flex; align-items: center; gap: 12px;
    cursor: pointer;
    border-radius: 14px;
    transition: background-color 0.15s var(--ease);
}
.suggestion-item span {
    flex: 1;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    font-size: 15px; color: var(--text-main); text-align: right; line-height: 1.5;
}
.suggestion-item:hover, .suggestion-item.active { background: var(--accent-soft); }
.suggestion-item svg { flex-shrink: 0; color: var(--text-faint); }
.suggestion-item:hover svg, .suggestion-item.active svg { color: var(--accent); }
.suggestion-highlight { color: var(--accent); background: var(--accent-soft); border-radius: 5px; padding: 0 2px; }

/* ============================================================
   Home
   ============================================================ */
#home-view {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-height: 100vh; min-height: 100dvh;
    padding: 24px 20px 12vh;
    text-align: center;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(900px 520px at 88% -8%, var(--glow-1), transparent 62%),
        radial-gradient(820px 520px at 6% 108%, var(--glow-2), transparent 62%),
        radial-gradient(640px 400px at 50% 50%, var(--glow-3), transparent 68%);
}

.home-logo {
    width: 100%;
    max-width: 250px;
    margin: 0 auto 38px;
    display: flex; justify-content: center; align-items: center;
    user-select: none;
    animation: homeIn 0.8s var(--ease-out) both;
}
.logo-img {
    width: 100%; height: auto; display: block;
    filter: drop-shadow(0 8px 22px rgba(36, 45, 110, 0.16));
}
[data-theme="dark"] .logo-img { filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.55)); }

.home-search-container {
    width: 100%;
    max-width: 680px;
    animation: homeIn 0.8s var(--ease-out) 0.08s both;
}

.trending-searches {
    margin-top: 28px;
    display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
    gap: 10px 12px;
    font-size: 13px;
    color: var(--text-muted);
    animation: homeIn 0.8s var(--ease-out) 0.16s both;
}
.trending-label { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); }
.trending-label svg { color: var(--hot); }
.trending-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.trend-tag {
    font-size: 13px;
    padding: 7px 16px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
    box-shadow: var(--shadow-xs);
    transition: border-color 0.2s var(--ease), color 0.2s var(--ease), background-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.trend-tag:hover {
    color: var(--accent);
    border-color: var(--accent-ring);
    background: var(--accent-soft);
    box-shadow: var(--shadow-sm);
}

@keyframes homeIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ============================================================
   Results header
   ============================================================ */
#results-view { display: none; width: 100%; }

.header {
    position: sticky; top: 0; z-index: 100;
    background: var(--header-bg);
    backdrop-filter: saturate(1.6) blur(18px);
    -webkit-backdrop-filter: saturate(1.6) blur(18px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 14px 0 0;
    transition: box-shadow 0.25s var(--ease);
}
.header.is-scrolled { box-shadow: 0 8px 28px rgba(14, 19, 34, 0.07); }
[data-theme="dark"] .header.is-scrolled { box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45); }

.header-top {
    display: flex; align-items: center; gap: 28px;
    max-width: 1200px; margin: 0 auto; padding: 0 20px;
}
.small-logo {
    font-size: 23px;
    font-weight: 700;
    letter-spacing: -0.4px;
    background: linear-gradient(135deg, var(--logo-start), var(--logo-end));
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    cursor: pointer;
    flex-shrink: 0;
    direction: ltr;
}
.header-search { flex: 1; max-width: 690px; }
.header-search .search-input {
    height: 46px;
    font-size: 15.5px;
    padding: 0 50px 0 46px;
    background: var(--surface-2);
    border-color: transparent;
    box-shadow: none;
}
.header-search .search-input:hover { background: var(--surface); border-color: var(--border); box-shadow: var(--shadow-sm); }
.header-search .search-input:focus { background: var(--surface); border-color: transparent; box-shadow: none; }
.header-search .search-icon-btn { width: 34px; height: 34px; right: 6px; }
.header-search .search-clear { left: 8px; width: 30px; height: 30px; }

/* Tabs — underline led */
.tabs-nav {
    display: flex; align-items: center; gap: 2px;
    max-width: 1200px; margin: 8px auto 0; padding: 0 14px;
    position: relative;
    overflow-x: auto;
    scrollbar-width: none;
}
.tabs-nav::-webkit-scrollbar { display: none; }
.tab-btn {
    display: flex; align-items: center; gap: 8px;
    padding: 13px 16px;
    font-size: 14.5px;
    color: var(--text-muted);
    white-space: nowrap;
    position: relative; z-index: 2;
    border: none; background: transparent;
    border-radius: 12px 12px 0 0;
    transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.tab-btn:hover { color: var(--text-main); background: var(--hover-bg); }
.tab-btn.active { color: var(--accent); }
.tab-btn svg { flex-shrink: 0; }
.tab-slider {
    position: absolute; bottom: 0; left: 0; width: 0; height: 3px;
    background: var(--accent);
    border-radius: 3px 3px 0 0;
    transition: left 0.3s var(--ease), width 0.3s var(--ease);
}

/* ============================================================
   Main grid
   ============================================================ */
.main-container {
    max-width: 1200px; width: 100%;
    margin: 0 auto;
    padding: 24px 20px 96px;
    display: grid;
    grid-template-columns: 652px 1fr;
    gap: 72px;
}
.main-container.is-image-tab { grid-template-columns: 1fr; max-width: 100%; padding: 28px 4% 96px; }
.main-container.is-image-tab .sidebar { display: none; }

/* ---------- Web results: flat, no cards ---------- */
.result-item {
    margin: 0 -14px 4px;
    padding: 14px;
    border-radius: 16px;
    animation: revealUp 0.4s var(--ease-out) both;
    transition: background-color 0.15s var(--ease);
}
.result-item:nth-child(1) { animation-delay: 0.02s; }
.result-item:nth-child(2) { animation-delay: 0.05s; }
.result-item:nth-child(3) { animation-delay: 0.08s; }
.result-item:nth-child(4) { animation-delay: 0.11s; }
.result-item:hover { background: var(--hover-bg); }

.result-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; min-width: 0; }
.favicon {
    width: 30px; height: 30px; flex-shrink: 0;
    padding: 5px;
    border-radius: 50%;
    object-fit: contain;
    background: var(--surface);
    border: 1px solid var(--border-subtle);
}
.site-info { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.site-name { font-size: 14px; color: var(--text-main); }
.site-url {
    font-size: 12.5px; color: var(--text-faint);
    direction: ltr; text-align: right;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.result-title {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; text-overflow: ellipsis;
    font-size: 20px; line-height: 1.55;
    color: var(--accent);
    margin-bottom: 4px;
}
.result-title:visited { color: var(--visited); }
.result-title:hover { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
.result-desc {
    margin: 0;
    display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; text-overflow: ellipsis;
    font-size: 14.5px; line-height: 1.9;
    color: var(--text-muted);
}

/* ---------- Related searches ---------- */
.related-box { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border-subtle); }
.related-title { font-size: 17px; margin-bottom: 14px; color: var(--text-main); }
.related-items { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.related-link {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px;
    border-radius: 999px;
    font-size: 14.5px;
    background: var(--surface-2);
    border: 1px solid transparent;
    transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.related-link svg { flex-shrink: 0; color: var(--text-faint); transition: color 0.2s var(--ease); }
.related-link:hover { background: var(--accent-soft); border-color: var(--accent-ring); color: var(--accent); }
.related-link:hover svg { color: var(--accent); }

/* ---------- Inline images strip ---------- */
.inline-image-results {
    margin: 14px -14px 18px;
    padding: 16px 0 12px;
    border: 1px solid var(--border-subtle);
    border-radius: 22px;
    background: var(--surface);
}
.inline-image-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; padding: 0 18px; }
.inline-image-title { font-size: 16px; color: var(--text-main); }
.see-more-images {
    background: none; border: none; font-size: 13.5px; color: var(--accent);
    padding: 6px 12px; border-radius: 999px;
    transition: background-color 0.2s var(--ease);
}
.see-more-images:hover { background: var(--accent-soft); }
.inline-image-scroll {
    display: flex; gap: 10px;
    overflow-x: auto; padding: 4px 18px 8px;
    scroll-snap-type: x proximity;
}
.inline-img-card {
    flex: 0 0 auto; width: 156px; height: 112px;
    border-radius: 14px; overflow: hidden;
    cursor: pointer; background: var(--surface-2);
    scroll-snap-align: start;
    transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease);
}
.inline-img-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.inline-img-card img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Image grid ---------- */
.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.img-card {
    position: relative;
    background: var(--surface-2);
    border-radius: 16px; overflow: hidden; cursor: pointer;
    aspect-ratio: 4 / 3;
    animation: revealUp 0.45s var(--ease-out) both;
    transition: transform 0.28s var(--ease-out), box-shadow 0.28s var(--ease);
}
.img-card:nth-child(5n+1) { animation-delay: 0.02s; }
.img-card:nth-child(5n+2) { animation-delay: 0.05s; }
.img-card:nth-child(5n+3) { animation-delay: 0.08s; }
.img-card:nth-child(5n+4) { animation-delay: 0.11s; }
.img-card:nth-child(5n+5) { animation-delay: 0.14s; }
.img-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.img-card > img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.5s var(--ease-out); }
.img-card:hover > img { transform: scale(1.05); }
.img-info {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 36px 12px 11px;
    background: linear-gradient(to top, rgba(5, 7, 12, 0.82) 0%, rgba(5, 7, 12, 0.3) 60%, transparent 100%);
    display: flex; flex-direction: column; justify-content: flex-end;
}
.img-title {
    font-size: 12.5px; color: #FFFFFF; margin-bottom: 4px; line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis;
}
.img-domain { font-size: 11px; color: rgba(255, 255, 255, 0.78); display: flex; align-items: center; gap: 6px; }
.img-domain img { width: 14px; height: 14px; border-radius: 50%; background: #fff; padding: 1px; }
/* on pointer devices, captions appear on hover only */
@media (hover: hover) {
    .img-info { opacity: 0; transform: translateY(6px); transition: opacity 0.25s var(--ease), transform 0.25s var(--ease); }
    .img-card:hover .img-info, .img-card:focus-visible .img-info { opacity: 1; transform: none; }
}

/* ---------- News ---------- */
.news-item {
    display: flex; gap: 18px;
    margin: 0 -14px 4px;
    padding: 14px;
    border-radius: 16px;
    animation: revealUp 0.4s var(--ease-out) both;
    transition: background-color 0.15s var(--ease);
    color: inherit;
}
.news-item:nth-child(1) { animation-delay: 0.02s; }
.news-item:nth-child(2) { animation-delay: 0.05s; }
.news-item:nth-child(3) { animation-delay: 0.08s; }
.news-item:nth-child(4) { animation-delay: 0.11s; }
.news-item:hover { background: var(--hover-bg); }
.news-content { flex: 1; min-width: 0; }
.news-source-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.news-source-name { font-size: 13px; color: var(--text-muted); }
.news-time { font-size: 12px; color: var(--text-faint); }
.news-title {
    display: block; margin-bottom: 6px;
    font-size: 17.5px; line-height: 1.6; color: var(--accent);
}
.news-title:visited { color: var(--visited); }
.news-title:hover { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
.news-image { width: 124px; height: 100px; border-radius: 14px; object-fit: cover; flex-shrink: 0; background: var(--surface-2); }

/* ---------- Knowledge panel ---------- */
.sidebar { padding-top: 6px; }
body:not(.is-province-mode) .knowledge-panel {
    position: sticky; top: 150px;
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: 24px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
body.is-province-mode .knowledge-panel { border: none; box-shadow: none; padding: 0; position: relative; top: 0; }

.kp-title { margin: 0 0 8px; font-size: 22px; line-height: 1.5; word-break: break-word; }
.kp-desc { margin: 0; font-size: 14.5px; line-height: 1.9; color: var(--text-muted); }
.kp-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.kp-chip {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 15px;
    font-size: 13.5px;
    color: var(--text-main);
    background: var(--surface-2);
    border: 1px solid transparent;
    border-radius: 999px;
    transition: background-color 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.kp-chip:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-ring); }

/* ---------- Empty / error ---------- */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 88px 20px; text-align: center; }
.empty-icon-wrap {
    width: 92px; height: 92px; margin-bottom: 24px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
}
.empty-icon { width: 44px; height: 44px; color: var(--secondary); opacity: 0.6; }
.empty-icon-wrap .empty-icon { color: var(--accent); opacity: 1; }
.empty-title { font-size: 22px; margin: 0 0 10px; color: var(--text-main); }
.empty-desc { font-size: 15px; color: var(--text-muted); margin: 0 0 30px; max-width: 460px; line-height: 1.9; }
.empty-desc strong { color: var(--text-main); }
.empty-error { color: var(--error-color, #D6403F); margin: 0 0 22px; font-size: 15px; }

.report-btn {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 12px 24px;
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-main);
    border: 1px solid var(--border);
    transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.report-btn:hover { border-color: var(--accent-ring); color: var(--accent); background: var(--accent-soft); }

.btn {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 10px 22px;
    border-radius: 999px;
    font-size: 14px;
    transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.btn:hover { border-color: var(--accent-ring); color: var(--accent); background: var(--accent-soft); }

/* ---------- Toast ---------- */
.toast {
    position: fixed; bottom: 28px; right: 50%;
    transform: translate(50%, 24px);
    background: var(--text-main); color: var(--bg-solid);
    padding: 12px 22px; border-radius: 999px;
    font-size: 14px; box-shadow: var(--shadow-lg);
    opacity: 0; pointer-events: none; z-index: 10002;
    transition: opacity 0.25s var(--ease), transform 0.35s var(--ease-out);
    max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(50%, 0); }

/* ---------- Theme toggle ---------- */
.theme-toggle-btn {
    position: fixed; bottom: 24px; left: 24px;
    width: 46px; height: 46px;
    border-radius: 50%;
    background: var(--glass-bg-strong);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    color: var(--text-main);
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-md);
    z-index: 900;
    transition: transform 0.25s var(--ease-out), border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.theme-toggle-btn:hover { transform: rotate(18deg) scale(1.06); border-color: var(--accent-ring); }
.theme-toggle-btn svg { transition: transform 0.4s var(--ease-out); }
.sun-icon { display: none; }
[data-theme="dark"] .sun-icon { display: block; color: var(--gold); }
[data-theme="dark"] .moon-icon { display: none; }

/* ============================================================
   Image viewer
   ============================================================ */
#image-viewer {
    position: fixed; inset: 0;
    background: var(--viewer-bg);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    z-index: 2000;
    display: none;
    animation: fadeIn 0.2s var(--ease);
}
.viewer-content { display: flex; width: 100%; height: 100%; }
.viewer-img-box {
    position: relative;
    flex: 1; min-width: 0;
    display: flex; align-items: center; justify-content: center;
    padding: 64px 72px;
}
.viewer-img-box img {
    max-width: 100%; max-height: 100%;
    border-radius: 16px;
    object-fit: contain;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    animation: zoomIn 0.3s var(--ease-out);
}
@keyframes zoomIn { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: none; } }

.viewer-nav {
    position: absolute; top: 50%; margin-top: -24px;
    width: 48px; height: 48px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.10); color: #fff;
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    transition: background-color 0.2s var(--ease), transform 0.2s var(--ease);
    z-index: 2;
}
.viewer-nav:hover { background: rgba(255, 255, 255, 0.22); transform: scale(1.06); }
.viewer-nav-prev { right: 16px; }
.viewer-nav-next { left: 16px; }

.viewer-side {
    width: 380px; flex-shrink: 0;
    padding: 76px 30px 30px;
    background: rgba(255, 255, 255, 0.04);
    border-inline-start: 1px solid rgba(255, 255, 255, 0.08);
    display: flex; flex-direction: column; overflow-y: auto;
}
.viewer-side h2 { font-size: 21px; line-height: 1.65; color: var(--viewer-text); margin: 0 0 14px; }
.viewer-side p { font-size: 15px; color: var(--viewer-text-muted); margin: 0 0 30px; display: flex; align-items: center; gap: 10px; }
.viewer-side p img { width: 20px; height: 20px; border-radius: 50%; background: #fff; padding: 2px; }
.viewer-cta {
    display: block; margin-top: auto;
    padding: 14px; border-radius: 999px;
    background: #0A66E8; color: #fff;
    text-align: center; font-size: 15px;
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background-color 0.2s var(--ease);
}
.viewer-cta:hover { background: #1A74F5; transform: translateY(-2px); box-shadow: 0 12px 30px rgba(10, 102, 232, 0.42); }

.close-viewer-btn {
    position: absolute; top: 20px; left: 20px; z-index: 2010;
    width: 42px; height: 42px;
    display: flex; align-items: center; justify-content: center;
    background: var(--close-btn-bg); color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 50%;
    transition: background-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.close-viewer-btn:hover { background: rgba(255, 255, 255, 0.24); transform: scale(1.06) rotate(90deg); }

/* ============================================================
   Animations
   ============================================================ */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes revealUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes blink { 0% { opacity: 1; } 50% { opacity: 0.5; } 100% { opacity: 1; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(31, 157, 107, 0.7); } 70% { box-shadow: 0 0 0 10px rgba(31, 157, 107, 0); } 100% { box-shadow: 0 0 0 0 rgba(31, 157, 107, 0); } }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1100px) {
    .main-container { grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; }
}

@media (max-width: 900px) {
    body:not(.is-province-mode) .sidebar { display: none !important; }
    body:not(.is-province-mode) .main-container { display: block !important; }
    .main-container { padding: 14px 18px 96px; }
    .main-container.is-image-tab { padding: 16px 14px 96px; }
    .is-province-mode .main-container { display: flex !important; flex-direction: column !important; padding: 10px !important; }
    .is-province-mode .sidebar { display: block !important; width: 100% !important; order: 2 !important; }
    .is-province-mode #content-area { order: 1 !important; }

    .news-item { flex-direction: column-reverse; }
    .news-image { width: 100% !important; height: 190px !important; }
    .related-items { grid-template-columns: 1fr; }

    #image-viewer { overflow-y: auto; }
    .viewer-content { flex-direction: column; height: auto; min-height: 100%; }
    .viewer-img-box { padding: 72px 16px 20px; height: 62vh; flex: none; }
    .viewer-nav { width: 42px; height: 42px; margin-top: -10px; }
    .viewer-nav-prev { right: 10px; }
    .viewer-nav-next { left: 10px; }
    .viewer-side { width: 100%; padding: 26px 22px 32px; border-inline-start: none; border-top: 1px solid rgba(255, 255, 255, 0.08); }
    .viewer-cta { margin-top: 8px; }
    .close-viewer-btn { top: 14px; left: 14px; width: 40px; height: 40px; }
}

@media (max-width: 640px) {
    .header { padding-top: 10px; }
    .header-top { gap: 12px; padding: 0 14px; }
    .small-logo { font-size: 19px; }
    .header-search .search-input { height: 44px; font-size: 16px; }
    .tabs-nav { padding: 0 8px; }
    .tab-btn { padding: 12px 12px; font-size: 14px; }

    #home-view { padding-bottom: 8vh; }
    .home-logo { max-width: 200px; margin-bottom: 30px; }
    .search-input { height: 54px; font-size: 16px; padding-right: 56px; }
    .trending-label { width: 100%; justify-content: center; }

    .result-item, .news-item { margin-inline: -10px; padding: 12px 10px; }
    .result-title { font-size: 18.5px; }
    .inline-image-results { margin-inline: -4px; }
    .image-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .theme-toggle-btn { width: 42px; height: 42px; bottom: 16px; left: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
    .search-box-wrapper { animation: none; }
}

/* ============================================================
   Legacy components (province / dashboards / widgets)
   Kept so other pages built on this stylesheet keep working.
   ============================================================ */

/* City Explorer */
.city-explorer { margin: 32px auto 0; width: 100%; animation: fadeIn 0.8s ease; max-width: 450px; }
.explorer-title { font-size: 14px; color: var(--text-muted); margin-bottom: 14px; }
.city-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.city-card {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 12px; padding: 15px 10px;
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: 16px; cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: var(--shadow-xs);
    user-select: none;
}
.city-card:hover { border-color: var(--accent-ring); transform: translateY(-3px); box-shadow: var(--shadow-md); }
.city-icon { width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; }
.city-img { width: 100%; height: 100%; object-fit: contain; transition: transform 0.3s ease; }
.city-card:hover .city-img { transform: scale(1.08); }
.city-name { font-size: 14px; color: var(--text-main); text-align: center; }

/* Province Panel */
.province-special-card {
    position: relative; width: 95%; max-width: 500px; margin: 30px auto 15px;
    padding: 20px 15px;
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius); cursor: pointer; overflow: hidden;
    transition: all 0.25s ease;
    box-shadow: var(--shadow-xs);
}
.province-special-card:hover { box-shadow: var(--shadow-md); border-color: var(--accent-ring); }
.province-card-inner { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.province-text-side { flex: 1; min-width: 0; }
.province-text-side h4 { margin: 0 0 4px; font-size: clamp(16px, 4vw, 19px); color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.province-text-side p { margin: 0; font-size: clamp(11px, 3vw, 13px); color: var(--text-muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.province-visual-side { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.img-container { position: relative; width: 50px; height: 50px; }
.floating-img { width: 100%; height: 100%; object-fit: contain; position: relative; z-index: 2; }
.map-bg-icon { position: absolute; inset: -5px; color: var(--accent); opacity: 0.14; }
.province-badge {
    position: absolute; top: 0; left: 20px;
    background: var(--grad-brand);
    color: white; font-size: 9px; padding: 2px 10px;
    border-radius: 0 0 8px 8px; letter-spacing: 0.5px;
}

@media (max-width: 360px) {
    .province-card-inner { gap: 5px; }
    .province-visual-side { gap: 5px; }
    .img-container { width: 40px; height: 40px; }
}

.province-panel {
    background: var(--surface);
    border-radius: var(--radius); overflow: hidden;
    border: 1px solid var(--border-subtle);
    animation: fadeIn 0.6s ease-out;
    box-shadow: var(--shadow-sm);
}
.province-header { position: relative; height: 180px; background: url('https://itto.org/iran/image-bin/190503105240hspvi1hpyi.jpg') center/cover; }
.province-header-overlay { position: absolute; bottom: 0; right: 0; left: 0; padding: 20px; background: linear-gradient(transparent, rgba(0, 0, 0, 0.75)); color: white; }
.province-content { padding: 20px; }

.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 20px; }
.stat-item { background: var(--surface-2); padding: 10px; border-radius: 12px; text-align: center; }
.stat-val { display: block; font-size: 14px; color: var(--gold-strong); }
[data-theme="dark"] .stat-val { color: var(--gold); }
.stat-lbl { font-size: 11px; color: var(--secondary); }

.news-section-title { font-size: 16px; margin: 15px 0 10px; display: flex; align-items: center; gap: 8px; }
.mini-news-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border-subtle); cursor: pointer; }
.mini-news-item:last-child { border: none; }
.mini-news-img { width: 60px; height: 60px; border-radius: 10px; object-fit: cover; }
.mini-news-text { font-size: 13px; line-height: 1.5; color: var(--text-main); }
.action-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.chip {
    padding: 6px 15px; border-radius: 999px;
    background: var(--surface-2);
    font-size: 12px; border: 1px solid transparent;
    transition: all 0.2s; cursor: pointer;
}
.chip:hover { border-color: var(--accent-ring); color: var(--accent); background: var(--accent-soft); }
.chip.active-chip { background: var(--grad-brand) !important; color: white !important; border-color: transparent !important; }

/* Province mode */
.is-province-mode .tabs-nav,
.is-province-mode .tabs-container { display: none !important; }
.is-province-mode .header { padding-bottom: 12px; }
@media (max-width: 900px) {
    .is-province-mode .main-container { margin-top: 0 !important; padding-top: 10px !important; }
}
.is-province-mode #related-area { display: none !important; }

#province-details-container { transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); transform: translateY(10px); opacity: 0; }
.detail-item:hover { background: var(--hover-bg) !important; transform: scale(1.01); cursor: pointer; }

/* Person Card */
.person-card {
    display: flex; flex-direction: column; align-items: center;
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    padding: 25px; border-radius: var(--radius); margin-top: 20px;
    box-shadow: var(--shadow-xs);
    transition: all 0.25s ease;
}
.person-img-wrapper { margin-bottom: 15px; }
.person-img { width: 116px; height: 116px; border-radius: 50%; object-fit: cover; border: 3px solid var(--gold); padding: 3px; background: var(--surface); box-shadow: var(--shadow-xs); }
.person-info { text-align: center; width: 100%; }
.person-name { font-size: 18px; margin: 0 0 5px; }
.person-role { font-size: 14px; color: var(--secondary); margin-bottom: 15px; display: block; }

/* CV Dropdown */
.cv-dropdown { width: 100%; border: 1px solid var(--border-subtle); border-radius: 14px; overflow: hidden; background: var(--surface); }
.cv-header { padding: 12px 15px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; font-size: 14px; transition: background 0.2s; }
.cv-header:hover { background: var(--hover-bg); }
.cv-content { max-height: 0; overflow: hidden; transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1); background: var(--surface); text-align: right; }
.cv-content ul { margin: 0; padding: 15px 25px 15px 15px; list-style-type: disc; }
.cv-content li { font-size: 14px; line-height: 1.8; color: var(--text-main); margin-bottom: 8px; }
.cv-open .cv-content { max-height: 500px; }
.cv-open .chevron-icon { transform: rotate(180deg); }
.chevron-icon { transition: transform 0.3s; }

/* Service Cards (designed for dark surfaces) */
.service-card {
    display: flex; align-items: center; gap: 10px;
    padding: 15px 10px; border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.09);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.service-card.hotel:hover { border-color: rgba(61, 98, 217, 0.5); background: rgba(61, 98, 217, 0.1); }
.service-card.history:hover { border-color: rgba(192, 138, 46, 0.5); background: rgba(192, 138, 46, 0.1); }
.service-card.food:hover { border-color: rgba(217, 84, 77, 0.5); background: rgba(217, 84, 77, 0.1); }
.service-card.mall:hover { border-color: rgba(31, 157, 107, 0.5); background: rgba(31, 157, 107, 0.1); }
.service-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18); }
.service-icon { font-size: 22px; background: rgba(255, 255, 255, 0.07); width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 10px; }
.service-info { display: flex; flex-direction: column; }
.service-title { color: #fff; font-size: 13px; }
.service-desc { color: rgba(255, 255, 255, 0.5); font-size: 10px; margin-top: 2px; }

/* Breaking news */
.breaking-news-container:hover { transform: scale(1.01); transition: 0.3s; cursor: pointer; }
.news-item-row { transition: all 0.2s ease; border-radius: 8px; }
.news-item-row:hover { background: var(--hover-bg); padding-right: 5px; }
.news-item-row:hover div:first-child { color: var(--accent) !important; }

#province-dynamic-news { display: flex; flex-direction: column; gap: 12px; padding: 5px; }
.modern-news-card {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: 14px; padding: 10px 12px; margin-bottom: 8px;
    transition: all 0.25s ease;
}
.modern-news-card:hover { transform: translateY(-1px); border-color: var(--accent-ring); box-shadow: var(--shadow-sm); }
.news-tag { font-size: 9px; color: var(--gold-strong); margin-bottom: 4px; }
[data-theme="dark"] .news-tag { color: var(--gold); }
.news-footer { display: flex; justify-content: space-between; align-items: center; font-size: 10px; color: var(--news-text); }
.news-source { display: flex; align-items: center; gap: 4px; }
.news-arrow { color: var(--accent); opacity: 0; transform: translateX(10px); transition: 0.3s; }
.modern-news-card:hover .news-arrow { opacity: 1; transform: translateX(0); }

/* Fars Dashboard */
.fars-dashboard { padding: 20px; }
.dash-header { display: flex; justify-content: space-between; align-items: center; padding-bottom: 20px; border-bottom: 1px solid var(--border-subtle); margin-bottom: 25px; flex-wrap: wrap; gap: 15px; }
.dash-brand { display: flex; gap: 15px; align-items: center; }
.emblem { width: 45px; height: auto; }
.dash-brand h1 { font-size: 20px; margin: 0; }
.dash-brand span { font-size: 12px; color: var(--secondary); }
.bento-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; }
.bento-item {
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius); padding: 20px; transition: 0.25s;
    box-shadow: var(--shadow-xs);
}
.gov-hero { display: flex; gap: 20px; align-items: center; }
.gov-img { width: 120px; height: 150px; object-fit: cover; border-radius: 12px; }
.gov-meta h2 { font-size: 22px; margin: 10px 0; }
.btn-minimal { background: var(--hover-bg); border: 1px solid var(--border-subtle); color: inherit; padding: 8px 15px; border-radius: 8px; cursor: pointer; font-size: 12px; }
.news-section h3 { font-size: 16px; margin-top: 0; border-right: 3px solid var(--gold); padding-right: 10px; }
.news-list { display: flex; flex-direction: column; gap: 12px; margin-top: 15px; }
.news-card { padding: 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border-subtle); cursor: pointer; transition: all 0.2s; }
.news-card:hover { border-color: var(--accent-ring); background: var(--accent-soft); }
.news-tag-badge { display: inline-block; font-size: 10px; padding: 2px 8px; border-radius: 6px; margin-bottom: 5px; }
.ostan { background: rgba(31, 157, 107, 0.12); color: #1F9D6B; }
.dad { background: rgba(194, 58, 58, 0.12); color: #C23A3A; }
.shahr { background: rgba(185, 130, 46, 0.12); color: #B9822E; }
.news-card h4 { margin: 0; font-size: 13px; color: var(--text-main); }

@media (max-width: 900px) {
    .bento-grid { grid-template-columns: 1fr; }
    .gov-hero { flex-direction: column; text-align: center; }
}

/* Metro Card */
.metro-card {
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius); padding: 16px; color: var(--text-main);
    margin-bottom: 20px; cursor: pointer; transition: all 0.25s ease;
    box-shadow: var(--shadow-xs);
}
.metro-card:hover { border-color: var(--accent-ring); box-shadow: var(--shadow-sm); }
.metro-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(10, 14, 26, 0.55);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    display: none; align-items: center; justify-content: center; z-index: 10000;
    opacity: 0; transition: opacity 0.3s ease;
}
.metro-modal-overlay.active { display: flex; opacity: 1; }
.metro-modal-content {
    background: var(--glass-bg-strong);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    color: var(--text-main);
    width: 90%; max-width: 420px; border-radius: 24px; padding: 25px;
    border: var(--glass-border);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3);
    transform: translateY(20px); transition: transform 0.3s ease;
}
.metro-modal-overlay.active .metro-modal-content { transform: translateY(0); }
.metro-select { width: 100%; padding: 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text-main); margin-top: 8px; }
.metro-select:focus { border-color: var(--accent); outline: none; }
.route-info-display { margin-top: 20px; padding: 15px; background: var(--surface-2); border-radius: 14px; display: none; }
.route-info-display.active { display: block; animation: fadeIn 0.4s ease; }
.route-item { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 14px; }
.route-val { color: var(--gold-strong); }
[data-theme="dark"] .route-val { color: var(--gold); }
.metro-close-btn { width: 100%; padding: 12px; margin-top: 20px; background: var(--surface-2); color: var(--btn-text); border: 1px solid var(--border-subtle); border-radius: 999px; cursor: pointer; transition: all 0.2s; }
.metro-close-btn:hover { background: var(--accent-soft); }

/* Dashboard Widgets */
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 15px; margin-bottom: 25px; }
.info-widget {
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius); padding: 15px; display: flex; align-items: center; gap: 15px;
    transition: transform 0.25s ease;
    box-shadow: var(--shadow-xs);
}
.info-widget:hover { transform: translateY(-2px); }
.widget-icon { width: 45px; height: 45px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.tourist-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; margin-top: 15px; }
.tourist-card { position: relative; border-radius: 16px; overflow: hidden; height: 140px; }
.tourist-card img { width: 100%; height: 100%; object-fit: cover; }
.tourist-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent); display: flex; align-items: flex-end; padding: 15px; color: white; }
.interactive-map-wrapper {
    width: 100%; height: 250px;
    background: var(--surface-2);
    border-radius: var(--radius); margin-top: 15px; position: relative; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--border-subtle);
}

/* Modals */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(10, 14, 26, 0.55);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    z-index: 10000; display: flex; align-items: center; justify-content: center;
}
.report-modal-content {
    background: var(--glass-bg-strong);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    color: var(--text-main);
    width: 92%; max-width: 450px; padding: 30px; border-radius: 24px;
    box-shadow: 0 30px 64px rgba(0, 0, 0, 0.3);
    border: var(--glass-border);
}
.report-modal-content button, .report-modal-content select, .report-modal-content textarea, .report-modal-content input { font-family: inherit !important; }
.report-input {
    width: 100%; padding: 14px; border-radius: 12px;
    background: var(--surface-2);
    border: 1px solid var(--border-subtle);
    color: var(--text-main); font-size: 14px; margin-top: 5px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%235B6172'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: left 12px center; background-size: 18px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.report-input:focus { border-color: var(--accent); background-color: var(--accent-soft); outline: none; }
.btn-submit {
    flex: 2;
    background: linear-gradient(135deg, #D9544D, #B93636);
    color: white; border: none; padding: 15px; border-radius: 999px;
    cursor: pointer; font-size: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
}
.btn-submit:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(217, 84, 77, 0.32); }
.btn-cancel {
    flex: 1;
    background: var(--surface-2);
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
    padding: 15px; border-radius: 999px; cursor: pointer;
    transition: all 0.2s;
}
.btn-cancel:hover { background: var(--hover-bg); }
.video-upload-box { border: 2px dashed var(--border); border-radius: 14px; padding: 20px; text-align: center; cursor: pointer; transition: all 0.3s; }
.video-upload-box:hover { border-color: rgba(217, 84, 77, 0.4); background: rgba(217, 84, 77, 0.02); }

.modal-content {
    background: var(--glass-bg-strong);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    width: 90%; max-width: 500px; border-radius: 24px; padding: 25px;
    animation: slideUp 0.3s ease;
    border: var(--glass-border);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
    color: var(--text-main);
}
.modal-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border-subtle); padding-bottom: 15px; }
.close-btn { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--secondary); }
.modal-body { padding-top: 20px; font-size: 14px; line-height: 1.8; color: var(--text-muted); }

/* Live Broadcast */
.live-broadcast-card {
    margin-bottom: 20px;
    background: var(--surface);
    border-radius: var(--radius); overflow: hidden;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-xs); transition: all 0.25s ease;
}
.live-card-header { padding: 12px 15px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border-subtle); }
.live-indicator { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-main); }
.live-dot { width: 9px; height: 9px; background: #E5484D; border-radius: 50%; box-shadow: 0 0 8px rgba(229, 72, 77, 0.6); animation: blink 1.5s infinite; }
.live-link { color: var(--accent); font-size: 11px; }
.live-player-area { position: relative; aspect-ratio: 16/9; background: #000; cursor: pointer; overflow: hidden; }
.live-thumbnail { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 100%; height: 100%; object-fit: cover; opacity: 0.6; transition: opacity 0.3s ease; }
.live-player-area:hover .live-thumbnail { opacity: 0.4; }
.live-play-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.3); }

/* Quick Buttons & Luxury Grid */
.q-btn {
    display: flex; flex-direction: column; align-items: center;
    background: var(--surface) !important;
    border: 1px solid var(--border-subtle) !important;
    padding: 15px; border-radius: 16px; transition: all 0.25s;
}
.q-btn:hover { background: var(--accent-soft) !important; transform: translateY(-2px); }
.luxury-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 15px; }
.luxury-card {
    position: relative; height: 140px; border-radius: 18px; overflow: hidden;
    border: 1px solid var(--border-subtle);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.luxury-card:hover { transform: translateY(-4px); border-color: var(--gold); box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28); }
.card-bg { position: absolute; inset: 0; background-size: cover; background-position: center; transition: transform 0.6s ease; }
.luxury-card:hover .card-bg { transform: scale(1.08); }
.card-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 20%, rgba(0, 0, 0, 0.15)); padding: 15px; display: flex; flex-direction: column; justify-content: space-between; }
.card-icon { width: 26px; height: 26px; background: rgba(255, 255, 255, 0.16); padding: 6px; border-radius: 8px; filter: brightness(0) invert(1); }
.card-title { display: block; color: white; font-size: 13px; }
.card-subtitle { display: block; color: rgba(255, 255, 255, 0.6); font-size: 9px; margin-top: 2px; }

/* Project Items */
.project-item { background: var(--surface); border: 1px solid var(--border-subtle); border-radius: 16px; padding: 12px; margin-bottom: 12px; transition: all 0.25s ease; }
.project-item:hover { border-color: rgba(31, 157, 107, 0.4); transform: scale(1.01); }
.project-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.project-name { color: var(--text-main); font-size: 12px; }
.project-status { font-size: 8px; padding: 2px 8px; border-radius: 20px; }
.status-active { background: rgba(31, 157, 107, 0.12); color: #1F9D6B; }
.status-planning { background: rgba(192, 138, 46, 0.12); color: #C08A2E; }
.progress-container { height: 6px; background: var(--hover-bg); border-radius: 10px; margin: 8px 0; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, #1F9D6B, #3DBE86); border-radius: 10px; transition: width 1s ease-in-out; }
.project-footer { display: flex; justify-content: space-between; font-size: 9px; color: var(--text-muted); }
.live-pulse { width: 8px; height: 8px; background: #1F9D6B; border-radius: 50%; box-shadow: 0 0 0 rgba(31, 157, 107, 0.4); animation: pulse 2s infinite; }

/* Officials & Services Grid */
.section-title-sm { color: var(--text-muted); font-size: 11px; margin-bottom: 12px; border-right: 2px solid var(--gold); padding-right: 8px; letter-spacing: 0.2px; }
.officials-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.official-card { display: flex; align-items: center; gap: 10px; background: var(--surface); padding: 8px; border-radius: 14px; border: 1px solid var(--border-subtle); transition: all 0.25s; }
.official-card:hover { border-color: var(--accent-ring); background: var(--accent-soft); }
.official-thumb { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; border: 2px solid var(--border); flex-shrink: 0; }
.official-thumb img { width: 100%; height: 100%; object-fit: cover; }
.official-info { display: flex; flex-direction: column; }
.official-name { color: var(--text-main); font-size: 11px; }
.official-role { color: var(--text-muted); font-size: 9px; }

.services-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.service-tile { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; border: 1px solid var(--border-subtle); background: var(--surface); transition: all 0.2s ease; }
.service-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.tile-icon { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0; }
.tile-text { display: flex; flex-direction: column; }
.tile-label { font-size: 9px; color: var(--text-muted); }
.tile-value { font-size: 13px; color: var(--text-main); margin-top: 2px; }

.tile-red .tile-icon { background: rgba(217, 84, 77, 0.10); color: #D9544D; }
.tile-blue .tile-icon { background: rgba(61, 98, 217, 0.10); color: #3D62D9; }
.tile-orange .tile-icon { background: rgba(201, 122, 46, 0.10); color: #C97A2E; }
.tile-gray .tile-icon { background: rgba(91, 100, 114, 0.10); color: #5B6472; }
.tile-red:hover { border-color: rgba(217, 84, 77, 0.35); }
.tile-blue:hover { border-color: rgba(61, 98, 217, 0.35); }
.tile-orange:hover { border-color: rgba(201, 122, 46, 0.35); }
.tile-gray:hover { border-color: rgba(91, 100, 114, 0.35); }
.load-more-results{display:block;margin:24px auto;min-width:180px;cursor:pointer}
