@font-face {
    font-family: 'Mikhak';
    src: url('https://cdn.fontcdn.ir/Font/Persian/Mikhak/Mikhak-Medium.woff2') format('woff2'),
         url('https://cdn.fontcdn.ir/Font/Persian/Mikhak/Mikhak-Medium.woff') format('woff'),
         url('https://cdn.fontcdn.ir/Font/Persian/Mikhak/Mikhak-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Mikhak';
    src: url('https://cdn.fontcdn.ir/Font/Persian/Mikhak/Mikhak-Bold.woff2') format('woff2'),
         url('https://cdn.fontcdn.ir/Font/Persian/Mikhak/Mikhak-Bold.woff') format('woff'),
         url('https://cdn.fontcdn.ir/Font/Persian/Mikhak/Mikhak-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Dana';
    src: url('https://cdn.fontcdn.ir/Font/Persian/Dana/Dana-Regular.woff2') format('woff2'),
         url('https://cdn.fontcdn.ir/Font/Persian/Dana/Dana-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Dana';
    src: url('https://cdn.fontcdn.ir/Font/Persian/Dana/Dana-Bold.woff2') format('woff2'),
         url('https://cdn.fontcdn.ir/Font/Persian/Dana/Dana-Bold.woff') format('woff');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

:root {
    /* تم تاریک - پیش‌فرض */
    --primary: #7c52c7;
    --primary-light: #9779da;
    --primary-dark: #5c3aa8;
    --accent: #00d6bd;
    --accent-alt: #f8c366;
    --bg-dark: #121822;
    --bg-card: rgba(25, 30, 45, 0.7);
    --bg-card-hover: rgba(35, 40, 60, 0.8);
    --text-light: #f5f5f5;
    --text-muted: #c0c0d0;
    --border-color: rgba(120, 120, 180, 0.1);
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 6px 15px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --radius-sm: 8px;
    --radius-md: 15px;
    --radius-lg: 24px;
    --glass-blur: 10px;
    --font-primary: 'Dana', 'Sahel', Tahoma, sans-serif;
    --font-secondary: 'Mikhak', 'Dana', sans-serif;
    --font-tertiary: 'Shabnam', 'Dana', sans-serif;
    --transition-standard: all 0.3s ease;
    --bg-overlay: rgba(25, 30, 45, 0.75);
    --container-bg: rgba(25, 30, 45, 0.75);
}

/* تم روشن */
[data-theme="light"] {
    --primary: #6742b5;
    --primary-light: #7c52c7;
    --primary-dark: #5636a0;
    --accent: #00b8a2;
    --accent-alt: #e6ae45;
    --bg-dark: #e8ebf0;
    --bg-card: rgba(240, 240, 250, 0.85);
    --bg-card-hover: rgba(230, 230, 245, 0.9);
    --text-light: #292937;
    --text-muted: #555566;
    --border-color: rgba(120, 120, 180, 0.3);
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 6px 15px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.12);
    --bg-overlay: rgba(240, 240, 250, 0.9);
    --container-bg: rgba(240, 240, 250, 0.9);
    --faq-bg: rgba(230, 230, 245, 0.9);
    --faq-border: rgba(124, 82, 199, 0.3);
    --faq-question-color: #5636a0;
    --faq-answer-color: #333344;
}

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

body {
    background-color: var(--bg-dark);
    background-image: url('back.gif');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    line-height: 1.6;
    color: var(--text-light);
    padding: 90px 10px 20px 10px;
    max-width: 580px;
    margin: 0 auto;
    font-family: var(--font-primary);
    min-height: 100vh;
}

.container {
    background-color: var(--container-bg);
    border-radius: var(--radius-lg);
    padding: 25px 20px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border-color);
    text-align: center;
    max-width: 520px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

.logo {
    text-align: center;
    margin-bottom: 20px;
    padding: 5px;
    position: relative;
    z-index: 1;
}

.logo img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(94, 53, 177, 0.4);
    border: 3px solid var(--primary);
    object-fit: cover;
}

.header {
    text-align: center;
    margin-bottom: 25px;
    position: relative;
}

.header h1 {
    color: var(--primary-light);
    margin-bottom: 10px;
    font-size: 26px;
    line-height: 1.3;
    letter-spacing: -0.5px;
    font-family: 'Tanha', 'Dana', sans-serif;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.header p {
    color: var(--text-muted);
    font-size: 16px;
    font-weight: 400;
    font-family: var(--font-tertiary);
}

.section {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.section:last-child {
    border-bottom: none;
}

.section-title {
    font-size: 18px;
    color: var(--text-light);
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: normal;
    letter-spacing: -0.3px;
    position: relative;
    background: linear-gradient(135deg, rgba(94, 53, 177, 0.6), rgba(124, 82, 199, 0.6));
    padding: 12px 15px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    text-align: center;
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid rgba(124, 82, 199, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    transition: var(--transition-standard);
    cursor: default;
    overflow: hidden;
    font-family: var(--font-secondary);
    font-weight: 500;
}

.section-title:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(94, 53, 177, 0.3);
    background: linear-gradient(135deg, rgba(94, 53, 177, 0.7), rgba(124, 82, 199, 0.7));
}

.section-title::before,
.section-title::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.section-title::before {
    top: 0;
}

.section-title::after {
    bottom: 0;
}

.section-title span {
    margin: 0 8px;
    font-size: 22px;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
}

.links {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 8px;
}

.link {
    display: flex;
    align-items: right;
    justify-content: right;
    padding: 14px 16px;
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-light);
    font-weight: normal;
    transition: var(--transition-standard);
    font-size: 15px;
    line-height: 1.4;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border-color);
    letter-spacing: -0.3px;
    text-align: right;
    font-family: 'Sahel', 'Dana', sans-serif;
    position: relative;
    overflow: hidden;
}

.link:hover {
    background-color: var(--bg-card-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: rgba(94, 53, 177, 0.3);
}

.link::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--primary);
    transform: scaleY(0);
    transition: transform 0.3s ease;
    transform-origin: bottom;
}

.link:hover::after {
    transform: scaleY(1);
}

.link.primary {
    background-color: var(--primary);
    color: white;
    border: none;
    position: relative;
    overflow: hidden;
}

.link.primary:hover {
    background-color: var(--primary-light);
}

.link.success {
    background-color: rgba(124, 82, 199, 0.15);
    color: var(--text-light);
    border: 1px solid rgba(124, 82, 199, 0.3);
}

.link.success:hover {
    background-color: rgba(124, 82, 199, 0.25);
}

.link.success::after {
    background: var(--primary);
}

.icon {
    margin-left: 12px;
    min-width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: inherit;
}

.success .icon {
    color: var(--primary-light);
}

.primary .icon {
    color: rgba(255, 255, 255, 0.9);
}

.faq {
    margin: 25px 0;
}

.faq-item {
    margin-bottom: 20px;
    background-color: rgba(35, 35, 35, 0.6);
    border-radius: 10px;
    padding: 15px;
    box-shadow: var(--shadow-sm);
    text-align: right;
    border: 1px solid rgba(124, 82, 199, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

[data-theme="light"] .faq-item {
    background-color: var(--faq-bg);
    border: 1px solid var(--faq-border);
}

.faq-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .faq-item:hover {
    box-shadow: 0 5px 15px rgba(124, 82, 199, 0.15);
}

.question {
    font-weight: bold;
    color: var(--primary-light);
    font-size: 16px;
    display: flex;
    text-align: right;
    padding: 5px 0 10px 0;
    font-family: var(--font-secondary);
    margin-bottom: 5px;
    border-bottom: 1px solid rgba(124, 82, 199, 0.2);
    position: relative;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

[data-theme="light"] .question {
    color: var(--faq-question-color);
    border-bottom: 1px solid var(--faq-border);
}

.question::before {
    content: '💬';
    display: inline-block;
    margin-left: 8px;
    color: var(--primary);
}

.question:hover {
    color: var(--accent);
}

[data-theme="light"] .question:hover {
    color: var(--primary);
}

.question-text {
    flex: 1;
}

.question .icon {
    color: var(--primary-light);
    margin-left: 8px;
    font-size: 16px;
    transition: transform 0.3s ease;
}

[data-theme="light"] .question .icon {
    color: var(--primary);
}

.question.active .icon {
    transform: rotate(180deg);
}

/* استایل دکمه باز/بسته کردن منو کشویی */
.toggle-btn {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.toggle-btn.open i {
    transform: rotate(180deg);
}

.answer {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.8;
    text-align: right;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease-in-out;
    opacity: 0;
    display: block;
    white-space: pre-line;
}

[data-theme="light"] .answer {
    color: var(--faq-answer-color);
}

.answer.show {
    max-height: 1000px;
    padding-top: 8px;
    padding-bottom: 5px;
    opacity: 1;
}

.footer {
    text-align: center;
    margin-top: 0;
    margin-bottom: 70px;
    color: #bdc3c7;
    font-size: 15px;
    padding-top: 15px;
    border-top: 1px solid #333;
    font-family: var(--font-tertiary);
}

.footer p {
    margin-bottom: 8px;
    line-height: 1.5;
}

.social-icons {
    display: flex;
    justify-content: center;
    margin-top: 15px;
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    margin: 0 5px;
    background-color: #2d2d2d;
    color: #9b59b6;
    text-decoration: none;
    transition: all 0.2s ease;
}

.social-icon:hover {
    background-color: #8e44ad;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 3px 8px rgba(155, 89, 182, 0.4);
}

/* وسط‌چین کردن لینک‌های شبکه‌های اجتماعی */
.social-links .link {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.social-links .icon {
    margin-left: 8px;
    margin-right: 0;
}

@media (max-width: 480px) {
    body {
        padding-top: 70px;
        padding-left: 10px;
        padding-right: 10px;
        padding-bottom: 20px;
    }
    
    .container {
        padding: 18px 14px;
    }
    
    .link {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .emoji {
        font-size: 16px;
        min-width: 20px;
    }
    
    .sidebar {
        top: 5px;
        left: 5px;
        right: 5px;
        width: calc(100% - 10px);
    }
    
    .sidebar-icon {
        font-size: 16px;
    }
}

/* افکت نبض زدن برای دکمه‌های محصولات آموزشی */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 5px rgba(155, 89, 182, 0.2);
    }
    50% {
        transform: scale(1.01);
        box-shadow: 0 3px 10px rgba(155, 89, 182, 0.3);
    }
}

.course-links .link.success {
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(155, 89, 182, 0.2);
}

.course-links .link.success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(155, 89, 182, 0.4);
}

.course-links .link.success::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(60deg, rgba(255, 255, 255, 0) 20%, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0) 80%);
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity 0.3s ease;
}

@keyframes shine {
    0% {
        opacity: 0;
        transform: rotate(45deg) translateX(-100%);
    }
    50% {
        opacity: 0.8;
    }
    100% {
        opacity: 0;
        transform: rotate(45deg) translateX(100%);
    }
}

/* افکت جذاب برای دکمه ربات آکادمی */
.bot-button {
    position: relative;
    background: linear-gradient(45deg, #7c52c7, #574ce8);
    border: none;
    box-shadow: 0 3px 10px rgba(124, 82, 199, 0.4);
    overflow: hidden;
    transition: var(--transition-standard);
}

.bot-button::before {
    content: 'کلیک کنید!';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-family: var(--font-secondary);
    font-weight: bold;
    opacity: 0;
    transform: scale(0.8);
    transition: var(--transition-standard);
    z-index: 2;
    border-radius: var(--radius-md);
}

.bot-button:hover::before {
    opacity: 1;
    transform: scale(1);
}

.bot-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(124, 82, 199, 0.6);
}

@keyframes botPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 3px 10px rgba(124, 82, 199, 0.4);
    }
    100% {
        transform: scale(1.02);
        box-shadow: 0 5px 15px rgba(124, 82, 199, 0.5);
    }
}

