/* Global eSIM - Modern Design System */
/* Font imports */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600;9..40,700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
    /* Colors */
    --primary: #3b5bfe;
    --primary-dark: #2a45d6;
    --primary-light: #5b7aff;
    --secondary: #0ea5e9;
    --accent: #06b6d4;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    /* Neutrals */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    
    /* Typography */
    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'DM Sans', sans-serif;
    
    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    --shadow-glow: 0 0 40px rgba(59, 91, 254, 0.15);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--gray-700);
    background: var(--gray-50);
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--gray-900);
    line-height: 1.2;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

/* Container */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.container-sm {
    max-width: 640px;
}

.container-md {
    max-width: 896px;
}

/* Navigation */
.nav {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    background: rgba(255,255,255,0.95);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--gray-900);
}

.nav-brand img {
    height: 40px;
    width: auto;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.nav-link {
    font-weight: 500;
    color: var(--gray-600);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.nav-link:hover {
    color: var(--primary);
    background: var(--gray-100);
}

.nav-balance {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--gray-100);
    border-radius: var(--radius-full);
    font-weight: 600;
    color: var(--gray-800);
}

.nav-balance svg {
    color: var(--success);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 0.75rem 1.5rem;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.938rem;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(59, 91, 254, 0.35);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 91, 254, 0.4);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--gray-200);
}

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

.btn-outline:hover:not(:disabled) {
    background: var(--primary);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #059669;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

/* Cards */
.card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: all var(--transition-normal);
}

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

.card-body {
    padding: var(--space-xl);
}

.card-header {
    padding: var(--space-lg) var(--space-xl);
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.card-footer {
    padding: var(--space-lg) var(--space-xl);
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

/* Hero Section */
.hero {
    position: relative;
    background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.hero-content {
    position: relative;
    padding: var(--space-3xl) 0;
    text-align: center;
    color: white;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: blue;
    margin-bottom: var(--space-md);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto var(--space-xl);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

/* Search/Filter Box */
.search-box {
    max-width: 500px;
    margin: 0 auto;
    position: relative;
}

.search-box select,
.search-box input {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    border: none;
    border-radius: var(--radius-lg);
    background: white;
    box-shadow: var(--shadow-xl);
    appearance: none;
    cursor: pointer;
}

.search-box select:focus,
.search-box input:focus {
    outline: none;
    box-shadow: var(--shadow-xl), 0 0 0 3px rgba(59, 91, 254, 0.2);
}

.search-box::after {
    content: '';
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid var(--gray-400);
    pointer-events: none;
}

/* Plan Cards */
.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-xl);
    padding: var(--space-3xl) 0;
}

.plan-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: all var(--transition-normal);
    position: relative;
}

.plan-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.plan-card-popular {
    border: 2px solid var(--primary);
}

.plan-card-popular::before {
    content: 'Popular';
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    background: var(--primary);
    color: white;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.plan-header {
    padding: var(--space-xl);
    background: linear-gradient(135deg, var(--gray-50) 0%, white 100%);
    border-bottom: 1px solid var(--gray-200);
}

.plan-name {
    font-size: 1.25rem;
    margin-bottom: var(--space-xs);
}

.plan-location {
    color: var(--gray-500);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.plan-body {
    padding: var(--space-xl);
}

.plan-price {
    display: flex;
    align-items: baseline;
    gap: var(--space-xs);
    margin-bottom: var(--space-lg);
}

.plan-price-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
}

.plan-price-period {
    color: var(--gray-500);
}

.plan-features {
    list-style: none;
    margin-bottom: var(--space-xl);
}

.plan-features li {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) 0;
    color: var(--gray-600);
}

.plan-features li svg {
    color: var(--success);
    flex-shrink: 0;
}

/* eSIM Page Styles */
.esim-page {
    background: var(--gray-50);
    min-height: 100vh;
}

.esim-container {
    max-width: 480px;
    margin: 0 auto;
    padding: var(--space-xl);
}

.esim-card {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.esim-header {
    background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
    padding: var(--space-xl);
    text-align: center;
    color: white;
}

.esim-header-logo {
    margin-bottom: var(--space-md);
}

.esim-header-logo img {
    height: 60px;
    filter: brightness(0) invert(1);
}

.esim-header-title {
    font-size: 1.25rem;
    color: white;
    margin-bottom: var(--space-xs);
}

.esim-header-subtitle {
    opacity: 0.9;
    font-size: 0.875rem;
}

.esim-tabs {
    display: flex;
    border-bottom: 1px solid var(--gray-200);
}

.esim-tab {
    flex: 1;
    padding: var(--space-md);
    text-align: center;
    font-weight: 500;
    color: var(--gray-500);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
}

.esim-tab:hover {
    color: var(--primary);
}

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

.esim-content {
    padding: var(--space-xl);
}

.esim-qr {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.esim-qr img {
    width: 200px;
    height: 200px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: var(--space-sm);
}

.esim-qr-label {
    margin-top: var(--space-sm);
    color: var(--gray-500);
    font-size: 0.875rem;
}

.esim-plan-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    background: var(--gray-100);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
    width: 100%;
}

.esim-plan-badge-icon {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.esim-plan-badge-info h4 {
    font-size: 1rem;
    margin-bottom: 2px;
}

.esim-plan-badge-info span {
    color: var(--gray-500);
    font-size: 0.875rem;
}

.esim-details {
    background: var(--gray-50);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
}

.esim-detail-row {
    display: flex;
    justify-content: space-between;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--gray-200);
}

.esim-detail-row:last-child {
    border-bottom: none;
}

.esim-detail-label {
    color: var(--gray-500);
    font-size: 0.875rem;
}

.esim-detail-value {
    font-weight: 500;
    color: var(--gray-800);
    font-size: 0.875rem;
}

.esim-network {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: var(--space-lg);
    padding: var(--space-md);
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
}

.esim-network-info {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.esim-network-flag {
    width: 32px;
    height: 24px;
    border-radius: 4px;
    object-fit: cover;
}

.esim-network-name {
    font-weight: 500;
}

.esim-network-badge {
    background: var(--gray-100);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-600);
}

.esim-footer {
    padding: var(--space-xl);
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
}

/* Dashboard Styles */
.dashboard {
    padding: var(--space-xl) 0;
}

.dashboard-header {
    margin-bottom: var(--space-xl);
}

.dashboard-title {
    font-size: 1.75rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-2xl);
}

.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}

