/* ── Agent System Styles ── */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700&display=swap');

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

body {
    font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    min-height: 100vh;
    color: #fff;
    line-height: 1.7;
}

a { color: #6c63ff; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Language Switcher ── */
.lang-switch {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    direction: ltr;
    flex-wrap: wrap;
}
.lang-switch a {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 4px;
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
    border: 2px solid transparent;
    transition: all 0.2s;
    font-size: 0.65rem;
    font-weight: 700;
    color: rgba(255,255,255,0.5);
    text-decoration: none;
}
.lang-switch a img {
    width: 28px;
    height: 20px;
    border-radius: 3px;
    object-fit: cover;
}
.lang-switch a:hover { background: rgba(108,99,255,0.15); border-color: rgba(108,99,255,0.4); color: #fff; text-decoration: none; }
.lang-switch a.active { background: rgba(108,99,255,0.25); border-color: #6c63ff; color: #fff; }
@media (max-width: 480px) {
    .lang-switch { gap: 0.3rem; padding: 0.6rem; }
    .lang-switch a img { width: 22px; height: 16px; }
    .lang-switch a { font-size: 0.6rem; padding: 4px 3px; }
}

/* ── Landing Page ── */
.landing-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem;
}

.hero {
    text-align: center;
    padding: 3rem 0 2rem;
}
.hero-logo {
    max-width: 250px;
    width: 70%;
    margin-bottom: 1rem;
    filter: drop-shadow(0 4px 20px rgba(108,99,255,0.3));
    animation: logoFloat 4s ease-in-out infinite;
    border-radius: 20px;
}
@keyframes logoFloat { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-8px)} }

