/* ==========================================
   CSS GLOBAL SETTINGS & CUSTOM VARIABLES
   ========================================== */
:root {
  --font-title: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* HSL Color Palette */
  --bg-color: hsl(222, 24%, 6%);
  --text-primary: hsl(210, 38%, 95%);
  --text-secondary: hsl(215, 20%, 65%);
  
  --accent-cyan: hsl(184, 100%, 50%);
  --accent-cyan-glow: hsla(184, 100%, 50%, 0.35);
  
  --accent-purple: hsl(265, 89%, 66%);
  --accent-purple-glow: hsla(265, 89%, 66%, 0.3);
  
  --success-color: hsl(145, 80%, 45%);
  --warning-color: hsl(45, 90%, 55%);
  --error-color: hsl(355, 85%, 55%);
  
  --glass-bg: rgba(255, 255, 255, 0.035);
  --glass-border: rgba(255, 255, 255, 0.075);
  --glass-border-focus: rgba(255, 255, 255, 0.15);
  --glass-shadow: 0 16px 48px 0 rgba(0, 0, 0, 0.45);
  
  --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-color);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  overflow-x: hidden;
  position: relative;
}

/* ==========================================
   BACKGROUND MESH DECORATION
   ========================================== */
.mesh-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.45;
  mix-blend-mode: screen;
}

.mesh-glow-1 {
  width: 45vw;
  height: 45vw;
  background: radial-gradient(circle, var(--accent-cyan) 0%, transparent 70%);
  top: -15%;
  left: -10%;
  animation: floatGlow 15s infinite alternate ease-in-out;
}

.mesh-glow-2 {
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, var(--accent-purple) 0%, transparent 70%);
  bottom: -15%;
  right: -10%;
  animation: floatGlow 18s infinite alternate-reverse ease-in-out;
}

@keyframes floatGlow {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(5%, 4%) scale(1.1); }
  100% { transform: translate(-3%, -5%) scale(0.95); }
}

/* ==========================================
   LAYOUT CONTAINERS
   ========================================== */
.container {
  width: 100%;
  max-width: 680px;
  padding: 40px 20px;
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: 25px;
}

/* Glassmorphism General Design */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: 20px;
  transition: var(--transition-smooth);
}

/* ==========================================
   APP HEADER
   ========================================== */
.app-header {
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 15px;
}

.logo-title {
  font-family: var(--font-title);
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-primary);
}

.logo-icon {
  font-size: 2.5rem;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-title span {
  color: var(--accent-cyan);
  text-shadow: 0 0 20px var(--accent-cyan-glow);
}

.logo-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-top: 5px;
}

.author-tag {
  display: flex;
  gap: 16px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
  padding: 6px 16px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

/* ==========================================
   MAIN CONTAINER CARD
   ========================================== */
.main-card {
  padding: 32px;
  min-height: 250px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.section-container {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

/* Info Tips Box */
.info-tip {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: hsla(45, 90%, 55%, 0.06);
  border-radius: 12px;
  border: 1px solid hsla(45, 90%, 55%, 0.15);
  font-size: 0.88rem;
  line-height: 1.5;
  color: hsl(45, 80%, 85%);
}

.tip-icon {
  color: var(--warning-color);
  font-size: 1.3rem;
  flex-shrink: 0;
  margin-top: 1px;
}

/* IMEI Input Form Group */
.imei-form-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.input-icon {
  position: absolute;
  left: 18px;
  color: var(--text-secondary);
  font-size: 1.5rem;
  pointer-events: none;
  transition: var(--transition-smooth);
}

.input-container input {
  width: 100%;
  padding: 18px 20px 18px 52px;
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  outline: none;
  transition: var(--transition-smooth);
}

.input-container input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 16px var(--accent-cyan-glow);
  background: rgba(255, 255, 255, 0.04);
}

.input-container input:focus + .input-icon {
  color: var(--accent-cyan);
}

/* Premium Glowing Check Button */
.glowing-btn {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  color: #0b0f19;
  border: none;
  border-radius: 12px;
  padding: 18px 24px;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.08rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: var(--transition-smooth);
  box-shadow: 0 8px 24px var(--accent-purple-glow);
}

.glowing-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px var(--accent-cyan-glow), 0 0 20px var(--accent-purple-glow);
}

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

.btn-icon {
  font-size: 1.25rem;
  transition: var(--transition-smooth);
}

.glowing-btn:hover .btn-icon {
  transform: translateX(4px);
}

/* Error message formatting */
.error-text {
  color: var(--error-color);
  font-size: 0.88rem;
  font-weight: 500;
  background: rgba(244, 67, 54, 0.08);
  border: 1px solid rgba(244, 67, 54, 0.15);
  padding: 12px 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==========================================
   LOADING RADAR SCREEN
   ========================================== */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  padding: 20px 0;
}

.radar-loader {
  position: relative;
  width: 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.radar-loader .ring {
  position: absolute;
  border: 2px solid var(--accent-cyan);
  border-radius: 50%;
  animation: pulseRadar 2.2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
  opacity: 0;
}

.radar-loader .ring:nth-child(2) {
  animation-delay: 0.7s;
}

.radar-loader .ring:nth-child(3) {
  animation-delay: 1.4s;
}

@keyframes pulseRadar {
  0% {
    width: 25px;
    height: 25px;
    opacity: 0.8;
  }
  100% {
    width: 95px;
    height: 95px;
    opacity: 0;
    border-color: var(--accent-purple);
  }
}

.loading-phone {
  font-size: 2.2rem;
  color: var(--accent-cyan);
  filter: drop-shadow(0 0 10px var(--accent-cyan-glow));
  z-index: 10;
  animation: rotatePhone 4s linear infinite;
}

@keyframes rotatePhone {
  0% { transform: rotateY(0deg); }
  50% { transform: rotateY(180deg); }
  100% { transform: rotateY(360deg); }
}

.loading-status {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.loading-status h3 {
  font-family: var(--font-title);
  font-size: 1.1rem;
  color: var(--text-secondary);
}

.pulse-text {
  font-size: 0.95rem;
  color: var(--accent-cyan);
  animation: textPulse 1.5s infinite ease-in-out;
}

@keyframes textPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* ==========================================
   RESULT CARD STATE
   ========================================== */
.device-summary-card {
  display: flex;
  align-items: center;
  gap: 20px;
}

.device-image-wrapper {
  width: 90px;
  height: 90px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

.device-photo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
}

.device-fallback {
  color: var(--accent-cyan);
  font-size: 2.5rem;
  filter: drop-shadow(0 0 8px var(--accent-cyan-glow));
}

.device-title-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}

.device-name {
  font-family: var(--font-title);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

#device-imei-sub {
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-family: monospace;
}

.badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 30px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.badge-success {
  background: hsla(145, 80%, 45%, 0.12);
  color: var(--success-color);
  border: 1px solid hsla(145, 80%, 45%, 0.25);
}

.divider {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--glass-border) 20%, var(--glass-border) 80%, transparent);
  margin: 25px 0;
}

