/* ============================================
   FlyON - Premium eSIM Global Connectivity
   Dark Mode Design System
   ============================================ */

:root {
    /* Core Colors - Inspired by logo gradient */
    --primary: #00E5FF;
    --primary-light: #4AF7FF;
    --primary-dark: #00B8D4;
    --secondary: #4ADE80;
    --accent-yellow: #FACC15;
    --accent-orange: #FB923C;
    --accent-pink: #F472B6;
    --accent-purple: #A855F7;

    /* Gradient */
    --gradient-primary: linear-gradient(135deg, #00E5FF, #4ADE80, #FACC15, #FB923C, #F472B6);
    --gradient-card: linear-gradient(135deg, #00E5FF 0%, #4ADE80 100%);
    --gradient-warm: linear-gradient(135deg, #FACC15, #FB923C, #F472B6);
    --gradient-cool: linear-gradient(135deg, #00E5FF, #A855F7);
    --gradient-mesh: radial-gradient(at 40% 20%, rgba(0, 229, 255, 0.08) 0px, transparent 50%),
                     radial-gradient(at 80% 0%, rgba(74, 222, 128, 0.06) 0px, transparent 50%),
                     radial-gradient(at 0% 50%, rgba(168, 85, 247, 0.06) 0px, transparent 50%),
                     radial-gradient(at 80% 100%, rgba(244, 114, 182, 0.05) 0px, transparent 50%);

    /* Backgrounds */
    --bg-primary: #07070d;
    --bg-secondary: #0d0d16;
    --bg-card: #12121e;
    --bg-card-hover: #18182a;
    --bg-elevated: #1a1a2e;
    --bg-input: #16162a;
    --bg-nav: rgba(7, 7, 13, 0.85);

    /* Text */
    --text-primary: #F0F0F5;
    --text-secondary: #9CA3AF;
    --text-muted: #6B7280;
    --text-accent: #00E5FF;

    /* Borders */
    --border: rgba(255, 255, 255, 0.06);
    --border-light: rgba(255, 255, 255, 0.1);
    --border-accent: rgba(0, 229, 255, 0.3);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(0, 229, 255, 0.15);
    --shadow-glow-strong: 0 0 40px rgba(0, 229, 255, 0.25);

    /* Sizing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    --top-bar-height: 60px;
    --bottom-nav-height: 70px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Font */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-rtl: 'Vazirmatn', 'Inter', sans-serif;
}

/* ============================================
   Reset & Base
   ============================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: var(--font-primary);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* RTL Support */
html[dir="rtl"] body {
    font-family: var(--font-rtl);
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    display: block;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    color: inherit;
}

input, select, textarea {
    font-family: inherit;
    color: inherit;
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ============================================
   Splash Screen
   ============================================ */
.splash {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.splash.hide {
    opacity: 0;
    visibility: hidden;
}

.splash-content {
    text-align: center;
}

.splash-logo {
    width: 100px;
    height: 100px;
    animation: pulse-glow 2s ease-in-out infinite;
    margin-bottom: 24px;
}

.splash-loader {
    width: 40px;
    height: 40px;
    margin: 0 auto;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

@keyframes pulse-glow {
    0%, 100% { filter: drop-shadow(0 0 10px rgba(0, 229, 255, 0.3)); }
    50% { filter: drop-shadow(0 0 30px rgba(0, 229, 255, 0.6)); }
}

/* ============================================
   Top Navigation Bar
   ============================================ */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--top-bar-height);
    background: var(--bg-nav);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    transition: transform var(--transition-normal);
}

.top-bar.hidden {
    transform: translateY(-100%);
}

.top-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 16px;
    max-width: 1400px;
    margin: 0 auto;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.menu-btn {
    display: flex;
    width: 36px;
    height: 36px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.menu-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all var(--transition-normal);
}

.menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-logo {
    width: 36px;
    height: 36px;
}

.logo-text {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.icon-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 18px;
    transition: all var(--transition-fast);
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--primary);
}

.auth-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-avatar-btn {
    padding: 2px;
}

.avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--bg-primary);
    font-weight: 600;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14px;
    transition: all var(--transition-fast);
    white-space: normal;
    word-break: keep-all;
    overflow-wrap: break-word;
    cursor: pointer;
    border: none;
    outline: none;
    position: relative;
    text-align: center;
    line-height: 1.3;
    min-height: 44px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: var(--radius-sm);
    min-height: 36px;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 16px;
    min-height: 48px;
}

.btn-primary {
    background: var(--gradient-card);
    color: var(--bg-primary);
    box-shadow: 0 4px 15px rgba(0, 229, 255, 0.25);
}

.btn-primary:hover {
    box-shadow: 0 4px 25px rgba(0, 229, 255, 0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover {
    border-color: var(--primary);
    background: rgba(0, 229, 255, 0.05);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.btn-danger {
    background: #EF4444;
    color: white;
}

.btn-danger:hover {
    background: #DC2626;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-primary);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-gradient {
    background: var(--gradient-primary);
    color: var(--bg-primary);
    font-weight: 700;
    box-shadow: var(--shadow-glow);
}

.btn-gradient:hover {
    box-shadow: var(--shadow-glow-strong);
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-block {
    width: 100%;
}

/* ============================================
   Dropdown Menu
   ============================================ */
.dropdown-menu {
    position: fixed;
    top: 55px;
    right: 16px;
    min-width: 200px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 8px;
    z-index: 1001;
    display: none;
    animation: fadeInDown 0.2s ease;
}

html[dir="rtl"] .dropdown-menu {
    right: auto;
    left: 16px;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.dropdown-item i {
    width: 18px;
    text-align: center;
    font-size: 15px;
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 6px 0;
}

.text-danger {
    color: #EF4444 !important;
}

/* ============================================
   Side Navigation (Mobile)
   ============================================ */
.side-nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.side-nav-overlay.show {
    opacity: 1;
    visibility: visible;
}

.side-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100%;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

html[dir="rtl"] .side-nav {
    left: auto;
    right: 0;
    border-right: none;
    border-left: 1px solid var(--border);
    transform: translateX(100%);
}

.side-nav.show {
    transform: translateX(0) !important;
}

.side-nav-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 20px;
    border-bottom: 1px solid var(--border);
}

.side-nav-logo {
    width: 40px;
    height: 40px;
}

.side-nav-body {
    padding: 12px;
    flex: 1;
}

.side-nav-version {
    padding: 12px 16px;
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    border-top: 1px solid var(--border);
    opacity: 0.6;
    letter-spacing: 0.5px;
}

.side-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 15px;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    margin-bottom: 2px;
}

.side-nav-item:hover, .side-nav-item.active {
    background: rgba(0, 229, 255, 0.08);
    color: var(--primary);
}

.side-nav-item i {
    width: 22px;
    text-align: center;
    font-size: 16px;
}

.side-nav-divider {
    height: 1px;
    background: var(--border);
    margin: 10px 0;
}

.side-nav-item.guest-only {
    margin-top: 6px;
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.12), rgba(0, 212, 170, 0.08));
    border: 1px solid rgba(0, 229, 255, 0.25);
    color: var(--primary);
    font-weight: 600;
}
.side-nav-item.guest-only:hover {
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.2), rgba(0, 212, 170, 0.14));
}

/* ============================================
   Bottom Navigation (Mobile)
   ============================================ */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px));
    background: var(--bg-nav);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    z-index: 999;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex: 1;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 500;
    transition: all var(--transition-fast);
    position: relative;
    padding: 8px 0;
}

.bottom-nav-item i {
    font-size: 20px;
    transition: all var(--transition-fast);
}

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

.bottom-nav-item.active i {
    transform: scale(1.1);
}

.bottom-nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 3px;
    background: var(--gradient-card);
    border-radius: 0 0 4px 4px;
}

/* ============================================
   Main Content
   ============================================ */
.main-content {
    padding-top: var(--top-bar-height);
    min-height: 100vh;
    min-height: 100dvh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

.page {
    animation: fadeIn 0.3s ease;
}

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

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

/* ============================================
   Hero Section
   ============================================ */
.hero {
    position: relative;
    padding: 60px 0 40px;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-mesh);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    background: rgba(0, 229, 255, 0.1);
    border: 1px solid rgba(0, 229, 255, 0.2);
    border-radius: var(--radius-full);
    font-size: 13px;
    color: var(--primary);
    margin-bottom: 20px;
    font-weight: 500;
}

