/* ============================================================
   COMPONENTS.CSS — Reusable UI Components
   Easy eSIM Platform | Powered by Airalo + DESC Token
   ============================================================ */

/* ── Navbar ── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 0 24px;
  height: 70px;
  display: flex;
  align-items: center;
  transition: all 0.3s ease;
  background: transparent;
}

.navbar.scrolled {
  background: rgba(7, 11, 20, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* Brand */
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-logo {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #00d4ff, #6366f1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.02em;
  box-shadow: 0 4px 14px rgba(0,212,255,0.35);
}

.brand-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}

.brand-name span { color: #00d4ff; }

.desc-nav-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(99,102,241,0.15);
  border: 1px solid rgba(99,102,241,0.3);
  color: #818cf8;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

/* Nav Links */
.navbar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.navbar-nav a {
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.navbar-nav a:hover,
.navbar-nav a.active {
  color: #fff;
  background: rgba(255,255,255,0.06);
}

/* Nav Actions */
.navbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-nav-login {
  padding: 8px 18px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.75);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-nav-login:hover {
  border-color: rgba(255,255,255,0.35);
  color: #fff;
  background: rgba(255,255,255,0.05);
}

.btn-nav-start {
  padding: 8px 20px;
  border-radius: 8px;
  background: linear-gradient(135deg, #00d4ff, #6366f1);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.25s ease;
  box-shadow: 0 4px 14px rgba(0,212,255,0.3);
}

.btn-nav-start:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0,212,255,0.45);
}

/* Mobile Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: rgba(255,255,255,0.7);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ── Buttons (General) ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #00d4ff, #6366f1);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0,212,255,0.3);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0,212,255,0.45);
}

.btn-secondary {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.12);
}
.btn-secondary:hover {
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.2);
  color: #fff;
}

.btn-success {
  background: rgba(16,185,129,0.15);
  color: #10b981;
  border: 1px solid rgba(16,185,129,0.3);
}
.btn-success:hover { background: #10b981; color: #fff; }

.btn-danger {
  background: rgba(239,68,68,0.15);
  color: #ef4444;
  border: 1px solid rgba(239,68,68,0.3);
}
.btn-danger:hover { background: #ef4444; color: #fff; }

.btn-outline {
  background: transparent;
  border: 1px solid rgba(0,212,255,0.4);
  color: #00d4ff;
}
.btn-outline:hover { background: rgba(0,212,255,0.1); }

.btn-sm  { padding: 6px 14px; font-size: 0.78rem; border-radius: 7px; }
.btn-lg  { padding: 14px 32px; font-size: 1rem; border-radius: 14px; }
.btn-xl  { padding: 16px 40px; font-size: 1.05rem; border-radius: 16px; }
.btn-full { width: 100%; }

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

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
}

.badge-primary   { background: rgba(0,212,255,0.15);  color: #00d4ff;  border: 1px solid rgba(0,212,255,0.25); }
.badge-success   { background: rgba(16,185,129,0.15); color: #10b981;  border: 1px solid rgba(16,185,129,0.25); }
.badge-warning   { background: rgba(251,191,36,0.15); color: #fbbf24;  border: 1px solid rgba(251,191,36,0.25); }
.badge-danger    { background: rgba(239,68,68,0.15);  color: #ef4444;  border: 1px solid rgba(239,68,68,0.25); }
.badge-purple    { background: rgba(99,102,241,0.15); color: #818cf8;  border: 1px solid rgba(99,102,241,0.25); }
.badge-inactive  { background: rgba(255,255,255,0.06);color: rgba(255,255,255,0.4); border: 1px solid rgba(255,255,255,0.1); }

/* ── Cards ── */
.card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 24px;
}

.card-hover {
  transition: all 0.3s ease;
}
.card-hover:hover {
  border-color: rgba(0,212,255,0.2);
  box-shadow: 0 12px 30px rgba(0,0,0,0.3);
  transform: translateY(-3px);
}

/* ── Forms ── */
.form-group { margin-bottom: 20px; }

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

.form-control {
  width: 100%;
  padding: 11px 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: #fff;
  font-size: 0.9rem;
  font-family: inherit;
  transition: all 0.2s ease;
  outline: none;
  box-sizing: border-box;
}