.faq-description {
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 15px;
    font-size: 14px;
    font-family: var(--font-tertiary);
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* استایل سایدبار */
.sidebar {
    position: fixed;
    top: 10px;
    left: 10px;
    right: 10px;
    width: calc(100% - 20px);
    height: 60px;
    background-color: rgba(35, 40, 60, 0.95);
    border-radius: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border-color);
    padding: 0;
    z-index: 1000;
    display: flex;
    flex-direction: row;
    overflow: hidden;
}

[data-theme="light"] .sidebar {
    background-color: rgba(230, 230, 245, 0.95);
    box-shadow: 0 2px 8px rgba(124, 82, 199, 0.2);
}

.sidebar-menu {
    display: flex;
    flex-direction: row;
    gap: 12px;
    padding: 0 15px;
    overflow-x: auto;
    max-width: 100%;
    height: 60px;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
}

.sidebar-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-light);
    transition: var(--transition-standard);
    width: 40px;
    height: 40px;
}

.sidebar-item:hover, .sidebar-item.active {
    background-color: rgba(124, 82, 199, 0.2);
}

.sidebar-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-light);
    font-size: 18px;
    transition: var(--transition-standard);
}

.sidebar-item:hover .sidebar-icon, .sidebar-item.active .sidebar-icon {
    color: var(--accent);
    transform: scale(1.1);
}