.hero h1 {
    font-size: clamp(32px, 6vw, 56px);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 16px;
    letter-spacing: -1px;
}

.hero p {
    font-size: clamp(15px, 2vw, 18px);
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid var(--border);
}

.hero-stat {
    text-align: center;
}

.hero-stat-value {
    font-size: 28px;
    font-weight: 800;
    background: var(--gradient-card);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Floating orbs background */
.hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    pointer-events: none;
}

.hero-orb-1 {
    width: 400px;
    height: 400px;
    background: var(--primary);
    top: -100px;
    right: -100px;
}

.hero-orb-2 {
    width: 300px;
    height: 300px;
    background: var(--accent-purple);
    bottom: -50px;
    left: -50px;
}

.hero-orb-3 {
    width: 200px;
    height: 200px;
    background: var(--accent-pink);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* ============================================
   Hero Banner Mode (background behind hero text)
   ============================================ */
.hero-banner-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}
.hero-banner-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}
.hero-banner-bg .banner-desktop { display: block; }
.hero-banner-bg .banner-mobile  { display: none; }

@media (min-width: 769px) {
    .hero.has-banner-desktop::before {
        background: rgba(0, 0, 0, 0.55);
        z-index: 1;
    }
    .hero.has-banner-desktop .hero-orb { display: none; }
}
@media (max-width: 768px) {
    .hero.has-banner-mobile::before {
        background: rgba(0, 0, 0, 0.55);
        z-index: 1;
    }
    .hero.has-banner-mobile .hero-orb { display: none; }
}

.hero-carousel-slides {
    position: absolute;
    inset: 0;
}
.hero-carousel-slides .hero-banner-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.8s ease;
}
.hero-carousel-slides .hero-banner-slide.active {
    opacity: 1;
}
.hero-carousel-slides .hero-banner-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.hero-carousel-dots {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 3;
}
.hero-carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.7);
    background: transparent;
    cursor: pointer;
    padding: 0;
    transition: all 0.3s;
}
.hero-carousel-dot.active {
    background: #fff;
    transform: scale(1.2);
    box-shadow: 0 0 8px rgba(255,255,255,0.5);
}
.hero-carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    z-index: 3;
    transition: all 0.3s;
    opacity: 0.7;
}
.hero-carousel-arrow:hover {
    opacity: 1;
    background: rgba(0,0,0,0.7);
}
.hero-carousel-prev { left: 16px; }
.hero-carousel-next { right: 16px; }

@media (max-width: 768px) {
    .hero-banner-bg .banner-desktop { display: none; }
    .hero-banner-bg .banner-mobile  { display: block; }
    .hero-carousel-arrow {
        width: 34px;
        height: 34px;
        font-size: 13px;
    }
    .hero-carousel-prev { left: 10px; }
    .hero-carousel-next { right: 10px; }
    .hero-carousel-dots { bottom: 12px; }
    .hero-carousel-dot { width: 8px; height: 8px; }
}

/* ============================================
   Search Bar
   ============================================ */
.search-section {
    padding: 0 0 40px;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 6px 6px 6px 20px;
    max-width: 600px;
    margin: 0 auto;
    transition: all var(--transition-fast);
}