.form-control::placeholder { color: rgba(255,255,255,0.25); }

.form-control:focus {
  border-color: rgba(0,212,255,0.4);
  background: rgba(255,255,255,0.07);
  box-shadow: 0 0 0 3px rgba(0,212,255,0.08);
}

.form-control:invalid:not(:placeholder-shown) {
  border-color: rgba(239,68,68,0.5);
}

.form-hint {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.35);
  margin-top: 6px;
}

.form-error {
  font-size: 0.75rem;
  color: #ef4444;
  margin-top: 6px;
  display: none;
}

.form-error.show { display: block; }

/* Select */
select.form-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='rgba(255,255,255,0.4)' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* Checkbox & Radio */
.form-check {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.form-check-input {
  width: 18px;
  height: 18px;
  accent-color: #6366f1;
  cursor: pointer;
}

.form-check-label {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.65);
  cursor: pointer;
}

/* ── Tables ── */
.table-wrapper {
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.07);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.table th {
  padding: 13px 16px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  white-space: nowrap;
}

.table td {
  padding: 13px 16px;
  color: rgba(255,255,255,0.8);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
}

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

.table tbody tr:hover td { background: rgba(255,255,255,0.025); }

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

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

.modal {
  background: #0d1627;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 24px;
  padding: 32px;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: scale(0.92) translateY(20px);
  transition: transform 0.3s ease;
}

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

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

.modal-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
}

.modal-subtitle {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.45);
  margin-top: 4px;
}

