/* Shein Boost - Main Stylesheet */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #e74c3c;
    --primary-dark: #c0392b;
    --secondary: #2c3e50;
    --accent: #f39c12;
    --success: #27ae60;
    --usdt: #26A17B;
    --danger: #e74c3c;
    --warning: #f39c12;
    --info: #3498db;
    --light: #f8f9fa;
    --dark: #2c3e50;
    --gray: #95a5a6;
    --white: #ffffff;
    --gradient-primary: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    --gradient-success: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --gradient-info: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.15);
    --radius: 12px;
    --radius-sm: 8px;
    /* Android system navigation bar height - injected by Kotlin via JS */
    --android-safe-bottom: 0px;
}
body {
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    background: #f0f2f5;
    color: var(--dark);
    direction: rtl;
    min-height: 100%;
    overflow-x: hidden;
}

html {
    height: 100%;
}


img { max-width: 100%; height: auto; }
table { max-width: 100%; }
pre, code { max-width: 100%; overflow-wrap: break-word; white-space: pre-wrap; }

/* ===== HEADER ===== */
.app-header {
    background: var(--gradient-primary);
    color: white;
    padding: 10px 16px;
    padding-top: calc(15px + env(safe-area-inset-top, 0px));
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.app-header .logo {
    font-size: 20px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-header .logo-icon {
    width: 36px;
    height: 36px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 18px;
}

/* ===== SLIDER ===== */
.slider-container {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: var(--secondary);
}

.slider-track {
    display: flex;
    transition: transform 0.5s ease;
    height: 100%;
}

.slider-track img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    flex-shrink: 0;
}

.slider-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
}

.slider-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.3s;
}

.slider-dot.active {
    background: white;
    width: 20px;
    border-radius: 4px;
}

/* ===== MARQUEE ===== */
.marquee-container {
    background: var(--secondary);
    color: #f1c40f;
    padding: 8px 0;
    overflow: hidden;
    white-space: nowrap;
    direction: rtl;
}

.marquee-text {
    display: inline-block;
    animation: marquee 18s linear infinite;
    font-size: 14px;
    white-space: nowrap;
}

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

/* ===== QUICK ACTIONS ===== */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 16px;
    background: white;
    margin: 10px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 4px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    color: var(--dark);
}

.action-btn:hover { transform: translateY(-2px); }

.action-btn .icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: white;
}

.action-btn .icon.withdraw { background: var(--gradient-primary); }
.action-btn .icon.deposit { background: var(--gradient-success); }
.action-btn .icon.invite { background: var(--gradient-info); }
.action-btn .icon.boost { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }

.action-btn .label {
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

/* ===== BANNERS ===== */
.banners-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 0 10px;
    margin: 10px 0;
}

.banner-card {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.3s;
}

.banner-card:hover { transform: scale(1.02); }

.banner-card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

/* ===== GAMIFICATION ===== */
.gamification {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 0 10px;
    margin: 10px 0;
}