.search-bar:focus-within {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.search-bar i {
    color: var(--text-muted);
    font-size: 18px;
}

.search-bar input {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    font-size: 15px;
    color: var(--text-primary);
    padding: 10px 0;
}

.search-bar input::placeholder {
    color: var(--text-muted);
}

.search-bar .btn {
    flex-shrink: 0;
}

/* ============================================
   Section Headers
   ============================================ */
.section {
    padding: 30px 0;
}

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

.section-title {
    font-size: 22px;
    font-weight: 700;
}

.section-link {
    font-size: 14px;
    color: var(--primary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all var(--transition-fast);
}

.section-link:hover {
    gap: 8px;
}

/* ============================================
   Region Tabs / Filter
   ============================================ */
/* Countries page sticky bar */
.countries-page { padding-top: 0; }
.countries-sticky-bar {
    position: fixed;
    top: var(--top-bar-height);
    left: 0;
    right: 0;
    z-index: 40;
    background: rgba(10, 10, 18, 0.92);
    padding: 14px 0 10px;
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}
.countries-list-area {
    padding-top: 130px;
}

.region-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.region-tabs::-webkit-scrollbar {
    display: none;
}

.region-tab {
    padding: 8px 20px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.region-tab:hover {
    border-color: var(--border-light);
    color: var(--text-primary);
}

.region-tab.active {
    background: var(--primary);
    color: var(--bg-primary);
    border-color: var(--primary);
}

/* ============================================
   Country Cards
   ============================================ */
.country-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.country-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.country-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-card);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.country-card:hover {
    border-color: var(--border-accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.country-card:hover::before {
    opacity: 0.05;
}

.country-flag {
    font-size: 36px;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.country-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    position: relative;
    z-index: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.country-price {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    position: relative;
    z-index: 1;
}

.country-price span {
    color: var(--primary);
    font-weight: 600;
}

/* ============================================
   Package Cards
   ============================================ */
.package-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

/* Duration Filter Bar */
.duration-filter-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.duration-chip {
    padding: 8px 18px;
    border-radius: 24px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.duration-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.duration-chip.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    border-color: transparent;
    font-weight: 600;
}

/* Duration Group */
.duration-group {
    margin-bottom: 28px;
}

.duration-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.duration-group-header i {
    color: var(--primary);
    font-size: 14px;
}

.package-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.package-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-card);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.package-card:hover {
    border-color: var(--border-accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.package-card:hover::after {
    opacity: 1;
}

.package-card.popular {
    border-color: rgba(0, 229, 255, 0.3);
}

.package-card.popular::after {
    opacity: 1;
}

.package-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 4px 10px;
    background: var(--gradient-warm);
    color: var(--bg-primary);
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

html[dir="rtl"] .package-badge {
    right: auto;
    left: 16px;
}

.package-header {
    margin-bottom: 16px;
}

.package-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.package-country {
    font-size: 13px;
    color: var(--text-muted);
}

.package-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.package-detail {
    display: flex;
    align-items: center;
    gap: 8px;
}

.package-detail-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: rgba(0, 229, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 14px;
    flex-shrink: 0;
}

.package-detail-text {
    font-size: 12px;
    color: var(--text-muted);
}

.package-detail-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.package-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.package-price {
    font-size: 28px;
    font-weight: 800;
    background: var(--gradient-card);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.package-price-currency {
    font-size: 14px;
    font-weight: 500;
    -webkit-text-fill-color: var(--text-muted);
}

/* ============================================
   Discount Badge & Price Styles
   ============================================ */
.package-card.has-discount {
    border-color: rgba(255, 107, 107, 0.35);
    position: relative;
}

.package-card.has-discount::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #FF6B6B, #FF8E53, #FF6B6B);
    opacity: 1;
    z-index: 2;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.package-card.has-discount:hover {
    border-color: rgba(255, 107, 107, 0.55);
    box-shadow: 0 0 24px rgba(255, 107, 107, 0.15), var(--shadow-glow);
}

.discount-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 5px 12px;
    background: linear-gradient(135deg, #FF6B6B, #FF8E53);
    color: #fff;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.3px;
    z-index: 3;
    box-shadow: 0 2px 12px rgba(255, 107, 107, 0.4);
    animation: discountPulse 2s ease-in-out infinite;
    display: flex;
    align-items: center;
    gap: 5px;
}

html[dir="rtl"] .discount-badge {
    right: auto;
    left: 12px;
}

@keyframes discountPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 2px 12px rgba(255, 107, 107, 0.4); }
    50% { transform: scale(1.05); box-shadow: 0 4px 20px rgba(255, 107, 107, 0.6); }
}

.discount-badge i {
    font-size: 10px;
}

.package-price-area {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.package-price-original {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: line-through;
    opacity: 0.6;
    -webkit-text-fill-color: var(--text-muted);
}

.package-price.discounted {
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(135deg, #FF6B6B, #FF8E53);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   Popular / Featured Cards (horizontal scroll)
   ============================================ */
.scroll-wrapper {
    position: relative;
}

.scroll-arrow {
    display: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(10, 10, 18, 0.85);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    font-size: 16px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    backdrop-filter: blur(8px);
}

.scroll-arrow:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.scroll-arrow-left { left: -16px; }
.scroll-arrow-right { right: -16px; }

@media (min-width: 769px) {
    .scroll-wrapper:hover .scroll-arrow {
        display: flex;
    }
}

.scroll-container {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 12px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.scroll-container::-webkit-scrollbar {
    display: none;
}

.scroll-container .package-card {
    min-width: 300px;
    scroll-snap-align: start;
    flex-shrink: 0;
}

/* ============================================
   Country Detail Page
   ============================================ */
.country-hero {
    text-align: center;
    padding: 40px 0 30px;
    position: relative;
}

.country-hero-flag {
    font-size: 64px;
    margin-bottom: 12px;
}

.country-hero-name {
    font-size: 32px;
    font-weight: 800;
}

.country-hero-region {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 4px;
}

/* Country Banner Mode */
.country-hero-banner {
    padding: 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.country-banner-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.country-banner-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.country-hero-overlay {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 60px 20px;
    width: 100%;
}

.country-hero-banner .country-hero-overlay .country-hero-name {
    color: #fff;
    text-shadow: 0 2px 16px rgba(0,0,0,0.8), 0 0 40px rgba(0,0,0,0.3);
    font-size: 36px;
}

.country-hero-banner .country-hero-overlay .country-hero-region {
    color: rgba(255,255,255,0.9);
    text-shadow: 0 1px 8px rgba(0,0,0,0.7);
    font-size: 15px;
    margin-top: 6px;
}

.country-hero-banner::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.5) 100%);
    pointer-events: none;
    border-radius: var(--radius-lg);
}

/* Fallback (shown when banner is platform-specific and doesn't match) */
.country-hero-fallback {
    text-align: center;
    padding: 40px 0 30px;
    display: none;
}

/* Desktop view: show desktop img, hide mobile img */
.country-banner-bg .cb-desktop { display: block; }
.country-banner-bg .cb-mobile  { display: none; }

/* When only mobile banner exists: on desktop show fallback */
.country-hero-banner.cb-has-mobile:not(.cb-has-desktop) .country-hero-overlay { display: none; }
.country-hero-banner.cb-has-mobile:not(.cb-has-desktop) .country-banner-bg { display: none; }
.country-hero-banner.cb-has-mobile:not(.cb-has-desktop) .country-hero-fallback { display: block; }
.country-hero-banner.cb-has-mobile:not(.cb-has-desktop)::after { display: none; }
.country-hero-banner.cb-has-mobile:not(.cb-has-desktop) { min-height: auto; }

@media (max-width: 768px) {
    .country-hero-banner {
        min-height: 200px;
        border-radius: var(--radius-md);
    }
    /* Mobile view: show mobile img, hide desktop img */
    .country-banner-bg .cb-desktop { display: none; }
    .country-banner-bg .cb-mobile  { display: block; }

    /* When only desktop banner exists: on mobile show fallback */
    .country-hero-banner.cb-has-desktop:not(.cb-has-mobile) .country-hero-overlay { display: none; }
    .country-hero-banner.cb-has-desktop:not(.cb-has-mobile) .country-banner-bg { display: none; }
    .country-hero-banner.cb-has-desktop:not(.cb-has-mobile) .country-hero-fallback { display: block; }
    .country-hero-banner.cb-has-desktop:not(.cb-has-mobile)::after { display: none; }
    .country-hero-banner.cb-has-desktop:not(.cb-has-mobile) { min-height: auto; }

    /* When only mobile banner exists: on mobile show it */
    .country-hero-banner.cb-has-mobile:not(.cb-has-desktop) .country-hero-overlay { display: block; }
    .country-hero-banner.cb-has-mobile:not(.cb-has-desktop) .country-banner-bg { display: block; }
    .country-hero-banner.cb-has-mobile:not(.cb-has-desktop) .country-hero-fallback { display: none; }
    .country-hero-banner.cb-has-mobile:not(.cb-has-desktop)::after { display: block; }
    .country-hero-banner.cb-has-mobile:not(.cb-has-desktop) { min-height: 200px; }

    .country-hero-overlay {
        padding: 40px 16px;
    }
    .country-hero-banner .country-hero-overlay .country-hero-name {
        font-size: 26px;
    }
    .country-hero-banner .country-hero-overlay .country-hero-region {
        font-size: 13px;
    }
}

/* ============================================
   Auth Pages (Login / Register)
   ============================================ */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--top-bar-height));
    padding: 40px 16px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 40px 32px;
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
}

.auth-logo {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
}

.auth-title {
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 32px;
}

/* Google Sign-In Button */
.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #fff;
    color: #3c4043;
    border: 1px solid #dadce0;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 15px;
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-google:hover {
    background: #f8f9fa;
    border-color: #c6c9cc;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    color: #3c4043;
}
.btn-google:active { background: #eef0f2; }

/* Auth Divider (OR) */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 20px 0;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
}
.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ============================================
   Form Elements
   ============================================ */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 15px;
    color: var(--text-primary);
    outline: none;
    transition: all var(--transition-fast);
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.1);
}

.form-input::placeholder {
    color: var(--text-muted);
}

/* Dark mode date/time inputs */
input[type="date"].form-input,
input[type="time"].form-input,
input[type="datetime-local"].form-input {
    color-scheme: dark;
}
input[type="date"].form-input::-webkit-calendar-picker-indicator,
input[type="time"].form-input::-webkit-calendar-picker-indicator,
input[type="datetime-local"].form-input::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

.form-input-icon {
    position: relative;
}

.form-input-icon .form-input {
    padding-left: 42px;
}

html[dir="rtl"] .form-input-icon .form-input {
    padding-left: 16px;
    padding-right: 42px;
}

.form-input-icon i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
}

html[dir="rtl"] .form-input-icon i {
    left: auto;
    right: 14px;
}

.form-error {
    font-size: 12px;
    color: #EF4444;
    margin-top: 6px;
}

.form-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-muted);
}

.form-footer a {
    color: var(--primary);
    font-weight: 500;
}

select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239CA3AF' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

html[dir="rtl"] select.form-input {
    background-position: left 14px center;
    padding-right: 16px;
    padding-left: 36px;
}

/* ============================================
   Dashboard
   ============================================ */
.dashboard-header {
    padding: 30px 0 20px;
}

.dashboard-greeting {
    font-size: 28px;
    font-weight: 800;
}

.dashboard-subtitle {
    color: var(--text-muted);
    margin-top: 4px;
}

.dashboard-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.1;
}

.stat-card:nth-child(1)::after { background: var(--primary); }
.stat-card:nth-child(2)::after { background: var(--secondary); }
.stat-card:nth-child(3)::after { background: var(--accent-purple); }

.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 12px;
}

.stat-icon.cyan {
    background: rgba(0, 229, 255, 0.1);
    color: var(--primary);
}

.stat-icon.green {
    background: rgba(74, 222, 128, 0.1);
    color: var(--secondary);
}

.stat-icon.purple {
    background: rgba(168, 85, 247, 0.1);
    color: var(--accent-purple);
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ============================================
   eSIM Cards
   ============================================ */
.esim-list {
    display: grid;
    gap: 16px;
}

.esim-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-normal);
}

.esim-card:hover {
    border-color: var(--border-accent);
}

.esim-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
}

.esim-country {
    display: flex;
    align-items: center;
    gap: 12px;
}

.esim-country-flag {
    font-size: 32px;
}

.esim-country-name {
    font-size: 18px;
    font-weight: 700;
}

.esim-package-name {
    font-size: 13px;
    color: var(--text-muted);
}

.esim-status {
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.esim-status.active {
    background: rgba(74, 222, 128, 0.15);
    color: var(--secondary);
}

.esim-status.expired {
    background: rgba(239, 68, 68, 0.15);
    color: #EF4444;
}

.esim-status.inactive {
    background: rgba(156, 163, 175, 0.15);
    color: var(--text-muted);
}

.esim-progress {
    margin-bottom: 16px;
}

.esim-progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
}

.esim-progress-label {
    color: var(--text-muted);
}

.esim-progress-value {
    font-weight: 600;
}

.progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-card);
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
    min-width: 2%;
}

.progress-fill.warning {
    background: var(--gradient-warm);
}

.esim-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.esim-info-item {
    background: rgba(255, 255, 255, 0.02);
    padding: 12px;
    border-radius: var(--radius-sm);
}

.esim-info-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.esim-info-value {
    font-size: 14px;
    font-weight: 600;
    word-break: break-all;
}