.modal-close {
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(255,255,255,0.5);
  font-size: 0.85rem;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.modal-close:hover { background: rgba(239,68,68,0.15); color: #ef4444; border-color: rgba(239,68,68,0.3); }

.modal-body { margin-bottom: 24px; }

.modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* ── Purchase Modal Specific ── */
.purchase-plan-info {
  background: rgba(255,255,255,0.04);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.purchase-plan-left { display: flex; align-items: center; gap: 12px; }
.purchase-plan-flag { font-size: 1.8rem; }
.purchase-plan-name { font-weight: 700; color: #fff; font-size: 0.95rem; }
.purchase-plan-meta { font-size: 0.75rem; color: rgba(255,255,255,0.4); }
.purchase-plan-price { font-size: 1.3rem; font-weight: 900; color: #fff; }

.payment-method-select {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.payment-method-btn {
  padding: 12px;
  background: rgba(255,255,255,0.04);
  border: 2px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
}

.payment-method-btn:hover { border-color: rgba(0,212,255,0.3); }

.payment-method-btn.selected {
  border-color: #6366f1;
  background: rgba(99,102,241,0.1);
}

.payment-method-icon { font-size: 1.3rem; margin-bottom: 6px; }
.payment-method-name { font-size: 0.75rem; font-weight: 600; color: rgba(255,255,255,0.7); }

.desc-payment-box {
  background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(0,212,255,0.06));
  border: 1px solid rgba(99,102,241,0.25);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 20px;
}

.desc-payment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.6);
  margin-bottom: 8px;
}

.desc-payment-row:last-child { margin-bottom: 0; color: #fff; font-weight: 700; }
.desc-payment-row .value     { color: #6366f1; font-weight: 600; }

/* ── Toast ── */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
}

.toast {
  background: #0d1627;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 14px 18px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
  transform: translateX(110%);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
}

.toast.show { transform: translateX(0); }

.toast-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.toast.success .toast-icon { background: rgba(16,185,129,0.15); color: #10b981; }
.toast.error   .toast-icon { background: rgba(239,68,68,0.15);  color: #ef4444; }
.toast.warning .toast-icon { background: rgba(251,191,36,0.15); color: #fbbf24; }
.toast.info    .toast-icon { background: rgba(0,212,255,0.15);  color: #00d4ff; }

.toast.success { border-left: 3px solid #10b981; }
.toast.error   { border-left: 3px solid #ef4444; }
.toast.warning { border-left: 3px solid #fbbf24; }
.toast.info    { border-left: 3px solid #00d4ff; }

.toast-title { font-size: 0.85rem; font-weight: 700; color: #fff; }
.toast-msg   { font-size: 0.78rem; color: rgba(255,255,255,0.5); margin-top: 2px; }

.toast-progress {
  position: absolute;
  bottom: 0; left: 0;
  height: 3px;
  background: currentColor;
  border-radius: 0 0 14px 14px;
  transition: width linear;
}

/* ── Progress Bar ── */
.progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 10px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 10px;
  background: linear-gradient(90deg, #00d4ff, #6366f1);
  transition: width 0.4s ease;
}

/* ── Loading Spinner ── */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: #00d4ff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

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

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: rgba(255,255,255,0.4);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty-state-title {
  font-size: 1rem;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  margin-bottom: 8px;
}

.empty-state-text {
  font-size: 0.82rem;
  margin-bottom: 24px;
  line-height: 1.6;
}

/* ── Divider ── */
.divider {
  height: 1px;
  background: rgba(255,255,255,0.06);
  margin: 24px 0;
}

.divider-text {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255,255,255,0.3);
  font-size: 0.78rem;
  margin: 20px 0;
}

.divider-text::before,
.divider-text::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.07);
}

/* ── Alert ── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 0.85rem;
  margin-bottom: 16px;
}

.alert i { font-size: 0.9rem; flex-shrink: 0; margin-top: 1px; }

.alert-info    { background: rgba(0,212,255,0.08);  color: rgba(255,255,255,0.75); border: 1px solid rgba(0,212,255,0.2); }
.alert-success { background: rgba(16,185,129,0.08); color: rgba(255,255,255,0.75); border: 1px solid rgba(16,185,129,0.2); }
.alert-warning { background: rgba(251,191,36,0.08); color: rgba(255,255,255,0.75); border: 1px solid rgba(251,191,36,0.2); }
.alert-danger  { background: rgba(239,68,68,0.08);  color: rgba(255,255,255,0.75); border: 1px solid rgba(239,68,68,0.2); }

.alert-info    i { color: #00d4ff; }
.alert-success i { color: #10b981; }
.alert-warning i { color: #fbbf24; }
.alert-danger  i { color: #ef4444; }

/* ── Tooltip ── */
[data-tooltip] {
  position: relative;
  cursor: help;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 22, 39, 0.98);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.85);
  font-size: 0.72rem;
  padding: 6px 10px;
  border-radius: 8px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
  bottom: calc(100% + 12px);
}

/* ── Avatar ── */
.avatar {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.avatar-sm  { width: 32px; height: 32px; font-size: 0.8rem; }
.avatar-md  { width: 40px; height: 40px; font-size: 0.95rem; }
.avatar-lg  { width: 56px; height: 56px; font-size: 1.2rem; }
.avatar-xl  { width: 72px; height: 72px; font-size: 1.5rem; }

.avatar-gradient { background: linear-gradient(135deg, #6366f1, #00d4ff); }
.avatar-green    { background: linear-gradient(135deg, #10b981, #059669); }
.avatar-blue     { background: linear-gradient(135deg, #00d4ff, #0ea5e9); }

/* ── Copy Field ── */
.copy-field {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 10px;
  overflow: hidden;
}

.copy-field-value {
  flex: 1;
  padding: 10px 14px;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.65);
  font-family: 'Courier New', monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-field-btn {
  padding: 10px 14px;
  background: rgba(0,212,255,0.1);
  color: #00d4ff;
  border: none;
  border-left: 1px solid rgba(255,255,255,0.08);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.copy-field-btn:hover { background: rgba(0,212,255,0.2); }
.copy-field-btn.copied { background: rgba(16,185,129,0.15); color: #10b981; }

/* ── Tabs ── */
.tabs {
  display: flex;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  gap: 2px;
  margin-bottom: 28px;
}

.tab-btn {
  padding: 10px 18px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: rgba(255,255,255,0.45);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  margin-bottom: -1px;
}

.tab-btn:hover { color: rgba(255,255,255,0.75); }

.tab-btn.active {
  color: #00d4ff;
  border-bottom-color: #00d4ff;
  font-weight: 600;
}

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

/* ── QR Code Display ── */
.qr-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 24px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
}

.qr-code {
  width: 160px;
  height: 160px;
  background: #fff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.qr-code img { width: 100%; height: 100%; object-fit: contain; }

.qr-iccid {
  font-size: 0.75rem;
  font-family: 'Courier New', monospace;
  color: rgba(255,255,255,0.4);
  text-align: center;
}
