/**
 * Atlas Client Portal & Workspace
 * Theme: Royal Violet (#4C1D95, #6366F1) & Neon Teal (#0D9488, #14B8A6)
 * Full Responsive, Language Dropdown Styling & Dark/Light Mode Support
 */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Vazirmatn:wght@400;500;600;700;800&display=swap');

:root {
    --purple-main: #6366F1;
    --purple-deep: #4338CA;
    --purple-dark: #312E81;
    --purple-soft: rgba(99, 102, 241, 0.08);

    --teal-main: #0D9488;
    --teal-light: #14B8A6;
    --teal-neon: #2DD4BF;
    --teal-soft: rgba(13, 148, 136, 0.10);
    --teal-glow: rgba(20, 184, 166, 0.25);

    --surface-bg: #F0F4F8;
    --surface-card: #F9FBFC;
    --surface-box: #FFFFFF;
    --border-color: #D3DFE8;

    --text-title: #0F172A;
    --text-body: #334155;
    --text-muted: #64748B;
    --text-light: #94A3B8;

    --shadow-card: 0 20px 45px -10px rgba(15, 23, 42, 0.08);
    --shadow-glow: 0 10px 25px -5px rgba(13, 148, 136, 0.3);
}

[data-theme="dark"] {
    --surface-bg: #0B1120;
    --surface-card: #0F172A;
    --surface-box: #1E293B;
    --border-color: #334155;

    --text-title: #F8FAFC;
    --text-body: #CBD5E1;
    --text-muted: #94A3B8;
    --text-light: #64748B;

    --purple-soft: rgba(99, 102, 241, 0.16);
    --teal-soft: rgba(13, 148, 136, 0.18);
    --shadow-card: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    min-height: 100%;
    background-color: var(--surface-bg);
    transition: background-color 0.3s ease;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: none;
}

body {
    min-height: 100vh;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    color: var(--text-body);
    font-size: 14px;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
}

html[dir="rtl"] body {
    font-family: 'Vazirmatn', system-ui, sans-serif;
}

/* پس‌زمینه آمبینت */
.atlas-backdrop {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.atlas-backdrop-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.35;
}

.atlas-backdrop-orb-one {
    width: 650px;
    height: 650px;
    background: radial-gradient(circle, var(--purple-main) 0%, transparent 70%);
    top: -200px;
    left: -150px;
}

.atlas-backdrop-orb-two {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--teal-light) 0%, transparent 70%);
    bottom: -150px;
    right: -100px;
}

/* فریم مادر صفحه */
.atlas-app-shell {
    width: min(1280px, calc(100% - 40px));
    margin: 20px auto 40px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* هدر مدرن */
.atlas-site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 30px;
    background: var(--surface-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(16px);
    position: relative;
    z-index: 50;
}

.atlas-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: inherit;
}

.atlas-brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--purple-deep) 0%, var(--teal-main) 100%);
    display: grid;
    place-items: center;
    color: #FFF;
    box-shadow: 0 8px 18px var(--teal-glow);
    overflow: hidden;
}

.atlas-brand-mark img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.atlas-brand-copy strong {
    display: block;
    font-size: 18px;
    font-weight: 800;
    color: var(--text-title);
    line-height: 1.2;
}

.atlas-brand-copy small {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
}

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

/* استایل انتخاب‌گر زبان و رفع بیرون‌زدگی */
.lang-dropdown-wrap {
    position: relative;
    display: inline-block;
}

.lang-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    padding: 0 16px;
    background: var(--surface-box);
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-body);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lang-pill:hover {
    border-color: var(--teal-main);
    color: var(--teal-main);
}

.lang-menu {
    position: absolute;
    top: calc(100% + 8px);
    background: var(--surface-box);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.25);
    display: none;
    flex-direction: column;
    min-width: 155px;
    z-index: 1000;
    overflow: hidden;
}

html[dir="ltr"] .lang-menu {
    left: 0;
    right: auto;
}

html[dir="rtl"] .lang-menu {
    right: 0;
    left: auto;
}

.lang-menu.is-open {
    display: flex;
}

.lang-menu a {
    padding: 10px 16px;
    color: var(--text-body);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.lang-menu a:hover {
    background: var(--teal-soft);
    color: var(--teal-main);
}

.theme-toggle-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--surface-box);
    border: 1.5px solid var(--border-color);
    display: grid;
    place-items: center;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
}

.theme-toggle-btn:hover {
    border-color: var(--teal-main);
}

[data-theme="dark"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: none; }
[data-theme="light"] .sun-icon { display: none; }
[data-theme="light"] .moon-icon { display: block; }

.atlas-btn-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.atlas-btn-primary {
    background: linear-gradient(135deg, var(--purple-main) 0%, var(--teal-main) 100%);
    color: #FFF;
    box-shadow: var(--shadow-glow);
}

.atlas-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px -4px rgba(13, 148, 136, 0.45);
}

/* هیرو */
.atlas-hero {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 36px;
    padding: 44px;
    border-radius: 26px;
    background: linear-gradient(145deg, var(--surface-card) 0%, var(--surface-box) 100%);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
    align-items: center;
    position: relative;
    overflow: hidden;
}