.game-card {
    background: white;
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.game-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.game-card img {
    width: 80px;
    height: 80px;
    margin-bottom: 8px;
}

.game-card h4 {
    font-size: 14px;
    color: var(--dark);
    margin-bottom: 4px;
}

.game-card p {
    font-size: 12px;
    color: var(--gray);
}

.game-card .wheel-coming-soon {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(44, 62, 80, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    color: #f1c40f;
    border-radius: var(--radius);
    z-index: 2;
}

/* ===== ANNOUNCEMENTS ===== */
.announcements {
    background: white;
    margin: 10px;
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
}

.announcements h3 {
    font-size: 16px;
    margin-bottom: 12px;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.announcement-item {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.announcement-item:last-child { border-bottom: none; }

.announcement-item h4 {
    font-size: 14px;
    color: var(--dark);
    margin-bottom: 4px;
}

.announcement-item p {
    font-size: 12px;
    color: var(--gray);
}

/* ===== TASKS SECTION ===== */
.tasks-header {
    background: white;
    margin: 10px;
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
}

.stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 14px;
    border-radius: var(--radius-sm);
    text-align: center;
}

.stat-card.success { background: var(--gradient-success); }
.stat-card.info { background: var(--gradient-info); }

.stat-card .value {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 4px;
}

.stat-card .label {
    font-size: 12px;
    opacity: 0.9;
}

.task-progress-btn {
    width: 100%;
    padding: 14px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.task-progress-btn:hover { opacity: 0.9; }

.task-progress-btn.completed {
    background: var(--gray);
    cursor: not-allowed;
}

.task-counter-wrapper {
    text-align: center;
    margin-top: 10px;
}

.task-level-badge {
    font-size: 13px;
    color: #888;
}

.tasks-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #888;
    font-size: 14px;
    line-height: 2;
}

.btn-upgrade {
    display: inline-block;
    margin-top: 12px;
    padding: 8px 24px;
    background: var(--primary-color, #E8572A);
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
}

.trainee-expired-notice {
    text-align: center;
    padding: 40px 20px;
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 12px;
    margin: 20px 0;
}

.trainee-expired-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.trainee-expired-title {
    font-size: 18px;
    font-weight: 700;
    color: #e65100;
    margin-bottom: 8px;
}

.trainee-expired-sub {
    font-size: 14px;
    color: #666;
    line-height: 1.8;
}

/* ===== TABS ===== */
.tabs {
    display: flex;
    background: white;
    margin: 0 10px;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.tab-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background: white;
    color: var(--gray);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: #fff5f5;
}

.tab-content {
    display: none;
    padding: 10px;
}

.tab-content.active { display: block; }

/* ===== PRODUCT CARDS ===== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.product-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

.product-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.product-card img {
    width: 100%;
    height: 140px;
    object-fit: cover;
}

.product-card .info {
    padding: 10px;
}

.product-card .name {
    font-size: 13px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 4px;
    /* height: 36px; */
    overflow: hidden;
}

.product-card .category {
    font-size: 11px;
    color: var(--gray);
    margin-bottom: 6px;
}

.product-card .stars {
    display: flex;
    gap: 2px;
    margin-bottom: 6px;
    direction: ltr;
}

.product-card .stars i {
    color: #FFD700;
    font-size: 14px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.product-card .commission {
    font-size: 14px;
    color: var(--primary);
    font-weight: bold;
    margin-bottom: 8px;
}

.product-card .btn-complete {
    width: 100%;
    padding: 8px;
    background: var(--success);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.product-card .btn-complete:hover { background: #219a52; }

.product-card .btn-complete:disabled {
    background: var(--gray);
    cursor: not-allowed;
}

.product-card.completed { opacity: 0.6; }
.product-card.completed .btn-complete { background: var(--gray); }

/* ===== MY TASKS (مهامي) STAR RATING ===== */
.task-rating-section {
    margin-top: 6px;
}

.stars-input {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin: 6px 0;
    direction: ltr;
}

.star-btn {
    font-size: 22px;
    line-height: 1;
    transition: color 0.15s;
    user-select: none;
}

.btn-rate {
    width: 100%;
    padding: 8px;
    margin-top: 4px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    background: var(--gradient-primary);
    color: #fff;
    transition: opacity 0.3s;
}

.btn-rate:hover { opacity: 0.9; }

.btn-rate:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 1;
}

.task-done-badge {
    text-align: center;
    color: #22C55E;
    font-weight: 600;
    font-size: 13px;
    padding: 6px 0;
}

/* ===== STAR RATING (Modal) ===== */
.star-rating {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 16px 0;
    direction: ltr;
}

.star-rating i {
    font-size: 36px;
    color: #C0C0C0;
    cursor: pointer;
    transition: color 0.2s, transform 0.15s;
}

.star-rating i:hover {
    transform: scale(1.2);
}

.star-rating i.active,
.star-rating i.selected {
    color: #FFD700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

/* Gold star ratings */
.star-rating,
.stars,
.rating-star,
.task-stars {
    color: #FFD700 !important;
}

.star-filled {
    color: #FFD700;
}

.star-empty {
    color: #C0C0C0;
}

/* ===== BOTTOM NAV ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding-top: 8px;
    padding-left: 0;
    padding-right: 0;
    padding-bottom: calc(8px + var(--android-safe-bottom, env(safe-area-inset-bottom, 0px)));
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    box-sizing: content-box;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: var(--gray);
    font-size: 11px;
    transition: all 0.3s;
    padding: 4px;
    /* إزالة padding مضاعف من nav-item - الـ padding في .bottom-nav يكفي */
    padding-bottom: 4px;
}

.nav-item i { font-size: 20px; }

.nav-item.active { color: var(--primary); }
.nav-item:hover { color: var(--primary); }

/* ===== FORMS ===== */
.form-container {
    background: white;
    margin: 10px;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e0e0e0;
    border-radius: var(--radius-sm);
    font-size: 16px;
    transition: all 0.3s;
    font-family: inherit;
    min-height: 44px;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

/* Prevent iOS zoom on input focus */
@media (max-width: 768px) {
    .form-group input,
    .form-group select,
    .form-group textarea,
    .admin-input {
        font-size: 16px !important;
    }
}

.admin-input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e0e0e0;
    border-radius: var(--radius-sm);
    font-size: 16px;
    transition: all 0.3s;
    font-family: inherit;
    min-height: 44px;
    box-sizing: border-box;
}
.admin-input:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }

.btn-secondary {
    width: 100%;
    padding: 14px;
    background: var(--secondary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

/* ===== CARDS ===== */
.card {
    background: white;
    border-radius: var(--radius);
    padding: 16px;
    margin: 10px;
    box-shadow: var(--shadow);
}

.card-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 12px;
    color: var(--dark);
}

/* ===== TABLES ===== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th,
.data-table td {
    padding: 10px;
    text-align: right;
    border-bottom: 1px solid #eee;
}

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: var(--dark);
}

.data-table tr:hover { background: #f8f9fa; }

@media (max-width: 480px) {
    .data-table { font-size: 12px; }
    .data-table th,
    .data-table td { padding: 8px 6px; }
}

.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.badge-success { background: #d4edda; color: #155724; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-danger { background: #f8d7da; color: #721c24; }

/* ===== TOAST ===== */
.toast {
    position: fixed;
    top: 16px;
    top: calc(16px + env(safe-area-inset-top, 0px));
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: var(--dark);
    color: white;
    padding: 14px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    z-index: 9999;
    opacity: 0;
    transition: all 0.4s;
    box-shadow: var(--shadow-lg);
    text-align: center;
    max-width: calc(100vw - 32px);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

/* fix: webview-modal-scroll-lock CSS */
.modal-open {
    overflow: hidden !important;
}

/* ===== MODAL ===== */
/* fix: webview-modal-fullscreen — إصلاح جذري لمشكلة الـ modals في Android WebView */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    -webkit-display: none;
    /* محاذاة لأعلى الشاشة حتى لا يغطي الكيبورد المحتوى */
    align-items: flex-start;
    -webkit-align-items: flex-start;
    justify-content: center;
    -webkit-justify-content: center;
    z-index: 3000;
    /* padding علوي كافي لإظهار المودال في أعلى الشاشة */
    padding: 12px 16px 24px;
    padding-top: calc(12px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    box-sizing: border-box;
}

.modal-overlay.active {
    display: -webkit-flex;
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--radius);
    padding: 16px;
    width: min(92vw, 420px);
    max-width: 92vw;
    /* الارتفاع الأقصى 85% من ارتفاع الجهاز */
    max-height: 85%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    animation: modalIn 0.3s ease;
    -webkit-animation: modalIn 0.3s ease;
    box-sizing: border-box;
    /* إزالة margin:auto لأن المودال محاذى للأعلى الآن */
    margin: 0 auto;
    position: relative;
    z-index: 1;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    will-change: transform;
}

.modal-content img {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 8px;
}

@-webkit-keyframes modalIn {
    from { -webkit-transform: scale(0.85); opacity: 0; }
    to   { -webkit-transform: scale(1);    opacity: 1; }
}
@keyframes modalIn {
    from { transform: scale(0.85); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.modal-header h3 { font-size: 18px; }

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray);
}

/* ===== PROFILE ===== */
.profile-header {
    background: var(--gradient-primary);
    color: white;
    padding: 24px 16px;
    text-align: center;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 4px solid rgba(255,255,255,0.3);
    margin-bottom: 12px;
    background: white;
}

.profile-name {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 4px;
}

.profile-level {
    background: rgba(255,255,255,0.2);
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 13px;
    display: inline-block;
}

/* ===== STATS GRID ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 10px;
}

.stat-box {
    background: white;
    border-radius: var(--radius-sm);
    padding: 14px 8px;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-box .number {
    font-size: 18px;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 4px;
}

.stat-box .text {
    font-size: 11px;
    color: var(--gray);
}

/* ===== TEAM CARDS ===== */
.team-card {
    background: white;
    border-radius: var(--radius);
    padding: 16px;
    margin: 10px;
    box-shadow: var(--shadow);
    border-right: 4px solid #8B1A1A;
}

.team-card.level-b { border-right-color: var(--info); }
.team-card.level-c { border-right-color: var(--success); }

.team-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.team-card-title {
    font-size: 16px;
    font-weight: bold;
}

.team-card-rate {
    background: #8B1A1A;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
}

#earningsA { color: #8B1A1A; }
.team-level-text { color: #8B1A1A; }

/* ===== TEAM TREE VIEW ===== */
.team-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 10px;
}

.team-summary .stat-box {
    background: white;
    border-radius: var(--radius);
    padding: 12px;
    box-shadow: var(--shadow);
    text-align: center;
}

.team-summary .stat-box .number {
    font-size: 20px;
    font-weight: 700;
    color: var(--dark);
}

.team-summary .stat-box .text {
    font-size: 11px;
    color: var(--gray);
    margin-top: 2px;
}

.accordion {
    margin: 10px;
}

.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: background 0.2s;
    border-right: 4px solid var(--gray);
    margin-bottom: 2px;
}

.accordion-header:hover {
    background: #f9f9f9;
}

.accordion-header.level-1 { border-right-color: #8B1A1A; }
.accordion-header.level-2 { border-right-color: var(--info); }
.accordion-header.level-3 { border-right-color: var(--success); }

.accordion-header .acc-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
}

.accordion-header .acc-title i {
    font-size: 14px;
    color: var(--gray);
    transition: transform 0.3s;
}

.accordion-header.open .acc-title i {
    transform: rotate(180deg);
}

.accordion-header .acc-count {
    background: var(--gray-light, #f0f0f0);
    color: var(--dark);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    background: white;
    border-radius: 0 0 var(--radius) var(--radius);
    margin: 0 10px 8px;
    box-shadow: var(--shadow);
}

.accordion-body.open {
    max-height: 480px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.accordion-body::-webkit-scrollbar {
    width: 6px;
}

.accordion-body::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 8px;
}

.accordion-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 8px;
}

.accordion-body::-webkit-scrollbar-thumb:hover {
    background: var(--primary, #8B1A1A);
}

.accordion-body-inner {
    padding: 8px;
}

.team-member-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
}

.team-member-card:last-child {
    border-bottom: none;
}

.team-member-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.team-member-phone {
    font-size: 14px;
    font-weight: 500;
    color: var(--dark);
}

.team-member-level {
    font-size: 11px;
    color: var(--gray);
}

.level-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    color: white;
    margin-top: 2px;
}

.level-badge.lv-1 { background: #8B1A1A; }
.level-badge.lv-2 { background: var(--info); }
.level-badge.lv-3 { background: var(--success); }

.task-count {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--dark);
    font-weight: 600;
    white-space: nowrap;
}

.task-count i {
    font-size: 12px;
    color: var(--gray);
}

.team-empty {
    text-align: center;
    color: var(--gray);
    padding: 20px;
    font-size: 13px;
}

/* ===== QR CODE ===== */
.qr-container {
    text-align: center;
    padding: 20px;
}

.qr-code {
    width: 180px;
    height: 180px;
    margin: 0 auto 16px;
    background: white;
    padding: 10px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
}

.copy-field {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.copy-field input {
    flex: 1;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: var(--radius-sm);
    font-size: 14px;
    text-align: center;
}

.copy-field button {
    padding: 10px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
}

/* ===== VIP TABLE ===== */
.vip-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 10px 0;
    max-width: 100%;
}

.vip-table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
    font-size: 12px;
}

.vip-table th,
.vip-table td {
    padding: 10px 8px;
    text-align: center;
    border: 1px solid #e0e0e0;
}

.vip-table th {
    background: var(--gradient-primary);
    color: white;
    font-weight: 600;
}

.vip-table tr:nth-child(even) { background: #f8f9fa; }

/* ===== VIP PAGE ===== */
.vip-subtitle {
    font-size: 13px;
    color: var(--gray);
    margin-bottom: 16px;
}
.commission-example {
    margin-top: 16px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 13px;
}
.commission-example p { margin-bottom: 4px; }
.upgrade-steps {
    font-size: 13px;
    line-height: 2;
}
.vip-team-a { color: #8B1A1A; }
.vip-team-b { color: var(--info); }
.vip-team-c { color: var(--success); }

/* ===== WHEEL ===== */
.wheel-container {
    position: relative;
    width: 280px;
    height: 280px;
    margin: 20px auto;
    max-width: calc(100vw - 40px);
    max-height: calc(100vw - 40px);
}

.wheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    border: 6px solid #f1c40f;
    box-shadow: var(--shadow-lg);
    transition: transform 4.5s cubic-bezier(0.17, 0.67, 0.12, 0.99);
}

.wheel-label {
    position: absolute;
    color: white;
    font-size: 11px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    transform: translate(-50%, -50%);
    pointer-events: none;
    white-space: nowrap;
    z-index: 2;
}

.wheel-pointer {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 14px solid transparent;
    border-right: 14px solid transparent;
    border-top: 22px solid var(--danger);
    z-index: 10;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.wheel-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 52px;
    height: 52px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    z-index: 10;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
    cursor: pointer;
    border: 3px solid #f1c40f;
    transition: transform 0.2s;
}
.wheel-center:active {
    transform: translate(-50%, -50%) scale(0.92);
}

/* ===== LOGIN/REGISTER ===== */
.auth-container {
    /* تغطية كامل الشاشة باستخدام fixed بدلاً من height التي تعتمد على الوالد */
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* محاذاة للأعلى حتى لا يختفي الفورم خلف الكيبورد على الجوال */
    justify-content: flex-start;
    padding: 24px 16px 16px;
    padding-top: calc(24px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}

.auth-box {
    background: white;
    border-radius: var(--radius);
    padding: 28px 20px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    flex-shrink: 0;
    /* إزالة max-height من auth-box - التمرير موجود على مستوى auth-container */
    overflow: visible;
}

.auth-logo {
    text-align: center;
    margin-bottom: 20px;
}

.auth-logo h1 {
    font-size: 26px;
    color: var(--primary);
    margin-bottom: 6px;
}

.auth-logo p {
    color: var(--gray);
    font-size: 13px;
}

.auth-tabs {
    display: flex;
    margin-bottom: 16px;
    border-bottom: 2px solid #eee;
}

.auth-tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    color: var(--gray);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    min-height: 44px;
}

.auth-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.auth-form { display: none; }
.auth-form.active { display: block; }

/* ===== LOADING ===== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

/* ===== TASK HISTORY CARDS ===== */
.task-history-card {
    background: white;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 10px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 12px;
}
.task-history-img {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}
.task-history-info { flex: 1; }
.task-history-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
}
.task-history-category {
    font-size: 12px;
    color: var(--gray);
}
.task-history-commission {
    font-size: 15px;
    font-weight: bold;
    color: var(--success);
}
.task-history-time {
    font-size: 11px;
    color: #aaa;
}
.task-history-stars {
    display: flex;
    gap: 1px;
    margin-top: 4px;
    direction: ltr;
}

.task-history-stars i {
    font-size: 11px;
    color: #FFD700;
}

.task-history-status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}
.status-completed { background: #d4edda; color: #155724; }
.status-pending { background: #fff3cd; color: #856404; }

/* ===== FINANCE LOGS ===== */
.log-card {
    background: white;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 10px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 14px;
}
.log-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1abc9c, #16a085);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    flex-shrink: 0;
}
.log-icon.withdraw { background: linear-gradient(135deg, #e74c3c, #c0392b); }
.log-icon.deposit { background: linear-gradient(135deg, #1abc9c, #16a085); }
.log-icon.task { background: linear-gradient(135deg, #f39c12, #e67e22); }
.log-details { flex: 1; }
.log-amount {
    font-size: 18px;
    font-weight: bold;
    color: var(--primary);
}
.log-amount.positive { color: var(--success); }
.log-amount.negative { color: var(--usdt); }
img.usdt-icon,
.modal-content img.usdt-icon {
    width: 24px;
    height: 24px;
    max-width: 24px;
    max-height: 24px;
    object-fit: contain;
    border-radius: 50%;
    flex-shrink: 0;
}
.log-status {
    font-size: 13px;
    color: var(--gray);
}
.log-date {
    font-size: 11px;
    color: #aaa;
    margin-top: 2px;
}
.log-type-badge {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 12px;
    background: #f0f2f5;
    color: var(--gray);
}

/* ===== POSTS SECTION ===== */
.posts-section { margin: 10px; }
.post-card {
    background: white;
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
}
.post-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}
.post-content {
    padding: 14px 16px;
}
.post-title {
    font-size: 15px;
    font-weight: bold;
    color: var(--dark);
    margin-bottom: 6px;
}
.post-text {
    font-size: 13px;
    color: var(--gray);
    line-height: 1.6;
}
.post-date {
    font-size: 11px;
    color: #aaa;
    margin-top: 8px;
}

/* ===== SECTION HEADERS ===== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    margin: 16px 0 10px;
}
.section-title {
    font-size: 16px;
    font-weight: bold;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-link {
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

/* ===== RESPONSIVE ===== */
@media (min-width: 768px) {
    body {
        max-width: 480px;
        margin: 0 auto;
        border-left: 1px solid #ddd;
        border-right: 1px solid #ddd;
    }

    .bottom-nav {
        max-width: 480px;
        left: 50%;
        transform: translateX(-50%);
    }
}

/* fix: webview-modal-small — Small mobile devices (width <= 480px) */
@media (max-width: 480px) {
    .modal-overlay {
        padding: 8px 12px;
        padding-top: calc(8px + env(safe-area-inset-top, 0px));
        padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
        /* تحويل المودال لأعلى الشاشة بدل الوسط خاصة على الجوال */
        align-items: flex-start;
    }
    .modal-content {
        width: min(calc(100% - 16px), 420px) !important;
        max-width: calc(100% - 16px) !important;
        padding: 14px !important;
        /* ارتفاع أقصى 80% حتى يبقى مجال تمرير داخل المحتوى ولا يختفي خلف الكيبورد */
        max-height: 80% !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    .modal-header h3 { font-size: 16px; }
}

/* fix: webview-modal-tablet — Tablet: constrain admin modals with large inline max-width */
@media (min-width: 481px) and (max-width: 768px) {
    .modal-content[style*="max-width:"] {
        max-width: calc(100vw - 32px) !important;
    }
}

/* Extra small mobile devices (width <= 360px) */
@media (max-width: 360px) {
    .auth-box {
        padding: 18px 12px;
    }
    .auth-logo h1 {
        font-size: 22px;
    }
    .auth-logo p {
        font-size: 12px;
    }
    .auth-tab {
        font-size: 13px;
        padding: 10px 6px;
    }
    .modal-content {
        width: calc(100vw - 12px) !important;
        max-width: none !important;
        padding: 12px !important;
    }
    .form-group label { font-size: 13px; }
    .btn-primary { font-size: 15px; padding: 12px; }
}

/* 4-column grids: reduce to 2 columns on small screens */
@media (max-width: 420px) {
    div[style*="repeat(4,1fr)"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ===== UTILITIES ===== */
.text-center { text-align: center; }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.hidden { display: none !important; }
.flex { display: flex; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.w-full { width: 100%; }

/* ===== FLOATING WHATSAPP SUPPORT BUTTON ===== */
.whatsapp-float {
    position: fixed;
    bottom: calc(90px + env(safe-area-inset-bottom, 0px)); /* above bottom-nav (height ~70px) */
    left: 16px;
    z-index: 1500;
    opacity: 0;
    transform: scale(0.8) translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    pointer-events: none;
}

.whatsapp-float.visible {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

.whatsapp-float-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #25D366; /* official WhatsApp green */
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(37, 211, 102, 0.45), 0 2px 6px rgba(0,0,0,0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    cursor: pointer;
    border: none;
    outline: none;
}

.whatsapp-float-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.55), 0 3px 8px rgba(0,0,0,0.2);
}

.whatsapp-float-btn:active {
    transform: scale(0.95);
}

/* Pulse animation ring */
.whatsapp-float-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    border: 2px solid #25D366;
    animation: whatsappPulse 2.5s ease-out infinite;
    opacity: 0.7;
}

@keyframes whatsappPulse {
    0%   { transform: scale(1);   opacity: 0.7; }
    70%  { transform: scale(1.5); opacity: 0; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* Tooltip */
.whatsapp-float-tooltip {
    position: absolute;
    bottom: 50%;
    left: calc(100% + 10px);
    transform: translateY(50%) scale(0.9);
    background: var(--dark);
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* RTL adjustment: tooltip on the right side of the button */
.whatsapp-float-tooltip::after {
    content: '';
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-right-color: var(--dark);
}

.whatsapp-float-btn:hover .whatsapp-float-tooltip {
    opacity: 1;
    transform: translateY(50%) scale(1);
}

/* Responsive adjustments */
@media (min-width: 768px) {
    .whatsapp-float {
        bottom: calc(100px + env(safe-area-inset-bottom, 0px));
        left: calc(50% - 240px + 16px); /* align within the 480px centered body */
    }
}

@media (max-width: 360px) {
    .whatsapp-float {
        bottom: calc(84px + env(safe-area-inset-bottom, 0px));
        left: 12px;
    }
    .whatsapp-float-btn {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
}

/* ===== DEPOSIT REDEMPTION ===== */
.redemption-available {
    color: #22C55E;
    font-weight: 600;
}
#daysCounterDisplay {
    font-variant-numeric: tabular-nums;
    direction: ltr;
    display: inline-block;
}

/* ===== FAQ CHAT ASSISTANT WIDGET ===== */
.faq-float-btn {
    position: fixed;
    bottom: calc(90px + env(safe-area-inset-bottom, 0px));
    right: 16px;
    z-index: 1500;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 14px rgba(231, 76, 60, 0.45), 0 2px 6px rgba(0,0,0,0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    opacity: 0;
    transform: scale(0.8) translateY(20px);
    pointer-events: none;
}

.faq-float-btn.visible {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

.faq-float-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.55);
}

.faq-float-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    border: 2px solid var(--primary);
    animation: faqPulse 2.5s ease-out infinite;
    opacity: 0.7;
}

@keyframes faqPulse {
    0%   { transform: scale(1);   opacity: 0.7; }
    70%  { transform: scale(1.5); opacity: 0; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* fix: webview-faq-panel — إصلاح الـ faq panel لـ Android WebView */
.faq-panel {
    position: fixed;
    /* استخدام inset لضمان التوافق مع WebView */
    bottom: 0;
    right: 0;
    left: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    z-index: 1600;
    background: rgba(255, 255, 255, 0.97);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -8px 32px rgba(0,0,0,0.15);
    /* fix: webview-transform — استخدام translate3d لتفعيل GPU acceleration في WebView */
    -webkit-transform: translate3d(0, 100%, 0);
    transform: translate3d(0, 100%, 0);
    -webkit-transition: -webkit-transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    /* fix: webview-height — استخدام % بدلاً من vh */
    max-height: 85%;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    overflow: hidden;
    /* fix: webview-will-change — تحسين الأداء */
    will-change: transform;
    /* fix: webview-stacking — ضمان ظهور فوق كل العناصر */
    -webkit-overflow-scrolling: touch;
}

.faq-panel.open {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
}

.faq-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    flex-shrink: 0;
}

.faq-panel-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.faq-panel-header h3 i {
    color: var(--primary);
}

.faq-close-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--gray);
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
}

.faq-close-btn:hover {
    color: var(--dark);
}

.faq-search-wrap {
    padding: 12px 20px;
    flex-shrink: 0;
    position: relative;
}

.faq-search-input {
    width: 100%;
    padding: 12px 16px 12px 40px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s;
    background: rgba(255,255,255,0.9);
    outline: none;
}

.faq-search-input:focus {
    border-color: var(--primary);
}

.faq-search-icon {
    position: absolute;
    right: 32px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
    font-size: 14px;
    pointer-events: none;
}

.faq-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 20px 20px;
    -webkit-overflow-scrolling: touch;
}

.faq-greeting {
    text-align: center;
    padding: 8px 0 16px;
}

.faq-greeting .greeting-icon {
    font-size: 36px;
    margin-bottom: 8px;
}

.faq-greeting h4 {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 4px;
}

.faq-greeting p {
    font-size: 13px;
    color: var(--gray);
}

.faq-section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--gray);
    margin: 16px 0 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.faq-suggestion {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(0,0,0,0.03);
    border-radius: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    width: 100%;
    text-align: right;
    font-family: inherit;
    font-size: 14px;
    color: var(--dark);
}

.faq-suggestion:hover {
    background: rgba(231, 76, 60, 0.08);
    transform: translateX(-2px);
}

.faq-suggestion .suggestion-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(231, 76, 60, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--primary);
    flex-shrink: 0;
}

.faq-suggestion .suggestion-text {
    flex: 1;
    text-align: right;
    line-height: 1.4;
}

.faq-suggestion .suggestion-score {
    font-size: 11px;
    color: var(--gray);
    flex-shrink: 0;
}

.faq-suggestion .suggestion-score .dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 4px;
}

.faq-suggestion .suggestion-score .dot.high { background: var(--success); }
.faq-suggestion .suggestion-score .dot.medium { background: var(--warning); }
.faq-suggestion .suggestion-score .dot.low { background: var(--gray); }

.faq-answer-view {
    display: none;
}

.faq-answer-view.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.faq-answer-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 0;
    margin-bottom: 12px;
    background: none;
    border: none;
    font-size: 13px;
    color: var(--primary);
    cursor: pointer;
    font-family: inherit;
}

.faq-answer-back:hover {
    opacity: 0.8;
}

.faq-answer-question {
    font-size: 16px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 12px;
    line-height: 1.5;
    padding: 12px;
    background: rgba(231, 76, 60, 0.06);
    border-radius: 12px;
    border-right: 3px solid var(--primary);
}

.faq-answer-text {
    font-size: 14px;
    color: #555;
    line-height: 1.8;
    margin-bottom: 16px;
}

.faq-answer-category {
    font-size: 11px;
    color: var(--gray);
    padding: 4px 10px;
    background: rgba(0,0,0,0.04);
    border-radius: 20px;
    display: inline-block;
}

.faq-no-results {
    text-align: center;
    padding: 24px 16px;
    color: var(--gray);
}

.faq-no-results i {
    font-size: 36px;
    margin-bottom: 10px;
    opacity: 0.5;
}

.faq-no-results p {
    font-size: 14px;
    margin-bottom: 16px;
}

.faq-loading-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 20px;
}

.faq-loading-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    animation: faqBounce 1.2s ease-in-out infinite;
}

.faq-loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.faq-loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes faqBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (min-width: 768px) {
    .faq-float-btn {
        right: calc(50% - 240px + 16px);
    }
    .faq-panel {
        left: auto;
        right: calc(50% - 240px + 16px);
        width: 380px;
        bottom: calc(90px + env(safe-area-inset-bottom, 0px));
        border-radius: 20px;
        box-shadow: 0 8px 32px rgba(0,0,0,0.18);
        max-height: 520px;
        padding-bottom: 0;
        -webkit-transform: scale(0.9) translate3d(0, 20px, 0);
        transform: scale(0.9) translate3d(0, 20px, 0);
        opacity: 0;
        -webkit-transition: opacity 0.3s ease, -webkit-transform 0.3s ease;
        transition: opacity 0.3s ease, transform 0.3s ease;
    }
    .faq-panel.open {
        -webkit-transform: scale(1) translate3d(0, 0, 0);
        transform: scale(1) translate3d(0, 0, 0);
        opacity: 1;
    }
}

@media (max-width: 360px) {
    .faq-float-btn {
        bottom: calc(84px + env(safe-area-inset-bottom, 0px));
        right: 12px;
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}

@media (prefers-color-scheme: dark) {
    .faq-panel {
        background: rgba(30, 30, 36, 0.97);
    }
    .faq-panel-header h3 { color: #e0e0e0; }
    .faq-panel-header { border-bottom-color: rgba(255,255,255,0.08); }
    .faq-search-input {
        background: rgba(255,255,255,0.06);
        border-color: rgba(255,255,255,0.12);
        color: #e0e0e0;
    }
    .faq-search-input::placeholder { color: #888; }
    .faq-search-input:focus { border-color: var(--primary); }
    .faq-greeting h4 { color: #e0e0e0; }
    .faq-suggestion { background: rgba(255,255,255,0.04); color: #ccc; }
    .faq-suggestion:hover { background: rgba(231, 76, 60, 0.15); }
    .faq-answer-question { background: rgba(231, 76, 60, 0.12); color: #e0e0e0; }
    .faq-answer-text { color: #aaa; }
    .faq-answer-category { background: rgba(255,255,255,0.06); color: #888; }
    .faq-section-title { color: #888; }
    .faq-panel-header .faq-close-btn { color: #888; }
    .faq-panel-header .faq-close-btn:hover { color: #e0e0e0; }
}

/* ===== HEADER SOCIAL ROW ===== */
.header-social-row {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.header-social-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.header-social-btn.hs-telegram {
    background: #229ED9;
}

.header-social-btn.hs-whatsapp {
    background: #25D366;
}

.hs-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
    flex-shrink: 0;
    background: rgba(255,255,255,0.2);
}

.hs-label {
    font-size: 11px;
    font-weight: 500;
    color: white;
    line-height: 1.2;
}

.header-social-btn:hover {
    filter: brightness(1.15);
    transform: scale(1.02);
}

.header-social-btn:active {
    transform: scale(0.97);
}