/* تنظیمات واکنش‌گرایی برای سایدبار */
@media (max-width: 768px) {
    .sidebar {
        height: 50px;
        top: 8px;
        left: 8px;
        right: 8px;
        width: calc(100% - 16px);
        border-radius: 25px;
    }
    
    .sidebar-menu {
        height: 50px;
        padding: 0 5px;
    }
    
    .sidebar-item {
        width: 35px;
        height: 35px;
        padding: 5px;
    }
    
    .bottom-navbar {
        height: 55px;
        bottom: 8px;
        left: 8px;
        right: 8px;
        width: calc(100% - 16px);
        border-radius: 25px;
    }
    
    .bottom-icon {
        font-size: 22px;
    }
    
    .footer {
        margin-bottom: 80px;
    }
}

@media (max-width: 480px) {
    body {
        padding-top: 60px;
        padding-left: 10px;
        padding-right: 10px;
        padding-bottom: 75px;
    }
    
    .sidebar-icon {
        font-size: 16px;
    }
    
    .bottom-navbar {
        bottom: 5px;
        left: 5px;
        right: 5px;
        width: calc(100% - 10px);
        height: 50px;
        border-radius: 20px;
    }
    
    .sidebar {
        border-radius: 20px;
    }
    
    .bottom-icon {
        font-size: 20px;
    }
    
    .theme-toggle {
        bottom: 70px;
    }
    
    .footer {
        margin-bottom: 65px;
    }
}