.esim-detail-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.esim-activation-code {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    word-break: break-all;
    line-height: 1.5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.copy-btn {
    flex-shrink: 0;
    padding: 6px 12px;
    background: rgba(0, 229, 255, 0.1);
    color: var(--primary);
    border-radius: var(--radius-sm);
    font-size: 12px;
    transition: all var(--transition-fast);
}

.copy-btn:hover {
    background: rgba(0, 229, 255, 0.2);
}

/* ---- QR Code & Share Section ---- */
.esim-qr-section {
    text-align: center;
}

.esim-qr-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.esim-qr-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(108, 99, 255, 0.06);
    border: 1px solid rgba(108, 99, 255, 0.15);
    border-radius: 20px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    box-shadow:
        0 0 40px rgba(108, 99, 255, 0.08),
        0 0 80px rgba(0, 212, 170, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.esim-qr-container:hover {
    box-shadow:
        0 0 50px rgba(108, 99, 255, 0.15),
        0 0 100px rgba(0, 212, 170, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.esim-qr-container::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    padding: 1.5px;
    background: linear-gradient(135deg, rgba(108,99,255,0.5), rgba(0,212,170,0.5));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.esim-qr-container canvas,
.esim-qr-container img {
    border-radius: 4px;
}

.esim-qr-hint {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

.esim-share-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-share {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all var(--transition-fast);
}

.btn-share i {
    font-size: 16px;
}

.btn-share-main {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    box-shadow: 0 4px 16px rgba(108, 99, 255, 0.3);
}

.btn-share-main:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(108, 99, 255, 0.4);
}

.btn-share-main:active {
    transform: translateY(0);
}

.btn-share-qr {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-share-qr:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-color: var(--primary);
}

/* Install Steps - styled */
.esim-install-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.esim-install-step {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.esim-install-step:hover {
    background: rgba(108, 99, 255, 0.04);
    border-color: rgba(108, 99, 255, 0.2);
}

.step-number {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
}

.step-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    padding-top: 3px;
}

/* Share Toast */
.share-toast {
    position: fixed;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    padding: 12px 28px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    z-index: 99999;
    transition: bottom 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 32px rgba(108, 99, 255, 0.4);
    white-space: nowrap;
}

.share-toast.show {
    bottom: calc(env(safe-area-inset-bottom, 16px) + 80px);
}

/* ============================================
   Top-Up Section & Modal
   ============================================ */

.esim-topup-section {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(99, 102, 241, 0.08) 100%);
    border: 1px solid rgba(16, 185, 129, 0.25) !important;
    border-top: 1px solid rgba(16, 185, 129, 0.25) !important;
    border-radius: var(--radius-lg);
    padding: 20px !important;
    margin-top: 20px;
}

.esim-topup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.btn-topup-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
    color: #fff;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}
.btn-topup-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}
.btn-topup-cta:active {
    transform: translateY(0);
}

/* Top-Up Modal Overlay */
.topup-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.topup-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

@media (min-width: 768px) {
    .topup-modal-overlay {
        align-items: center;
    }
}

.topup-modal {
    background: var(--surface);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -8px 40px rgba(0,0,0,0.3);
}

@media (min-width: 768px) {
    .topup-modal {
        border-radius: var(--radius-xl);
        transform: translateY(30px) scale(0.95);
        max-height: 75vh;
    }
}

.topup-modal-overlay.show .topup-modal {
    transform: translateY(0) scale(1);
}

.topup-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.topup-modal-header h3 {
    margin: 0;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.topup-modal-header h3 i {
    color: var(--accent);
}

.topup-modal-subtitle {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 400;
}

.topup-modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--surface-hover);
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s;
}
.topup-modal-close:hover {
    background: var(--border);
    color: var(--text);
}

.topup-modal-body {
    padding: 16px 24px 24px;
    overflow-y: auto;
    flex: 1;
}

/* Loading state */
.topup-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 40px 0;
    color: var(--text-muted);
}

.loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Empty / Error state */
.topup-empty {
    text-align: center;
    padding: 40px 0;
    color: var(--text-muted);
}
.topup-empty i {
    font-size: 40px;
    margin-bottom: 12px;
    display: block;
}
.topup-error i {
    color: #EF4444;
}

/* Option list */
.topup-options-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.topup-option {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.25s ease;
}

.topup-option:hover {
    border-color: rgba(99, 102, 241, 0.5);
    background: rgba(99, 102, 241, 0.06);
    transform: translateX(2px);
}

.topup-option.selected {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    box-shadow: 0 0 0 1px var(--primary), 0 4px 12px rgba(99, 102, 241, 0.15);
}

.topup-option-data {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
}

.topup-data-amount {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.topup-data-duration {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.topup-option-info {
    flex: 1;
    min-width: 0;
}

.topup-option-name {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topup-option-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
    white-space: nowrap;
}

.topup-option-check {
    width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    color: var(--primary);
    transition: opacity 0.2s;
}

.topup-option.selected .topup-option-check {
    opacity: 1;
}

/* Confirm area */
.topup-confirm-area {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.topup-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--text);
}

.topup-summary-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent);
}

.btn-topup-confirm {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
    color: #fff;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}
.btn-topup-confirm:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}
.btn-topup-confirm:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Success state */
/* Error box inside modal */
.topup-error-box {
    padding: 12px 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: var(--radius-md);
    color: #f87171;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    animation: fadeIn 0.3s ease;
}
.topup-error-box i {
    margin-top: 2px;
    flex-shrink: 0;
}

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

.topup-success {
    text-align: center;
    padding: 30px 0;
}

.topup-success-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.05) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: var(--accent);
    animation: scaleIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scaleIn {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.topup-success h3 {
    margin: 0 0 8px;
    font-size: 20px;
    color: var(--text);
}

.topup-success p {
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
}

/* Mobile responsive for topup */
@media (max-width: 480px) {
    .esim-topup-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    .btn-topup-cta {
        justify-content: center;
    }
    .topup-modal-body {
        padding: 12px 16px 20px;
    }
    .topup-option {
        padding: 12px;
        gap: 12px;
    }
    .topup-data-amount {
        font-size: 16px;
    }
    .topup-option-price {
        font-size: 16px;
    }
}

/* ============================================
   Orders
   ============================================ */
.order-list {
    display: grid;
    gap: 12px;
}

.order-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.order-card:hover {
    border-color: var(--border-accent);
}

.order-flag {
    font-size: 28px;
}

.order-info {
    flex: 1;
    min-width: 0;
}

.order-title {
    font-weight: 600;
    margin-bottom: 2px;
}

.order-meta {
    font-size: 13px;
    color: var(--text-muted);
}

.order-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
}

.order-status {
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
}

.order-status.completed {
    background: rgba(74, 222, 128, 0.15);
    color: var(--secondary);
}

.order-status.pending {
    background: rgba(250, 204, 21, 0.15);
    color: var(--accent-yellow);
}

.order-status.failed {
    background: rgba(239, 68, 68, 0.15);
    color: #EF4444;
}

/* ============================================
   Profile Page
   ============================================ */
.profile-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 32px;
    max-width: 500px;
    margin: 0 auto;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--bg-primary);
    margin: 0 auto 20px;
}

/* ============================================
   Language Modal
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.95);
    transition: transform var(--transition-normal);
}

.modal-overlay.show .modal {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.lang-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    padding: 12px;
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 14px;
}

.lang-option:hover {
    background: rgba(255, 255, 255, 0.05);
}

.lang-option.active {
    background: rgba(0, 229, 255, 0.1);
    color: var(--primary);
}

.lang-option-flag {
    font-size: 20px;
}

/* ============================================
   Purchase Modal
   ============================================ */
.purchase-modal {
    max-width: 420px;
}

.purchase-summary {
    padding: 24px;
}

.purchase-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
}

.purchase-item-label {
    color: var(--text-muted);
}

.purchase-total {
    display: flex;
    justify-content: space-between;
    padding: 16px 0;
    margin-top: 12px;
    border-top: 1px solid var(--border);
    font-size: 20px;
    font-weight: 700;
}

.purchase-total-value {
    background: var(--gradient-card);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.purchase-actions {
    padding: 0 24px 24px;
    display: flex;
    gap: 12px;
}

.purchase-buttons {
    display: flex;
    gap: 12px;
}

.purchase-buttons .btn:first-child {
    flex: 1;
}

.purchase-buttons .btn:last-child {
    flex: 2;
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 48px;
    color: var(--text-muted);
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.empty-text {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 20px;
}

/* ============================================
   Loading
   ============================================ */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
}

.loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.08);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-elevated) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================
   Toast Notifications
   ============================================ */