/* Tab Navigation */
.spec-tabs-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.spec-header-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 5px;
  scrollbar-width: none; /* Hide scrollbar for Firefox */
}

.spec-header-nav::-webkit-scrollbar {
  display: none; /* Hide scrollbar for Chrome/Safari */
}

.tab-btn {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 30px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  transition: var(--transition-smooth);
}

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

.tab-btn.active {
  background: var(--text-primary);
  border-color: var(--text-primary);
  color: var(--bg-color);
  font-weight: 600;
}

/* Device Specifications Grid */
.specs-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.spec-item {
  display: flex;
  align-items: flex-start;
  padding: 14px 18px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.03);
  transition: var(--transition-smooth);
}

.spec-item:hover {
  background: rgba(255, 255, 255, 0.035);
  border-color: rgba(255, 255, 255, 0.06);
  transform: translateX(2px);
}

.spec-item-header {
  grid-column: 1 / -1;
  background: hsla(265, 89%, 66%, 0.05);
  border: 1px solid hsla(265, 89%, 66%, 0.12);
  padding: 10px 18px;
  margin-top: 15px;
  border-radius: 10px;
  font-family: var(--font-title);
  color: var(--accent-purple);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.spec-item-header .spec-icon {
  font-size: 1.3rem;
  color: var(--accent-purple);
}

.spec-icon {
  font-size: 1.4rem;
  color: var(--accent-cyan);
  margin-right: 15px;
  flex-shrink: 0;
  margin-top: 1px;
}

.spec-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.spec-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.spec-value {
  font-size: 0.98rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
  word-break: break-word;
}

/* Footer Actions */
.actions-footer {
  margin-top: 30px;
  display: flex;
  justify-content: flex-end;
}

.outline-btn {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  padding: 14px 22px;
  border-radius: 10px;
  cursor: pointer;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-smooth);
}

.outline-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--text-secondary);
}

.outline-btn span {
  font-size: 1.2rem;
}

/* ==========================================
   APP FOOTER
   ========================================== */
.app-footer {
  width: 100%;
  padding: 30px 20px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-secondary);
  border-top: 1px solid rgba(255, 255, 255, 0.03);
}

/* ==========================================
   ANIMATION & UTILITY CLASSES
   ========================================== */
.hidden {
  display: none !important;
}

.animate-fade-in {
  animation: fadeIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

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

/* ==========================================
   RESPONSIVE MEDIA QUERIES
   ========================================== */
@media (max-width: 520px) {
  .container {
    padding: 20px 12px;
  }
  
  .app-header {
    padding: 20px;
  }
  
  .logo-title {
    font-size: 1.8rem;
  }
  
  .main-card {
    padding: 20px;
  }
  
  .device-summary-card {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }
  
  .device-title-info {
    align-items: center;
  }
  
  .tab-btn {
    padding: 6px 12px;
    font-size: 0.78rem;
  }
}