/* دکمه تغییر تم */
.theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--bg-card);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    color: var(--primary);
    cursor: pointer;
    z-index: 1000;
    transition: var(--transition-standard);
}

.theme-toggle:hover {
    transform: scale(1.1);
    background-color: var(--bg-card-hover);
}

/* دکمه‌ی تغییر تم در سایدبار */
.sidebar-theme-toggle {
    margin-right: 0;
    margin-left: auto;
}

/* استایل منوی پایین */
.bottom-navbar {
    position: fixed;
    bottom: 10px;
    left: 10px;
    right: 10px;
    width: calc(100% - 20px);
    height: 60px;
    background-color: rgba(35, 40, 60, 0.95);
    border-radius: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border-color);
    padding: 0;
    z-index: 1000;
    display: flex;
    flex-direction: row;
    overflow: hidden;
}

[data-theme="light"] .bottom-navbar {
    background-color: rgba(230, 230, 245, 0.95);
    box-shadow: 0 2px 8px rgba(124, 82, 199, 0.2);
}

.bottom-menu {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: space-around;
}

.bottom-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    text-decoration: none;
    color: var(--text-light);
    transition: var(--transition-standard);
    position: relative;
}

.bottom-item::after {
    content: '';
    position: absolute;
    right: 0;
    top: 15px;
    bottom: 15px;
    width: 1px;
    background-color: rgba(124, 82, 199, 0.2);
}

.bottom-item:last-child::after {
    display: none;
}

.bottom-item:hover, .bottom-item.active {
    background-color: rgba(124, 82, 199, 0.2);
}

.bottom-icon {
    color: var(--primary-light);
    font-size: 24px;
    transition: var(--transition-standard);
}

.bottom-text {
    display: none;
}

.bottom-item:hover .bottom-icon, 
.bottom-item.active .bottom-icon {
    color: var(--accent);
    transform: scale(1.1);
}