.stat-card-label {
    color: var(--gray-500);
    font-size: 0.875rem;
    margin-bottom: var(--space-xs);
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
}

.stat-card-trend {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    margin-top: var(--space-sm);
    font-size: 0.875rem;
    color: var(--success);
}

/* Tables */
.table-container {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.table-header {
    padding: var(--space-lg) var(--space-xl);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.table-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    text-align: left;
    padding: var(--space-md) var(--space-lg);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.table td {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}

.table tbody tr:hover {
    background: var(--gray-50);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.badge-info {
    background: rgba(59, 91, 254, 0.1);
    color: var(--primary);
}

/* Forms */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    margin-bottom: var(--space-sm);
    font-weight: 500;
    color: var(--gray-700);
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 91, 254, 0.1);
}

.form-input::placeholder {
    color: var(--gray-400);
}

/* Alerts */
.alert {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #065f46;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: #92400e;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #991b1b;
}

.alert-info {
    background: rgba(59, 91, 254, 0.1);
    border: 1px solid rgba(59, 91, 254, 0.2);
    color: #1e40af;
}

/* Spinner */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.spinner-lg {
    width: 48px;
    height: 48px;
    border-width: 4px;
}

/* Features Section */
.features {
    padding: var(--space-3xl) 0;
    background: white;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-2xl);
}

.feature-card {
    text-align: center;
    padding: var(--space-xl);
}

.feature-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-lg);
    color: white;
}

.feature-title {
    font-size: 1.25rem;
    margin-bottom: var(--space-sm);
}

.feature-description {
    color: var(--gray-500);
}

/* Footer */
.footer {
    background: var(--gray-900);
    color: var(--gray-400);
    padding: var(--space-3xl) 0;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-lg);
}

.footer-brand {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.footer-links {
    display: flex;
    gap: var(--space-lg);
}

.footer-links a {
    color: var(--gray-400);
}

.footer-links a:hover {
    color: white;
}

/* Utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.mb-2xl { margin-bottom: var(--space-2xl); }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

.hidden { display: none; }

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        gap: var(--space-md);
    }
    
    .hero-content {
        padding: var(--space-2xl) 0;
    }
    
    .plans-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 var(--space-md);
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-inner {
        height: 60px;
    }
    
    .nav-brand {
        font-size: 1.25rem;
    }
}

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

.animate-in {
    animation: fadeIn 0.4s ease-out forwards;
}

.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }

/* Loading States */
.loading {
    pointer-events: none;
    opacity: 0.7;
}

.skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: skeleton 1.5s infinite;
    border-radius: var(--radius-sm);
}

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