:root {
  --bg-primary: #07090e;
  --bg-card: #0f172a;
  --bg-card-hover: #1e293b;
  --border-color: #1e293b;
  --border-glow: rgba(99, 102, 241, 0.4);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --primary-accent: #6366f1;
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #3b82f6 50%, #06b6d4 100%);
  --accent-glow: 0 0 25px rgba(99, 102, 241, 0.35);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Fira Code', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image: 
    radial-gradient(circle at 50% -10%, rgba(99, 102, 241, 0.22) 0%, transparent 55%),
    radial-gradient(circle at 90% 90%, rgba(6, 182, 212, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 10% 80%, rgba(59, 130, 246, 0.15) 0%, transparent 50%);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* Navbar Header */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo-icon {
  width: 38px;
  height: 38px;
  background: var(--primary-gradient);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: var(--accent-glow);
}

.brand-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Main Container */
.container {
  max-width: 860px;
  margin: 32px auto;
  padding: 0 16px;
  width: 100%;
  flex: 1;
}

/* Central Card UI */
.lookup-card {
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), var(--accent-glow);
  text-align: center;
  position: relative;
}

.icon-wrapper {
  width: 68px;
  height: 68px;
  background: rgba(99, 102, 241, 0.12);
  border: 2px solid rgba(99, 102, 241, 0.35);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  color: #818cf8;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

.icon-wrapper svg {
  width: 34px;
  height: 34px;
}

.card-title {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

/* Search Type Badges Grid */
.card-badges {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.badge-tag {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.badge-tag:hover, .badge-tag:active {
  background: rgba(99, 102, 241, 0.25);
  border-color: #6366f1;
  color: #ffffff;
  transform: translateY(-1px);
}

/* Form Styles */
.form-group {
  max-width: 500px;
  margin: 0 auto 24px;
  text-align: left;
}

.input-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #818cf8;
  margin-bottom: 10px;
}

.input-container {
  position: relative;
  display: flex;
  align-items: center;
}

.phone-input {
  width: 100%;
  padding: 16px 20px;
  background: rgba(7, 9, 14, 0.85);
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  color: #ffffff;
  font-size: 1.15rem;
  font-family: inherit;
  letter-spacing: 1px;
  transition: all 0.25s ease;
  min-height: 56px;
}

.phone-input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.25);
  background: rgba(7, 9, 14, 0.95);
}

.phone-input::placeholder {
  color: #64748b;
  font-size: 0.95rem;
  letter-spacing: 0;
}

.submit-btn {
  width: 100%;
  max-width: 500px;
  padding: 16px 24px;
  min-height: 56px;
  background: var(--primary-gradient);
  border: none;
  border-radius: var(--radius-md);
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.25s ease;
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(99, 102, 241, 0.6);
}

.submit-btn:active {
  transform: scale(0.98);
}

.submit-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

/* Spinner */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Search History Drawer */
.history-section {
  margin-top: 36px;
}

.history-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.history-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
}

.chip:hover, .chip:active {
  background: rgba(99, 102, 241, 0.25);
  border-color: #6366f1;
  transform: translateY(-1px);
}

/* Results Display Container */
.results-container {
  margin-top: 32px;
  display: none;
  animation: fadeIn 0.3s ease;
}

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

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

.results-title {
  font-size: 1.2rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
}

.badge-portal {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(99, 102, 241, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-main);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  min-height: 44px;
}

.btn-secondary:hover, .btn-secondary:active {
  background: rgba(99, 102, 241, 0.3);
  border-color: #6366f1;
}

/* Raw JSON Code Box for Mobile & PC */
.json-box {
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 20px;
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: #34d399;
  overflow-x: auto;
  max-height: 520px;
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.5);
  line-height: 1.5;
  -webkit-overflow-scrolling: touch;
}

.json-box pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Footer */
.footer {
  text-align: center;
  padding: 24px 16px;
  color: var(--text-muted);
  font-size: 0.82rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: auto;
}

/* ====================================================
   MOBILE & TABLET RESPONSIVE OPTIMIZATION
   ==================================================== */

@media (max-width: 640px) {
  .navbar {
    padding: 14px 16px;
  }

  .brand-title {
    font-size: 1.2rem;
  }

  .container {
    margin: 16px auto;
    padding: 0 12px;
  }

  .lookup-card {
    padding: 26px 16px;
    border-radius: 16px;
  }

  .card-title {
    font-size: 1.45rem;
  }

  .icon-wrapper {
    width: 58px;
    height: 58px;
    margin-bottom: 16px;
  }

  .icon-wrapper svg {
    width: 28px;
    height: 28px;
  }

  .badge-tag {
    font-size: 0.78rem;
    padding: 6px 12px;
  }

  .phone-input {
    font-size: 1rem;
    padding: 14px 16px;
    min-height: 52px;
  }

  .submit-btn {
    font-size: 1.02rem;
    min-height: 52px;
    border-radius: 12px;
  }

  .results-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .btn-secondary {
    padding: 8px 14px;
    font-size: 0.82rem;
    min-height: 40px;
  }

  .json-box {
    padding: 14px;
    font-size: 0.82rem;
    max-height: 420px;
  }
}