/* تنظیمات واکنش‌گرایی برای منوی پایین */
@media (max-width: 768px) {
    .bottom-navbar {
        height: 55px;
        bottom: 8px;
        left: 8px;
        right: 8px;
        width: calc(100% - 16px);
    }
    
    .bottom-icon {
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    body {
        padding-bottom: 75px;
    }
    
    .bottom-navbar {
        bottom: 5px;
        left: 5px;
        right: 5px;
        width: calc(100% - 10px);
        height: 50px;
    }
    
    .bottom-icon {
        font-size: 20px;
    }
    
    .theme-toggle {
        bottom: 70px;
    }
}

/* استایل برای کادر نمایش سایت‌ها */
.in-app-browser-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(15px);
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    opacity: 0;
}

.in-app-browser-overlay.active {
    opacity: 1;
}

.in-app-browser-container {
    width: 92%;
    height: 85%;
    background-color: var(--bg-dark);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 40px rgba(124, 82, 199, 0.5), 0 0 20px rgba(124, 82, 199, 0.3);
    border: 1px solid rgba(124, 82, 199, 0.5);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    max-width: 1000px;
    transform: scale(0.9) translateY(30px);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.in-app-browser-overlay.active .in-app-browser-container {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.in-app-browser-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(25, 30, 55, 0.95), rgba(45, 50, 80, 0.95));
    padding: 15px 20px;
    border-bottom: 2px solid rgba(124, 82, 199, 0.5);
    position: relative;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .in-app-browser-header {
    background: linear-gradient(135deg, rgba(200, 200, 240, 0.95), rgba(230, 230, 245, 0.95));
    border-bottom: 2px solid rgba(124, 82, 199, 0.5);
}

.browser-title {
    font-family: var(--font-secondary);
    color: var(--text-light);
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    padding: 8px 25px;
    text-shadow: 0 0 10px rgba(124, 82, 199, 0.7);
    background: rgba(124, 82, 199, 0.1);
    border-radius: var(--radius-md);
    border: 1px solid rgba(124, 82, 199, 0.3);
    box-shadow: 0 0 15px rgba(124, 82, 199, 0.2) inset;
    position: relative;
    max-width: 75%;
    margin: 0 auto;
    transition: all 0.3s ease;
}

.browser-title.typing {
    border-left: 2px solid rgba(124, 82, 199, 0.8);
    animation: typing 1.5s steps(40, end), blink-caret 0.75s step-end infinite;
    white-space: nowrap;
    overflow: hidden;
    width: auto;
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: rgba(124, 82, 199, 0.8); }
}

.browser-title::before,
.browser-title::after {
    content: '';
    position: absolute;
    top: 0;
    width: 15px;
    height: 100%;
    background: linear-gradient(90deg, rgba(124, 82, 199, 0.3), transparent);
    z-index: 1;
}

.browser-title::before {
    left: 0;
}

.browser-title::after {
    right: 0;
    transform: rotate(180deg);
}

.browser-controls {
    display: flex;
    gap: 8px;
}

.left-controls {
    order: 1;
}

.right-controls {
    order: 3;
}

.browser-control {
    background: rgba(124, 82, 199, 0.15);
    border: 1px solid rgba(124, 82, 199, 0.5);
    color: var(--text-light);
    font-size: 16px;
    cursor: pointer;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.browser-control:hover {
    background-color: rgba(124, 82, 199, 0.3);
    color: #ffffff;
    transform: translateY(-3px);
    box-shadow: 0 3px 10px rgba(124, 82, 199, 0.5), 0 0 15px rgba(124, 82, 199, 0.3);
    border-color: rgba(124, 82, 199, 0.8);
}

.browser-control:hover::after {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border-radius: 50%;
    border: 2px solid rgba(124, 82, 199, 0.5);
    animation: pulse-ring 1.5s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    80%, 100% {
        opacity: 0;
        transform: scale(1.5);
    }
}

.browser-control.active {
    background-color: rgba(124, 82, 199, 0.4);
    color: var(--accent);
    box-shadow: 0 0 15px rgba(124, 82, 199, 0.6);
}

.browser-control.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.browser-control.disabled:hover {
    background-color: rgba(124, 82, 199, 0.15);
    color: var(--text-light);
    transform: none;
    box-shadow: none;
}

.browser-control.disabled:hover::after {
    display: none;
}

.close-browser {
    background: rgba(220, 50, 50, 0.15);
    border: 1px solid rgba(220, 50, 50, 0.3);
    color: var(--text-light);
    font-size: 18px;
    cursor: pointer;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-browser:hover {
    background-color: rgba(220, 50, 50, 0.3);
    color: #ffffff;
    transform: translateY(-3px);
    box-shadow: 0 3px 10px rgba(220, 50, 50, 0.5), 0 0 15px rgba(220, 50, 50, 0.3);
    border-color: rgba(220, 50, 50, 0.8);
}

.in-app-browser-content {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #fff;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.2);
}

#inAppFrame {
    width: 100%;
    height: 100%;
    border: none;
    background-color: white;
    opacity: 0;
    transform: scale(0.98);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

#inAppFrame.loaded {
    opacity: 1;
    transform: scale(1);
}

.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    pointer-events: none;
    z-index: 100;
    opacity: 1;
    visibility: visible;
}