.hero h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #fff, #6c63ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero p {
    font-size: 1.15rem;
    color: rgba(255,255,255,0.7);
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* ── Buttons ── */
.btn {
    display: inline-block;
    padding: 0.9rem 2.5rem;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: inherit;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: #6c63ff; color: #fff; }
.btn-primary:hover { background: #5a52d5; color: #fff; }
.btn-outline { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,0.3); }
.btn-outline:hover { border-color: #6c63ff; color: #6c63ff; }
.btn-sm { padding: 0.5rem 1.5rem; font-size: 0.9rem; }
.btn-danger { background: #e74c3c; color: #fff; }
.btn-danger:hover { background: #c0392b; }
.btn-success { background: #27ae60; color: #fff; }
.btn-success:hover { background: #219a52; }

@keyframes btnPulse { 0%,100%{box-shadow:0 0 0 0 rgba(108,99,255,0.5)} 50%{box-shadow:0 0 0 12px rgba(108,99,255,0)} }
.btn-pulse { animation: btnPulse 2s ease-in-out infinite; }
.btn-pulse:hover { animation: none; }

/* ── Benefits Grid ── */
.benefits {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin: 3rem 0;
}
.benefit-card {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    transition: transform 0.2s, border-color 0.2s;
}
.benefit-card:hover { transform: translateY(-4px); border-color: rgba(108,99,255,0.4); }
.benefit-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.benefit-card h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.benefit-card p { color: rgba(255,255,255,0.6); font-size: 0.95rem; }

/* ── How It Works ── */
.how-section { text-align: center; margin: 3rem 0; }
.how-section h2 { font-size: 1.8rem; margin-bottom: 2rem; }
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}
.step {
    position: relative;
    padding: 1.5rem;
}
.step-num {
    width: 48px; height: 48px;
    border-radius: 50%;
    background: #6c63ff;
    color: #fff;
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}
.step p { color: rgba(255,255,255,0.8); font-size: 0.95rem; }

/* ── Pricing Table ── */
.pricing-section { margin: 3rem 0; text-align: center; }
.pricing-section h2 { font-size: 1.8rem; margin-bottom: 2rem; }
.pricing-table {
    max-width: 700px;
    margin: 0 auto;
    border-collapse: collapse;
    width: 100%;
}
.pricing-table th, .pricing-table td {
    padding: 1rem 1.5rem;
    text-align: center;
}
.pricing-table th {
    background: rgba(108,99,255,0.2);
    color: #fff;
    font-weight: 700;
}
.pricing-table td {
    background: rgba(255,255,255,0.05);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.pricing-table .profit { color: #2ecc71; font-weight: 700; }

/* ── Card (forms) ── */
.form-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 80px);
    padding: 2rem;
}
.card {
    background: #fff;
    border-radius: 16px;
    padding: 2.5rem;
    max-width: 560px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    color: #333;
}
.card h1 { font-size: 1.6rem; color: #302b63; margin-bottom: 0.3rem; }
.card h1 span { color: #6c63ff; }
.card .subtitle { color: #666; margin-bottom: 1.8rem; }

/* ── Form Elements ── */
.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: 0.4rem; color: #333; font-size: 0.95rem; }
.form-group .hint { display: block; color: #999; font-size: 0.8rem; margin-top: -0.2rem; margin-bottom: 0.3rem; }
.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
    background: #fff;
    color: #333;
}
.form-control:focus { outline: none; border-color: #6c63ff; }
select.form-control { cursor: pointer; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.form-submit {
    width: 100%;
    padding: 0.9rem;
    background: #6c63ff;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: 1.1rem;
    font-family: inherit;
    transition: background 0.2s;
    margin-top: 0.5rem;
}
.form-submit:hover { background: #5a52d5; }

/* ── Alerts ── */
.alert {
    padding: 0.9rem 1.2rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}
.alert-error { background: #fff5f5; color: #c0392b; border: 1px solid #f5c6cb; }
.alert-success { background: #f0fff4; color: #27ae60; border: 1px solid #c6f0c6; }
.alert-warning { background: #fffbf0; color: #e67e22; border: 1px solid #fde8b2; }
.alert-info { background: #f0f4ff; color: #6c63ff; border: 1px solid #d0d4ff; }

/* ── Result Page (verify email, success) ── */
.result-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}
.result-card {
    background: #fff;
    border-radius: 16px;
    padding: 3rem;
    max-width: 500px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    color: #333;
}
.result-icon { font-size: 4rem; margin-bottom: 1rem; }
.result-card h2 { font-size: 1.4rem; color: #302b63; margin-bottom: 0.8rem; }
.result-card p { color: #666; line-height: 1.8; margin-bottom: 1.5rem; }

/* ── Dashboard ── */
.dash-body {
    background: #f0f2f5;
    color: #333;
}

/* Topbar */
.dash-topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 60px;
    background: linear-gradient(135deg, #1a1a2e, #302b63);
    color: #fff;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    z-index: 200;
    justify-content: space-between;
}
.dash-topbar .brand { font-weight: 700; font-size: 1.2rem; }
.dash-topbar .brand span { color: #6c63ff; }
.dash-menu-btn {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Sidebar */
.dash-sidebar {
    position: fixed;
    top: 60px;
    width: 250px;
    height: calc(100vh - 60px);
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    overflow-y: auto;
    z-index: 150;
    transition: transform 0.3s ease;
}
[dir="rtl"] .dash-sidebar { right: 0; }
[dir="ltr"] .dash-sidebar { left: 0; }

.dash-sidebar .agent-info {
    text-align: center;
    padding: 1.5rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.agent-avatar {
    width: 70px; height: 70px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    margin: 0 auto 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    overflow: hidden;
}
.agent-avatar img { width: 100%; height: 100%; object-fit: cover; }
.agent-name { font-weight: 700; font-size: 1rem; }
.agent-balance {
    color: #2ecc71;
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 0.3rem;
}

.dash-nav { padding: 0.5rem 0; }
.dash-nav a {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1.5rem;
    color: rgba(255,255,255,0.7);
    font-size: 0.95rem;
    transition: all 0.2s;
    text-decoration: none;
}
.dash-nav a:hover { background: rgba(255,255,255,0.05); color: #fff; }
.dash-nav a.active { background: rgba(108,99,255,0.2); color: #fff; border-inline-start: 3px solid #6c63ff; }
.dash-nav a i { width: 20px; text-align: center; }
.nav-divider { height: 1px; background: rgba(255,255,255,0.1); margin: 0.5rem 1rem; }

/* Main content */
.dash-main {
    margin-top: 60px;
    padding: 2rem;
    min-height: calc(100vh - 60px);
}
[dir="rtl"] .dash-main { margin-right: 250px; }
[dir="ltr"] .dash-main { margin-left: 250px; }

/* Stat cards */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.2rem;
    margin-bottom: 2rem;
}
.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    text-align: center;
}
.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #302b63;
}
.stat-value.green { color: #27ae60; }
.stat-label {
    color: #999;
    font-size: 0.85rem;
    margin-top: 0.3rem;
}

/* Section panel */
.panel {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 1.5rem;
}
.panel h2 {
    font-size: 1.3rem;
    color: #302b63;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f0f2f5;
}

/* Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table th, .data-table td {
    padding: 0.8rem 1rem;
    text-align: start;
    border-bottom: 1px solid #f0f2f5;
    font-size: 0.9rem;
}
.data-table th {
    background: #f8f9fa;
    font-weight: 700;
    color: #555;
}
.data-table tr:hover { background: #f8f9fa; }

/* Code display */
.code-text {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.85rem;
    color: #302b63;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.2rem 0.7rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
}
.badge-success { background: #e8f5e9; color: #27ae60; }
.badge-warning { background: #fff8e1; color: #e67e22; }
.badge-danger { background: #fce4ec; color: #e74c3c; }
.badge-info { background: #e3f2fd; color: #2196f3; }
.badge-secondary { background: #f0f0f0; color: #666; }

/* Toast notification */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #333;
    color: #fff;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-size: 0.95rem;
    z-index: 9999;
    transition: transform 0.3s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.toast-success { background: #27ae60; }
.toast.toast-error { background: #e74c3c; }

/* Overlay */
.dash-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 140;
}

/* ── Directory Page ── */
.directory-container { max-width: 1100px; margin: 0 auto; padding: 2rem; }
.directory-header { text-align: center; padding: 1rem 0 0.5rem; }
.directory-header h1 {
    font-size: 2rem; font-weight: 700;
    background: linear-gradient(135deg, #fff, #6c63ff);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
    margin-bottom: 0.5rem;
}
.directory-header p { color: rgba(255,255,255,0.65); max-width: 550px; margin: 0 auto 1.5rem; }
.directory-search { max-width: 400px; margin: 0 auto 2rem; }
.directory-search input {
    width: 100%; padding: 0.75rem 1.2rem; border-radius: 50px;
    border: 2px solid rgba(255,255,255,0.15); background: rgba(255,255,255,0.08);
    color: #fff; font-family: inherit; font-size: 1rem; transition: border-color 0.2s;
}
.directory-search input::placeholder { color: rgba(255,255,255,0.4); }
.directory-search input:focus { outline: none; border-color: #6c63ff; }

.country-section { margin-bottom: 2.5rem; }
.country-section h2 {
    font-size: 1.3rem; color: #fff; padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(108,99,255,0.3); margin-bottom: 1.2rem;
}
.agent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 1.2rem; }
.agent-card {
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px; padding: 1.5rem; text-align: center; transition: transform 0.2s, border-color 0.2s;
}
.agent-card:hover { transform: translateY(-4px); border-color: rgba(108,99,255,0.4); }
.agent-photo {
    width: 70px; height: 70px; border-radius: 50%; margin: 0 auto 0.8rem;
    background: rgba(255,255,255,0.12); display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem; color: rgba(255,255,255,0.4); overflow: hidden;
}
.agent-photo img { width: 100%; height: 100%; object-fit: cover; }
.agent-name { font-weight: 700; font-size: 1.05rem; margin-bottom: 0.2rem; }
.agent-city { color: rgba(255,255,255,0.5); font-size: 0.9rem; margin-bottom: 0.8rem; }
.codes-badge {
    display: inline-block; background: rgba(39,174,96,0.15); color: #2ecc71;
    padding: 0.2rem 0.8rem; border-radius: 20px; font-size: 0.85rem; font-weight: 600; margin-bottom: 1rem;
}
.btn-whatsapp {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: #25D366; color: #fff; padding: 0.5rem 1.5rem; border-radius: 50px;
    font-weight: 700; font-size: 0.9rem; transition: background 0.2s, transform 0.2s;
}
.btn-whatsapp:hover { background: #1da851; color: #fff; text-decoration: none; transform: translateY(-2px); }

/* ── Country Filter Chips ── */
.country-chips {
    display: flex; flex-wrap: wrap; justify-content: center;
    gap: 0.6rem; max-width: 900px; margin: 0 auto 1.5rem;
}
.country-chip {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.55rem 1rem; border-radius: 50px;
    background: rgba(255,255,255,0.08); border: 1.5px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.85); font-family: inherit; font-size: 0.9rem;
    font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.country-chip:hover { background: rgba(108,99,255,0.18); border-color: rgba(108,99,255,0.5); color: #fff; }
.country-chip.active { background: #6c63ff; border-color: #6c63ff; color: #fff; box-shadow: 0 4px 14px rgba(108,99,255,0.4); }
.country-chip i { font-size: 0.85rem; opacity: 0.85; }
.chip-count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 22px; height: 22px; padding: 0 6px;
    background: rgba(0,0,0,0.25); border-radius: 12px;
    font-size: 0.75rem; font-weight: 700;
}
.country-chip.active .chip-count { background: rgba(255,255,255,0.25); }

/* ── Become Agent CTA ── */
.become-agent-cta {
    display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
    gap: 1rem; max-width: 700px; margin: 1.5rem auto 0;
    padding: 1.2rem 1.5rem; border-radius: 16px;
    background: linear-gradient(135deg, rgba(108,99,255,0.15), rgba(108,99,255,0.05));
    border: 1px solid rgba(108,99,255,0.3);
}
.become-agent-cta .cta-text {
    display: flex; align-items: center; gap: 0.7rem;
    color: #fff; font-size: 1rem; font-weight: 600;
}
.become-agent-cta .cta-text i { color: #6c63ff; font-size: 1.3rem; }
.become-agent-cta .cta-btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: #6c63ff; color: #fff;
    padding: 0.6rem 1.4rem; border-radius: 50px;
    font-weight: 700; font-size: 0.95rem;
    text-decoration: none; transition: all 0.2s;
    box-shadow: 0 4px 14px rgba(108,99,255,0.4);
}
.become-agent-cta .cta-btn:hover { background: #5a52d5; color: #fff; text-decoration: none; transform: translateY(-2px); }
[dir="rtl"] .become-agent-cta .cta-btn i { transform: rotate(180deg); }
@media (max-width: 600px) {
    .become-agent-cta { flex-direction: column; text-align: center; padding: 1.2rem; }
    .become-agent-cta .cta-text { flex-direction: column; gap: 0.5rem; }
    .country-chip { font-size: 0.82rem; padding: 0.45rem 0.85rem; }
}

/* ── Language Flag Dropdown (mobile) ── */
.lang-flags-desktop { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.lang-flag-mobile { display: none; position: relative; }
.lang-flag-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 10px; border-radius: 8px;
    background: rgba(108,99,255,0.25); border: 1px solid #6c63ff;
    color: #fff; font-size: 0.75rem; font-weight: 700;
    font-family: inherit; cursor: pointer;
}
.lang-dropdown {
    display: none; position: absolute; top: 100%; right: 0;
    margin-top: 6px; background: #1a1a2e; border: 1px solid rgba(255,255,255,0.15);
    border-radius: 10px; padding: 0.4rem; min-width: 100px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4); z-index: 300;
}
[dir="rtl"] .lang-dropdown { right: auto; left: 0; }
.lang-flag-mobile.open .lang-dropdown { display: block; }
.lang-dropdown a {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 10px; border-radius: 6px;
    color: rgba(255,255,255,0.7); font-size: 0.8rem;
    font-weight: 600; text-decoration: none; transition: background 0.15s;
}
.lang-dropdown a:hover { background: rgba(108,99,255,0.2); color: #fff; text-decoration: none; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .directory-header h1 { font-size: 1.5rem; }
    .agent-grid { grid-template-columns: repeat(2, 1fr); }
    .hero h1 { font-size: 1.6rem; }
    .hero p { font-size: 1rem; }
    .form-row { grid-template-columns: 1fr; }
    .card { padding: 1.8rem; }
    .benefits { grid-template-columns: 1fr; }
    .steps { grid-template-columns: 1fr 1fr; }

    .dash-menu-btn { display: block; font-size: 1.8rem; padding: 0.3rem 0.5rem; }
    .lang-flags-desktop { display: none; }
    .lang-flag-mobile { display: block; }
    .dash-sidebar { transform: translateX(-100%); }
    [dir="rtl"] .dash-sidebar { transform: translateX(100%); }
    .dash-sidebar.open { transform: translateX(0); }
    .dash-overlay.open { display: block; }
    [dir="rtl"] .dash-main { margin-right: 0; }
    [dir="ltr"] .dash-main { margin-left: 0; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .agent-grid { grid-template-columns: 1fr; }
    .landing-container { padding: 1rem; }
    .hero { padding: 2rem 0 1rem; }
    .hero-logo { max-width: 180px; }
    .steps { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: 1fr; }
    .panel { padding: 1.2rem; }
    .data-table { font-size: 0.8rem; }
    .data-table th, .data-table td { padding: 0.6rem 0.5rem; }
}