.toast-container {
    position: fixed;
    top: 80px;
    right: 16px;
    z-index: 5000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

html[dir="rtl"] .toast-container {
    right: auto;
    left: 16px;
}

.toast {
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 280px;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    animation: slideInRight 0.3s ease;
    font-size: 14px;
}

html[dir="rtl"] .toast {
    animation: slideInLeft 0.3s ease;
}

.toast.success {
    border-left: 3px solid var(--secondary);
}

.toast.error {
    border-left: 3px solid #EF4444;
}

.toast.info {
    border-left: 3px solid var(--primary);
}

html[dir="rtl"] .toast.success {
    border-left: none;
    border-right: 3px solid var(--secondary);
}

html[dir="rtl"] .toast.error {
    border-left: none;
    border-right: 3px solid #EF4444;
}

html[dir="rtl"] .toast.info {
    border-left: none;
    border-right: 3px solid var(--primary);
}

.toast-icon {
    font-size: 16px;
}

.toast.success .toast-icon { color: var(--secondary); }
.toast.error .toast-icon { color: #EF4444; }
.toast.info .toast-icon { color: var(--primary); }

.toast-hide {
    animation: slideOutRight 0.3s ease forwards;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInLeft {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* ============================================
   Footer
   ============================================ */
.footer {
    border-top: 1px solid var(--border);
    padding: 40px 0;
    margin-top: 60px;
    text-align: center;
}

.footer-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.footer-logo img {
    width: 32px;
    height: 32px;
}

.footer-text {
    font-size: 13px;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 16px 0;
    flex-wrap: wrap;
}

.footer-links a {
    font-size: 13px;
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--primary);
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
    .menu-btn {
        display: flex;
    }

    .bottom-nav {
        display: flex;
    }

    .main-content {
        padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px));
    }

    .auth-buttons .btn:first-child {
        display: none;
    }

    .hero {
        padding: 40px 0 30px;
    }

    .hero h1 {
        font-size: 28px;
    }

    .hero-stats {
        gap: 24px;
    }

    .hero-stat-value {
        font-size: 22px;
    }

    .country-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
    }

    .country-card {
        padding: 12px 8px;
    }

    .country-flag {
        font-size: 28px;
    }

    .country-name {
        font-size: 11px;
    }

    .package-grid {
        grid-template-columns: 1fr;
    }

    .scroll-container .package-card {
        min-width: 260px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .esim-info-grid {
        grid-template-columns: 1fr;
    }

    .lang-grid {
        grid-template-columns: 1fr;
    }

    .section-title {
        font-size: 18px;
    }

    .dropdown-menu {
        right: 8px;
        left: 8px;
        min-width: auto;
    }

    html[dir="rtl"] .dropdown-menu {
        left: 8px;
        right: 8px;
    }

    .footer {
        margin-bottom: 0;
    }

    .order-card {
        flex-wrap: wrap;
    }

    .order-price {
        font-size: 16px;
    }
}

@media (min-width: 769px) {
    .bottom-nav {
        display: none !important;
    }
}

/* Safe areas for notched devices */
@supports (padding-top: env(safe-area-inset-top)) {
    .top-bar {
        padding-top: env(safe-area-inset-top);
        height: calc(var(--top-bar-height) + env(safe-area-inset-top));
    }

    .main-content {
        padding-top: calc(var(--top-bar-height) + env(safe-area-inset-top));
    }

    .countries-sticky-bar {
        top: calc(var(--top-bar-height) + env(safe-area-inset-top));
    }

    .countries-list-area {
        padding-top: calc(130px + env(safe-area-inset-top));
    }
}

/* ============================================
   PWA Install Banner
   ============================================ */
.pwa-install-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    transform: translateY(-100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    padding-top: env(safe-area-inset-top, 0px);
}

.pwa-install-banner.show {
    transform: translateY(0);
}

.pwa-banner-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.15), rgba(0, 140, 255, 0.15));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 212, 170, 0.3);
}

.pwa-banner-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pwa-banner-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pwa-banner-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pwa-banner-text strong {
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pwa-banner-text span {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.3;
}

.pwa-banner-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.pwa-install-btn {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    border: none;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.2s;
}

.pwa-install-btn:hover {
    opacity: 0.85;
}

.pwa-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s;
}

.pwa-close-btn:hover {
    color: var(--text-primary);
}

/* ============================================
   Utility Classes
   ============================================ */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.p-16 { padding: 16px; }
.p-24 { padding: 24px; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.hidden { display: none !important; }

/* Glass effect */
.glass {
    background: rgba(18, 18, 30, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-light);
}

/* Gradient border */
.gradient-border {
    position: relative;
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 1px;
    border-radius: inherit;
    background: var(--gradient-primary);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

/* Confirm Modal */
.confirm-modal {
    max-width: 380px;
}

.confirm-body {
    padding: 24px;
    text-align: center;
}

.confirm-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.confirm-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.confirm-text {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 24px;
}

.confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* Success animation */
.success-check {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(74, 222, 128, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 36px;
    color: var(--secondary);
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

/* Page transitions */
.page-enter {
    animation: fadeIn 0.3s ease forwards;
}

/* Back button */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 14px;
    padding: 8px 0;
    transition: color var(--transition-fast);
    margin-bottom: 16px;
}

.back-btn:hover {
    color: var(--primary);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
    overflow-x: auto;
}

.tab {
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
    white-space: nowrap;
    cursor: pointer;
}

.tab:hover {
    color: var(--text-secondary);
}

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

/* ==================== Wallet Styles ==================== */
.wallet-quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.wallet-action-card:hover {
    border-color: rgba(0,229,255,0.3) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.toggle-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--bg-input);
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: all 0.3s;
    flex-shrink: 0;
}
.toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: all 0.3s;
}
input[type="checkbox"]:checked + .toggle-slider {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-color: transparent;
}
input[type="checkbox"]:checked + .toggle-slider::after {
    left: 22px;
    background: #0d1117;
}
.wallet-toggle input[type="checkbox"] {
    display: none;
}

.topup-amounts-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.topup-amount-btn {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    color: var(--text-primary);
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.topup-amount-btn:hover {
    border-color: var(--primary) !important;
    background: rgba(0,229,255,0.1) !important;
}

.gateway-grid {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.gateway-option {
    flex: 1;
    cursor: pointer;
    padding: 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: all 0.2s;
    background: var(--bg-card);
    word-break: break-word;
}

.gateway-option.selected {
    border-color: var(--primary);
}

.gateway-option:hover {
    border-color: rgba(0,229,255,0.5);
}

/* ==================== Legal Pages ==================== */
.legal-page {
    padding-bottom: 60px;
}

.legal-hero {
    text-align: center;
    padding: 60px 20px 40px;
    position: relative;
    overflow: hidden;
}

.legal-hero::before {
    content: '';
    position: absolute;
    top: -60%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0,229,255,0.08) 0%, transparent 70%);
    pointer-events: none;
}

.legal-hero-icon {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(0,229,255,0.15), rgba(0,208,132,0.15));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 28px;
    color: var(--primary);
    border: 1px solid rgba(0,229,255,0.2);
    position: relative;
}

.legal-hero-title {
    font-size: 32px;
    font-weight: 900;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 12px;
}

.legal-hero-sub {
    font-size: 15px;
    color: var(--text-muted);
    max-width: 500px;
    margin: 0 auto 16px;
    line-height: 1.6;
}

.legal-updated {
    display: inline-block;
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-card);
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
}

.legal-body {
    max-width: 780px;
    margin: 0 auto;
    padding: 0 20px;
}

.legal-section {
    position: relative;
    padding: 28px 28px 28px 28px;
    margin-bottom: 16px;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.legal-section:hover {
    border-color: rgba(0,229,255,0.25);
    box-shadow: 0 0 30px rgba(0,229,255,0.04);
}

.legal-section-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(0,229,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    font-size: 14px;
    color: var(--primary);
}

.legal-section h2 {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.legal-section h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-secondary);
    margin: 16px 0 8px;
}

.legal-section p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 10px;
}

.legal-section ul {
    list-style: none;
    padding: 0;
    margin: 8px 0 12px;
}