.atlas-hero-copy {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.atlas-eyebrow {
    align-self: flex-start;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--teal-soft);
    color: var(--teal-main);
    border: 1px solid rgba(20, 184, 166, 0.3);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.atlas-hero-copy h1 {
    font-size: clamp(28px, 3.5vw, 40px);
    font-weight: 800;
    color: var(--text-title);
    line-height: 1.25;
}

.atlas-hero-copy p {
    font-size: 15px;
    color: var(--text-muted);
    max-width: 580px;
    line-height: 1.7;
}

.atlas-hero-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 8px;
}

.atlas-hero-highlights span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--surface-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-body);
}

.atlas-hero-highlights i {
    color: var(--teal-main);
}

/* موکاپ هیرو */
.atlas-hero-visual {
    background: linear-gradient(155deg, var(--purple-dark) 0%, #172554 45%, #042F2E 100%);
    border: 1px solid rgba(20, 184, 166, 0.35);
    border-radius: 22px;
    padding: 30px;
    color: #FFF;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 0 20px 45px -10px rgba(13, 148, 136, 0.3);
    position: relative;
}

.visual-mockup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.visual-mockup-badge {
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(20, 184, 166, 0.2);
    border: 1px solid var(--teal-neon);
    color: var(--teal-neon);
    font-size: 11px;
    font-weight: 700;
}

.visual-bubbles-wrap {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.visual-bubble {
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.5;
}

.visual-bubble-teal {
    align-self: flex-start;
    background: rgba(13, 148, 136, 0.3);
    border: 1px solid rgba(45, 212, 191, 0.4);
    color: #E6FFFA;
}

.visual-bubble-purple {
    align-self: flex-end;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.5) 0%, rgba(67, 56, 202, 0.7) 100%);
    border: 1px solid rgba(165, 180, 252, 0.3);
    color: #EEF2FF;
}

/* شبکه ۳ ستونه کارت‌های داشبورد */
.atlas-tool-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.atlas-tool-card {
    background: var(--surface-card);
    border: 1px solid var(--border-color);
    border-radius: 22px;
    padding: 28px;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 20px;
    position: relative;
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.atlas-tool-card:hover {
    border-color: var(--teal-light);
    transform: translateY(-3px);
}

.atlas-card-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.atlas-ready-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--teal-main);
    background: var(--teal-soft);
    padding: 4px 12px;
    border-radius: 8px;
}

.atlas-card-main {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.atlas-tool-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--purple-main), var(--teal-main));
    display: grid;
    place-items: center;
    color: #FFF;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: var(--shadow-glow);
}

.atlas-card-info h2 {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-title);
    margin-bottom: 6px;
}

.atlas-card-info p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
}

.atlas-card-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 46px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--purple-main) 0%, var(--teal-main) 100%);
    color: #FFF;
    font-size: 13.5px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    box-shadow: var(--shadow-glow);
    transition: all 0.2s ease;
}

.atlas-card-action:hover {
    box-shadow: 0 10px 24px rgba(13, 148, 136, 0.4);
}

/* اکشن کارت گفتگوی زنده با تم کله‌غازی متمایز */
.atlas-card-action-teal {
    background: linear-gradient(135deg, var(--teal-main) 0%, #059669 100%);
}

.atlas-card-action-teal:hover {
    box-shadow: 0 10px 24px rgba(16, 185, 129, 0.4);
}

/* فیلد کد ویجت */
.atlas-code-field {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.atlas-code-field textarea {
    width: 100%;
    height: 80px;
    background: var(--surface-box);
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    padding: 10px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 11.5px;
    color: var(--text-title);
    resize: none;
    outline: none;
}

.atlas-code-field textarea:focus {
    border-color: var(--teal-main);
    box-shadow: 0 0 0 3px var(--teal-soft);
}

.atlas-copy-btn {
    align-self: flex-end;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 10px;
    background: var(--teal-soft);
    color: var(--teal-main);
    border: 1.5px solid var(--teal-light);
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.atlas-copy-btn:hover {
    background: var(--teal-main);
    color: #FFF;
}

/* فوتر */
.atlas-site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 30px;
    background: var(--surface-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-muted);
}

.atlas-footer-brand strong {
    color: var(--text-title);
    font-weight: 700;
    margin-right: 6px;
}

.atlas-runtime-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-weight: 600;
}

/* ریسپانسیو اختصاصی */
@media (max-width: 1100px) {
    .atlas-tool-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 990px) {
    .atlas-hero {
        grid-template-columns: 1fr;
        padding: 30px 24px;
    }
}

@media (max-width: 640px) {
    .atlas-app-shell {
        width: 100%;
        margin: 10px 0;
        padding: 0 12px;
        gap: 20px;
    }

    .atlas-site-header {
        padding: 14px 18px;
        border-radius: 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
        position: relative;
    }

    .atlas-header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .lang-dropdown-wrap {
        position: static;
    }

    .lang-menu {
        top: calc(100% + 6px);
        left: 12px !important;
        right: auto !important;
        max-width: calc(100vw - 24px);
    }

    html[dir="rtl"] .lang-menu {
        right: 12px !important;
        left: auto !important;
    }

    .atlas-hero {
        padding: 24px 16px;
        border-radius: 18px;
    }

    .atlas-hero-visual {
        display: none;
    }

    .atlas-tool-card {
        padding: 24px 18px;
        border-radius: 18px;
    }

    .atlas-card-main {
        flex-direction: column;
        gap: 14px;
    }

    .atlas-site-footer {
        flex-direction: column;
        gap: 10px;
        text-align: center;
        padding: 20px 16px;
    }
}