.loading-spinner:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 5px solid rgba(124, 82, 199, 0.15);
    border-top-color: var(--primary);
    box-shadow: 0 0 25px rgba(124, 82, 199, 0.6);
    animation: spin 1.2s infinite cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.loading-spinner:after {
    content: '';
    position: absolute;
    top: 15%;
    left: 15%;
    width: 70%;
    height: 70%;
    border-radius: 50%;
    border: 4px solid transparent;
    border-top-color: var(--accent);
    animation: spin 1.8s infinite ease-in-out reverse;
}

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

@media (max-width: 768px) {
    .in-app-browser-container {
        width: 95%;
        height: 90%;
    }
    
    .browser-control, .close-browser {
        width: 34px;
        height: 34px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .in-app-browser-container {
        width: 100%;
        height: 100%;
        border-radius: 0;
        border: none;
    }
    
    .in-app-browser-header {
        padding: 12px 15px;
    }
    
    .browser-control, .close-browser {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
}

/* استایل دکمه تمام صفحه با رنگ آبی */
.fullscreen-button {
    background: rgba(30, 144, 255, 0.15);
    border: 1px solid rgba(30, 144, 255, 0.5);
}

.fullscreen-button:hover {
    background-color: rgba(30, 144, 255, 0.3);
    color: #ffffff;
    transform: translateY(-3px);
    box-shadow: 0 3px 10px rgba(30, 144, 255, 0.5), 0 0 15px rgba(30, 144, 255, 0.3);
    border-color: rgba(30, 144, 255, 0.8);
}

.fullscreen-button:hover::after {
    border: 2px solid rgba(30, 144, 255, 0.5);
}

.fullscreen-button.active {
    background-color: rgba(30, 144, 255, 0.4);
    color: #1e90ff;
    box-shadow: 0 0 15px rgba(30, 144, 255, 0.6);
}

.header-center {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    position: relative;
}

.header-center .browser-title {
    margin: 0 auto;
    transform: none;
    max-width: 75%;
}

.header-center .close-browser {
    position: absolute;
    right: 0;
}

/* تنظیم عرض متن برای جلوگیری از شکستن لایوت */
.browser-title {
    max-width: 75%;
    margin: 0 auto;
    width: 100%;
    padding: 8px 25px;
}

.loading-progress {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #7c52c7, #9d6bec);
    box-shadow: 0 0 10px rgba(124, 82, 199, 0.7);
    z-index: 100;
    opacity: 1;
    visibility: visible;
    pointer-events: none;
}

.loading-progress.active {
    animation: progressAnim 5s cubic-bezier(0.1, 0.05, 0.25, 1) forwards;
}

.loading-progress.complete {
    animation: progressComplete 0.5s ease forwards;
}

@keyframes progressAnim {
    0% { width: 0%; }
    10% { width: 10%; }
    20% { width: 25%; }
    30% { width: 40%; }
    50% { width: 60%; }
    70% { width: 75%; }
    85% { width: 85%; }
    100% { width: 92%; }
}

@keyframes progressComplete {
    0% { opacity: 1; }
    90% { width: 100%; opacity: 1; }
    100% { width: 100%; opacity: 0; }
}