.legal-section ul li {
    position: relative;
    padding-left: 20px;
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 6px;
}

.legal-section ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
}

.legal-section ul li strong {
    color: var(--text-secondary);
}

/* ==================== FAQ Page ==================== */
.faq-body {
    max-width: 780px;
    margin: 0 auto;
    padding: 0 20px;
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    margin-bottom: 10px;
    overflow: hidden;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.faq-item:hover {
    border-color: rgba(0,229,255,0.25);
}

.faq-item.open {
    border-color: rgba(0,229,255,0.35);
    box-shadow: 0 0 30px rgba(0,229,255,0.06);
}

.faq-question {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 22px;
    user-select: none;
}

.faq-q-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 10px;
    background: rgba(0,229,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--primary);
    transition: background 0.3s;
}

.faq-item.open .faq-q-icon {
    background: rgba(0,229,255,0.2);
}

.faq-q-text {
    flex: 1;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
}

.faq-toggle {
    font-size: 12px;
    color: var(--text-muted);
    transition: transform 0.3s ease;
}

.faq-item.open .faq-toggle {
    transform: rotate(180deg);
    color: var(--primary);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease;
    padding: 0 22px 0 72px;
}

.faq-item.open .faq-answer {
    max-height: 400px;
    padding: 0 22px 22px 72px;
}

.faq-answer p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.8;
}

@media (max-width: 600px) {
    .legal-hero-title { font-size: 24px; }
    .legal-section { padding: 20px; }
    .faq-question { padding: 14px 16px; gap: 10px; }
    .faq-answer { padding: 0 16px 0 60px; }
    .faq-item.open .faq-answer { padding: 0 16px 16px 60px; }
    .footer-links { flex-wrap: wrap; gap: 12px; }
}

/* ==================== Result Pages (Success/Failure) ==================== */
.result-card {
    max-width: 440px;
    width: 100%;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 48px 36px 36px;
    text-align: center;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.result-success::before {
    background: linear-gradient(90deg, #00E5FF, #00D084, #00E5FF);
    background-size: 200% 100%;
    animation: resultShimmer 2s ease infinite;
}

.result-fail::before {
    background: linear-gradient(90deg, #EF4444, #F97316, #EF4444);
    background-size: 200% 100%;
    animation: resultShimmer 2s ease infinite;
}

@keyframes resultShimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.result-icon-wrap {
    width: 88px;
    height: 88px;
    margin: 0 auto 24px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-icon-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    animation: resultRing 0.6s ease-out forwards;
    opacity: 0;
}

.result-icon-success .result-icon-ring {
    border: 3px solid rgba(0, 229, 255, 0.3);
    box-shadow: 0 0 30px rgba(0, 229, 255, 0.15), inset 0 0 20px rgba(0, 229, 255, 0.05);
}

.result-icon-fail .result-icon-ring {
    border: 3px solid rgba(239, 68, 68, 0.3);
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.15), inset 0 0 20px rgba(239, 68, 68, 0.05);
}

@keyframes resultRing {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.result-icon-check {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    animation: resultPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.2s forwards;
    transform: scale(0);
    z-index: 1;
}

.result-icon-success .result-icon-check {
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.15), rgba(0, 208, 132, 0.15));
    color: var(--primary);
    border: 1px solid rgba(0, 229, 255, 0.3);
}

.result-icon-fail .result-icon-check {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

@keyframes resultPop {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

.result-title {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 8px;
    animation: resultFadeUp 0.5s ease 0.4s forwards;
    opacity: 0;
    transform: translateY(10px);
}

.result-success .result-title {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.result-fail .result-title {
    color: #EF4444;
}

.result-text {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 28px;
    animation: resultFadeUp 0.5s ease 0.5s forwards;
    opacity: 0;
    transform: translateY(10px);
}

.result-actions {
    display: flex;
    gap: 12px;
    animation: resultFadeUp 0.5s ease 0.6s forwards;
    opacity: 0;
    transform: translateY(10px);
}

@keyframes resultFadeUp {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

.result-card .btn-ghost {
    animation: resultFadeUp 0.5s ease 0.7s forwards;
    opacity: 0;
    transform: translateY(10px);
}

@media (max-width: 480px) {
    .result-card { padding: 36px 24px 28px; margin: 0 16px; }
    .result-title { font-size: 20px; }
    .result-actions { flex-direction: column; }
    .result-actions .btn { width: 100%; }
}

/* ==================== SEO Content Section ==================== */
.seo-content-section {
    padding: 48px 0;
    margin-top: 40px;
    border-top: 1px solid var(--border);
}

.seo-heading {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 24px;
    text-align: center;
}

.seo-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.seo-block {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.seo-block h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.seo-block h3 i {
    color: var(--primary);
    font-size: 13px;
}

.seo-block p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.7;
}

.seo-destinations {
    text-align: center;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.seo-destinations h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.seo-destinations p {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.8;
}

@media (max-width: 600px) {
    .seo-grid { grid-template-columns: 1fr; }
}

/* ============================================
   RTL & Multi-language Comprehensive Fixes
   ============================================ */

/* --- General RTL text direction --- */
html[dir="rtl"] {
    text-align: right;
}

html[dir="rtl"] .text-center,
html[dir="rtl"] .auth-title,
html[dir="rtl"] .auth-subtitle,
html[dir="rtl"] .auth-logo,
html[dir="rtl"] .empty-state,
html[dir="rtl"] .legal-hero,
html[dir="rtl"] .result-card {
    text-align: center;
}

/* --- Top bar RTL --- */
html[dir="rtl"] .top-bar-left {
    flex-direction: row-reverse;
}

html[dir="rtl"] .top-bar-right {
    flex-direction: row-reverse;
}

html[dir="rtl"] .top-bar-inner {
    direction: rtl;
}

/* --- Back button RTL --- */
html[dir="rtl"] .back-btn {
    direction: rtl;
}

html[dir="rtl"] .back-btn i.fa-arrow-left {
    transform: scaleX(-1);
}

/* --- Hero RTL --- */
html[dir="rtl"] .hero-content {
    text-align: center;
}

html[dir="rtl"] .hero-actions {
    justify-content: center;
}

/* --- Country card & package card RTL --- */
html[dir="rtl"] .country-card {
    text-align: center;
}

/* --- Package detail items flex --- */
html[dir="rtl"] .package-detail {
    direction: rtl;
}

html[dir="rtl"] .package-footer {
    direction: rtl;
}

/* --- Purchase page RTL --- */
html[dir="rtl"] .purchase-item {
    direction: rtl;
}

html[dir="rtl"] .purchase-total {
    direction: rtl;
}

html[dir="rtl"] .wallet-balance-bar {
    direction: rtl;
}

html[dir="rtl"] .wallet-toggle {
    direction: rtl;
}

/* --- Toggle slider RTL --- */
html[dir="rtl"] .toggle-slider::after {
    left: auto;
    right: 2px;
}

html[dir="rtl"] input[type="checkbox"]:checked + .toggle-slider::after {
    left: auto;
    right: 22px;
}

/* --- Gateway options RTL --- */
html[dir="rtl"] .gateway-option {
    text-align: center;
}

/* --- eSIM card details RTL --- */
html[dir="rtl"] .esim-card {
    direction: rtl;
    text-align: right;
}

html[dir="rtl"] .esim-card-header {
    direction: rtl;
}

html[dir="rtl"] .esim-country {
    direction: rtl;
}

html[dir="rtl"] .esim-info-item {
    text-align: right;
}

html[dir="rtl"] .esim-activation-item {
    direction: rtl;
}

html[dir="rtl"] .esim-qr-section {
    text-align: center;
}

/* --- Side nav items RTL --- */
html[dir="rtl"] .side-nav-item {
    direction: rtl;
    flex-direction: row-reverse;
    text-align: right;
}

html[dir="rtl"] .side-nav-header {
    direction: rtl;
    flex-direction: row-reverse;
}

/* --- Bottom nav RTL --- */
html[dir="rtl"] .bottom-nav {
    direction: rtl;
}

/* --- Dashboard RTL --- */
html[dir="rtl"] .dashboard-header {
    text-align: right;
}

html[dir="rtl"] .stat-card {
    direction: rtl;
    text-align: right;
}

/* --- Orders RTL --- */
html[dir="rtl"] .order-card {
    direction: rtl;
}

html[dir="rtl"] .order-info {
    text-align: right;
}

/* --- Profile RTL --- */
html[dir="rtl"] .form-group {
    text-align: right;
}

/* --- Section headers RTL --- */
html[dir="rtl"] .section-header {
    direction: rtl;
}

html[dir="rtl"] .section-link i.fa-arrow-right {
    transform: scaleX(-1);
}

/* --- Wallet page RTL --- */
html[dir="rtl"] .wallet-action-card {
    direction: rtl;
    text-align: right;
}

/* --- Topup modal RTL --- */
html[dir="rtl"] .topup-modal-header {
    direction: rtl;
}

html[dir="rtl"] .topup-option {
    direction: rtl;
}

html[dir="rtl"] .topup-summary {
    direction: rtl;
}

/* --- Toast RTL fix (already has some) --- */

/* --- Region tabs RTL --- */
html[dir="rtl"] .region-tabs {
    direction: rtl;
}

/* --- Search bar RTL --- */
html[dir="rtl"] .search-bar {
    direction: rtl;
    padding: 6px 20px 6px 6px;
}

/* --- Legal pages RTL --- */
html[dir="rtl"] .legal-body,
html[dir="rtl"] .legal-section {
    text-align: right;
    direction: rtl;
}

/* --- FAQ accordion RTL --- */
html[dir="rtl"] .faq-question {
    direction: rtl;
    flex-direction: row-reverse;
}

html[dir="rtl"] .faq-answer {
    text-align: right;
    direction: rtl;
}

/* --- Footer RTL --- */
html[dir="rtl"] .footer {
    direction: rtl;
}

html[dir="rtl"] .footer-links {
    direction: rtl;
}

/* --- Result pages RTL --- */
html[dir="rtl"] .result-card {
    direction: rtl;
}

/* --- Countries sticky bar RTL --- */
html[dir="rtl"] .countries-sticky-bar {
    direction: rtl;
}

/* --- Fix flex gaps & inline styles that use explicit left/right margins --- */
html[dir="rtl"] [style*="margin-left"] {
    /* Generic fix: Let CSS logical properties handle it */
}

/* --- Ensure all buttons and links stay correct in RTL --- */
html[dir="rtl"] .btn {
    direction: rtl;
}

html[dir="rtl"] .btn i {
    margin-left: 6px;
    margin-right: 0;
}

html[dir="ltr"] .btn i {
    margin-right: 6px;
    margin-left: 0;
}

/* --- Generic: Flip inline margin-right on icons in RTL --- */
html[dir="rtl"] h3 > i[style*="margin-right"],
html[dir="rtl"] span > i[style*="margin-right"],
html[dir="rtl"] div > i[style*="margin-right"] {
    margin-right: 0 !important;
    margin-left: 8px !important;
}

/* --- Fix inline padding-left on input fields in RTL --- */
html[dir="rtl"] input[style*="padding-left"] {
    padding-left: 16px !important;
    padding-right: 32px !important;
}

/* --- Fix dollar sign in wallet topup input for RTL --- */
html[dir="rtl"] span[style*="position:absolute"][style*="left:14px"] {
    left: auto !important;
    right: 14px !important;
}

/* --- Fix wallet transaction amount alignment in RTL --- */
html[dir="rtl"] #walletTxnList > div {
    direction: rtl;
}

html[dir="rtl"] #walletTxnList > div > div[style*="text-align:right"] {
    text-align: left !important;
}

/* --- Fix purchase price strikethrough spacing in RTL --- */
html[dir="rtl"] .purchase-total-value[style*="margin-right"] {
    margin-right: 0 !important;
    margin-left: 8px !important;
}

/* --- Fix purchase breakdown rows in RTL --- */
html[dir="rtl"] #purchaseBreakdown > div {
    direction: rtl;
}

/* --- Fix the hero stats in RTL --- */
html[dir="rtl"] .hero-stats {
    direction: rtl;
}

/* --- Modal overlay / language modal RTL --- */
html[dir="rtl"] .modal-header {
    direction: rtl;
}

html[dir="rtl"] .modal-close {
    margin-left: 0;
    margin-right: auto;
}

/* --- Lang grid RTL --- */
html[dir="rtl"] .lang-option {
    direction: ltr;
}

/* --- Flexbox fix for items with explicit inline styles --- */
html[dir="rtl"] .esim-detail-section {
    direction: rtl;
}

html[dir="rtl"] .esim-topup-section {
    direction: rtl;
}

/* --- Prevent text overflow in RTL with long translations --- */
html[dir="rtl"] .package-name,
html[dir="rtl"] .package-country,
html[dir="rtl"] .esim-country-name {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Prevent layout break on long translation strings (all languages) --- */
.auth-card {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.purchase-item span,
.purchase-total span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 60%;
}

.purchase-item-label {
    flex-shrink: 0;
    max-width: 40%;
}

/* Ensure wallet balance bar doesn't break on mobile with long text */
.wallet-balance-bar {
    flex-wrap: wrap;
    gap: 10px;
}

/* Gateway options responsiveness for all languages */
.gateway-option {
    word-break: break-word;
}

/* Fix hero for long text languages */
.hero h1 {
    word-break: break-word;
    overflow-wrap: break-word;
}

.hero p {
    word-break: break-word;
    overflow-wrap: break-word;
}

/* ============================================
   Comprehensive Mobile Responsive Fixes
   ============================================ */
@media (max-width: 768px) {
    /* --- Buttons: allow wrapping on mobile --- */
    .btn {
        padding: 10px 16px;
        font-size: 13px;
        gap: 6px;
        min-height: 40px;
    }

    .btn-lg {
        padding: 12px 20px;
        font-size: 14px;
        min-height: 44px;
    }

    .btn-sm {
        padding: 7px 12px;
        font-size: 12px;
        min-height: 32px;
    }

    /* --- Search bar --- */
    .search-bar input {
        font-size: 14px;
    }

    .search-bar {
        padding: 4px 4px 4px 14px;
        gap: 8px;
    }

    html[dir="rtl"] .search-bar {
        padding: 4px 14px 4px 4px;
    }

    /* --- Hero section --- */
    .hero-actions {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }

    .hero-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .hero-stats {
        gap: 16px;
    }

    .hero-stat-label {
        font-size: 11px;
    }

    /* --- Purchase page --- */
    .purchase-item {
        flex-wrap: wrap;
        gap: 4px;
    }

    .purchase-item span {
        max-width: 100%;
        white-space: normal;
    }

    .purchase-item-label {
        max-width: 100%;
    }

    .purchase-total {
        flex-wrap: wrap;
        gap: 8px;
    }

    .purchase-total span {
        white-space: normal;
    }

    /* Purchase action buttons on mobile */
    .purchase-buttons {
        flex-direction: column;
    }

    .purchase-buttons .btn:first-child,
    .purchase-buttons .btn:last-child {
        flex: none;
        width: 100%;
    }

    .auth-card {
        padding: 28px 20px;
    }

    /* --- Dashboard quick actions --- */
    .dashboard-actions {
        flex-direction: column;
    }

    .dashboard-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    /* --- Gateway options on mobile --- */
    .gateway-option {
        padding: 10px !important;
        font-size: 12px;
        min-width: 0 !important;
    }

    .gateway-option i {
        font-size: 18px !important;
    }

    /* --- Wallet balance bar on mobile --- */
    .wallet-balance-bar {
        flex-direction: column !important;
        text-align: center !important;
        gap: 12px !important;
    }

    /* --- Wallet page top-up button --- */
    .wallet-hero .btn {
        min-width: auto !important;
        width: 100%;
    }

    /* --- Topup CTA on esim detail --- */
    .esim-topup-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .btn-topup-cta {
        justify-content: center;
        width: 100%;
    }

    /* --- Share buttons on esim detail --- */
    .esim-share-actions {
        flex-direction: column;
    }

    .btn-share {
        width: 100%;
        justify-content: center;
        padding: 10px 16px;
        font-size: 13px;
    }

    /* --- Footer links --- */
    .footer-links {
        flex-direction: column;
        gap: 10px;
    }

    /* --- RTL side nav --- */
    html[dir="rtl"] .side-nav-item {
        flex-direction: row-reverse;
    }

    /* --- Quick amount grid on wallet topup --- */
    .topup-amount-btn {
        padding: 10px;
        font-size: 14px;
    }

    .topup-amounts-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Extra small screens */
@media (max-width: 380px) {
    .btn {
        padding: 9px 12px;
        font-size: 12px;
        gap: 5px;
    }

    .btn-lg {
        padding: 10px 16px;
        font-size: 13px;
    }

    .hero h1 {
        font-size: 22px;
    }

    .hero p {
        font-size: 13px;
    }

    .hero-stat-value {
        font-size: 18px;
    }

    .hero-stat-label {
        font-size: 10px;
    }

    .auth-card {
        padding: 24px 16px;
    }

    .auth-title {
        font-size: 20px;
    }

    .dashboard-greeting {
        font-size: 22px;
    }

    /* Wallet topup quick amounts: 2 columns on very small screens */
    .topup-amounts-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Package card price area */
    .package-footer {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }

    .package-footer .btn {
        width: 100%;
        justify-content: center;
    }

    .package-price-area {
        text-align: center;
    }

    /* Result page */
    .result-card {
        padding: 28px 16px 24px !important;
        margin: 0 8px !important;
    }

    .result-icon-wrap {
        width: 60px !important;
        height: 60px !important;
    }

    .result-title {
        font-size: 18px !important;
    }
}


/* Fix countries sticky bar search bar padding in RTL */
html[dir="rtl"] .countries-sticky-bar .search-bar {
    padding: 6px 20px 6px 6px;
}

/* ============================================
   Support Chat
   ============================================ */
.chat-page { padding: 0 !important; margin: 0 !important; position: fixed; top: var(--top-bar-height); left: 0; right: 0; bottom: 0; display: flex; overflow: hidden; z-index: 50; background: var(--bg-main); }
.chat-container { display: flex; flex-direction: column; width: 100%; max-width: 700px; margin: 0 auto; height: 100%; background: var(--bg-card); border-left: 1px solid var(--border); border-right: 1px solid var(--border); overflow: hidden; }
.chat-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); background: rgba(0,229,255,0.03); flex-shrink: 0; }
.chat-header-left { display: flex; align-items: center; gap: 12px; }
.chat-header-avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), #00D4AA); display: flex; align-items: center; justify-content: center; color: #0d1117; font-size: 22px; line-height: 1; }
.chat-header-info h3 { font-size: 15px; font-weight: 700; margin: 0; }
.chat-header-info span { font-size: 11px; color: var(--text-muted); }
.chat-status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #4ADE80; margin-right: 4px; }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; scrollbar-width: thin; }
.chat-message { display: flex; gap: 8px; max-width: 85%; animation: chatFadeIn 0.3s ease; }
.chat-msg-user { align-self: flex-end; flex-direction: row-reverse; }
.chat-msg-agent { align-self: flex-start; }
.chat-avatar { width: 32px; height: 32px; min-width: 32px; border-radius: 50%; background: var(--bg-input); display: flex; align-items: center; justify-content: center; font-size: 13px; color: var(--text-muted); flex-shrink: 0; }
.chat-avatar-ai { background: linear-gradient(135deg, rgba(0,229,255,0.2), rgba(0,212,170,0.2)); color: var(--primary); }
.chat-avatar-admin { background: linear-gradient(135deg, rgba(168,85,247,0.2), rgba(236,72,153,0.2)); color: #A855F7; }
.agent-avatar-emoji { font-size: 20px; line-height: 1; background: linear-gradient(135deg, rgba(236,72,153,0.15), rgba(168,85,247,0.15)); border: 1px solid rgba(236,72,153,0.25); }
.chat-bubble-wrap { display: flex; flex-direction: column; }
.chat-sender { font-size: 11px; color: var(--text-muted); margin-bottom: 3px; padding: 0 8px; }
.chat-time { font-size: 10px; color: var(--text-muted); opacity: 0.7; }
.chat-bubble { padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.5; word-break: break-word; }
.chat-bubble-agent { background: var(--bg-input); border-bottom-left-radius: 4px; }
.chat-bubble-user { background: linear-gradient(135deg, rgba(0,229,255,0.15), rgba(0,212,170,0.1)); border: 1px solid rgba(0,229,255,0.2); border-bottom-right-radius: 4px; }
.chat-msg-image { max-width: 240px; max-height: 200px; border-radius: 10px; margin-bottom: 6px; cursor: pointer; display: block; }
.chat-text { white-space: pre-wrap; unicode-bidi: plaintext; text-align: start; }
.chat-input-area { border-top: 1px solid var(--border); padding: 10px 12px; flex-shrink: 0; background: var(--bg-main); }
.chat-input-row { display: flex; align-items: flex-end; gap: 8px; }
.chat-input { flex: 1; background: var(--bg-input); border: 1px solid var(--border); border-radius: 20px; padding: 10px 16px; font-size: 14px; color: var(--text-primary); outline: none; transition: border-color 0.2s; resize: none; overflow-y: auto; max-height: 120px; min-height: 38px; line-height: 1.4; font-family: inherit; }
.chat-input:focus { border-color: var(--primary); }
.chat-attach-btn { width: 38px; height: 38px; border-radius: 50%; background: var(--bg-input); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-muted); transition: all 0.2s; flex-shrink: 0; }
.chat-attach-btn:hover { background: rgba(0,229,255,0.1); color: var(--primary); border-color: var(--primary); }
.chat-send-btn { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), #00D4AA); border: none; color: #0d1117; font-size: 15px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; flex-shrink: 0; }
.chat-send-btn:hover { transform: scale(1.05); box-shadow: 0 0 12px rgba(0,229,255,0.4); }
.chat-send-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.chat-image-preview { display: flex; align-items: center; gap: 8px; padding: 8px 12px; margin-bottom: 8px; background: var(--bg-input); border-radius: var(--radius-md); border: 1px solid var(--border); }
.chat-image-preview img { max-width: 80px; max-height: 60px; border-radius: 6px; }
.chat-remove-img { width: 24px; height: 24px; border-radius: 50%; background: rgba(239,68,68,0.2); border: none; color: #EF4444; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 11px; }
.chat-closed-banner { text-align: center; padding: 24px; color: var(--text-muted); font-size: 14px; border-top: 1px solid var(--border); }
.chat-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; padding: 40px; }
.chat-loading { display: flex; align-items: center; justify-content: center; flex: 1; }

/* Typing animation */
.typing-dots { display: flex; gap: 4px; padding: 4px 0; }
.typing-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--text-muted); animation: typingBounce 1.4s infinite; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce { 0%, 80%, 100% { transform: translateY(0); opacity: 0.4; } 40% { transform: translateY(-6px); opacity: 1; } }
@keyframes chatFadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* eSIM support banner */
.esim-support-section { margin-top: 8px; }
.esim-support-banner { display: flex; align-items: center; gap: 16px; padding: 16px 20px; background: linear-gradient(135deg, rgba(0,229,255,0.08), rgba(168,85,247,0.06)); border: 1px solid rgba(0,229,255,0.2); border-radius: var(--radius-lg); }
.esim-support-icon { width: 44px; height: 44px; min-width: 44px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), #A855F7); display: flex; align-items: center; justify-content: center; color: #0d1117; font-size: 18px; }
.esim-support-text { flex: 1; }
.esim-support-text h4 { font-size: 14px; font-weight: 700; margin: 0 0 2px; }
.esim-support-text p { font-size: 12px; color: var(--text-muted); margin: 0; }

/* RTL */
html[dir="rtl"] .chat-msg-user { flex-direction: row-reverse; }
html[dir="rtl"] .chat-msg-agent { flex-direction: row; }
html[dir="rtl"] .chat-header-left { flex-direction: row-reverse; }
html[dir="rtl"] .chat-input-row { flex-direction: row-reverse; }
html[dir="rtl"] .chat-bubble-agent { border-bottom-left-radius: 16px; border-bottom-right-radius: 4px; }
html[dir="rtl"] .chat-bubble-user { border-bottom-right-radius: 16px; border-bottom-left-radius: 4px; }
html[dir="rtl"] .esim-support-banner { flex-direction: row-reverse; text-align: right; }

@media (max-width: 768px) {
    .chat-page { bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px)); }
    .chat-container { border-left: none; border-right: none; max-width: 100%; }
    .chat-message { max-width: 92%; }
    .chat-header { padding: 10px 12px; }
    .chat-input-area { padding: 8px 10px; }
    .chat-input { padding: 8px 14px; font-size: 16px; }
    .esim-support-banner { flex-direction: column; text-align: center; gap: 10px; }
    html[dir="rtl"] .esim-support-banner { flex-direction: column; }
}
