@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap");

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

:root {
  --primary-color: #38bdf8;
  --primary-dark: #6366f1;
  --primary-light: #bae6fd;
  --secondary-color: #f472b6;
  --accent-color: #0f172a;
  --neon-green: #22d3ee;
  --neon-blue: #6366f1;
  --neon-purple: #a855f7;
  --text-dark: #e2e8f0;
  --text-light: #94a3b8;
  --text-white: #f8fafc;
  --bg-dark: #030617;
  --bg-glass: rgba(15, 23, 42, 0.55);
  --bg-glass-light: rgba(30, 41, 59, 0.65);
  --surface-color: rgba(15, 23, 42, 0.78);
  --surface-elevated: rgba(17, 24, 39, 0.92);
  --surface-hover: rgba(125, 211, 252, 0.18);
  --border-glass: rgba(56, 189, 248, 0.35);
  --shadow-neon: 0 24px 60px rgba(99, 102, 241, 0.35);
  --shadow-neon-strong: 0 40px 90px rgba(56, 189, 248, 0.28);
  --shadow-glass: 0 20px 50px rgba(8, 47, 73, 0.45);
  --bg-gradient: radial-gradient(circle at 10% 20%, #0f172a 0%, #172554 45%, #431a57 100%);
}

body {
  font-family:
    "DM Sans",
    "Space Grotesk",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background: var(--bg-gradient);
  min-height: 100vh;
  color: var(--text-dark);
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding: 0;
  margin: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Space Grotesk", "DM Sans", sans-serif;
  letter-spacing: -0.02em;
  color: var(--text-white);
}

/* Desktop - solid white background */
@media (min-width: 769px) {
  .animated-bg {
    z-index: -1;
  }
}

/* Animated Background */
.animated-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background: var(--bg-gradient);
  overflow: hidden;
}

.particles {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: rgba(56, 189, 248, 0.7);
  border-radius: 50%;
  opacity: 0.6;
  animation: float 20s infinite;
  box-shadow: 0 0 12px rgba(14, 165, 233, 0.6);
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0) translateX(0);
    opacity: 0;
  }
  10% {
    opacity: 0.6;
  }
  90% {
    opacity: 0.6;
  }
  100% {
    transform: translateY(-100vh) translateX(100px);
    opacity: 0;
  }
}

.gradient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.65;
  animation: orbFloat 20s ease-in-out infinite;
  background: radial-gradient(circle at 30% 30%, rgba(56, 189, 248, 0.8), transparent 65%);
}

.orb-1 {
  width: 420px;
  height: 420px;
  top: -200px;
  left: -220px;
  animation-delay: 0s;
}

.orb-2 {
  width: 360px;
  height: 360px;
  bottom: -160px;
  right: -160px;
  animation-delay: 7s;
  background: radial-gradient(circle at 70% 70%, rgba(99, 102, 241, 0.7), transparent 65%);
}

.orb-3 {
  width: 380px;
  height: 380px;
  top: 55%;
  left: 55%;
  transform: translate(-50%, -50%);
  animation-delay: 14s;
  background: radial-gradient(circle at 50% 50%, rgba(168, 85, 247, 0.65), transparent 70%);
}

@keyframes orbFloat {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(50px, 50px) scale(1.1);
  }
  66% {
    transform: translate(-50px, -50px) scale(0.9);
  }
}

/* Notification */
.notification {
  position: fixed;
  top: 15px;
  left: 50%;
  transform: translate(-50%, -100px);
  padding: 12px 18px;
  border-radius: 14px;
  color: var(--text-white);
  font-weight: 600;
  font-size: 13px;
  box-shadow: var(--shadow-neon);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  z-index: 1000;
  width: auto;
  min-width: 220px;
  max-width: 80%;
  text-align: center;
  backdrop-filter: blur(24px);
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: linear-gradient(135deg, rgba(30, 64, 175, 0.85), rgba(14, 165, 233, 0.55));
  white-space: normal;
  word-wrap: break-word;
  line-height: 1.4;
}

.notification.show {
  transform: translate(-50%, 0);
  opacity: 1;
}

.notification.success {
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.9), rgba(45, 212, 191, 0.65));
  border-color: rgba(45, 212, 191, 0.5);
}

.notification.error {
  background: linear-gradient(135deg, rgba(248, 113, 113, 0.9), rgba(220, 38, 38, 0.7));
  border-color: rgba(248, 113, 113, 0.5);
}

.notification.info {
  background: linear-gradient(135deg, rgba(78, 105, 255, 0.85), rgba(56, 189, 248, 0.6));
  border-color: rgba(96, 165, 250, 0.45);
}

/* Universal Connection Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(2, 6, 23, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-overlay.show {
  display: flex;
  opacity: 1;
}

.modal-overlay.closing {
  display: flex !important;
  opacity: 1;
}

.modal-content {
  background: var(--surface-elevated);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 24px 24px 0 0;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  box-shadow: 0 -25px 60px rgba(14, 116, 144, 0.35);
}

.modal-overlay.show .modal-content {
  animation: slideUp 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.modal-overlay.closing .modal-content {
  animation: slideDown 0.3s cubic-bezier(0.55, 0.06, 0.68, 0.19) forwards;
}

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

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

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

.modal-header::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 4px;
  background: rgba(56, 189, 248, 0.55);
  border-radius: 2px;
}

.modal-header h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-white);
  letter-spacing: -0.4px;
}

.modal-close {
  width: 36px;
  height: 36px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-white);
  cursor: pointer;
  transition: all 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}

.modal-close i {
  font-size: 16px;
}

.modal-close:active {
  background: rgba(99, 102, 241, 0.28);
  transform: scale(0.96);
}

.modal-body {
  padding: 24px;
  flex: 1;
  overflow: visible;
}

.modal-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.48px;
}

.modal-label i {
  color: var(--primary-light);
  font-size: 13px;
}

.phone-section {
  margin-bottom: 18px;
}

.phone-input-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.country-code-wrapper {
  position: relative;
}

.country-code {
  padding: 12px 14px;
  background: rgba(249, 115, 22, 0.06);
  border: 1.5px solid var(--border-glass);
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dark);
  min-width: 80px;
  text-align: center;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.3s ease;
  user-select: none;
}

.country-code:hover {
  background: rgba(249, 115, 22, 0.1);
  border-color: var(--primary-color);
}

.country-code i {
  font-size: 12px;
  transition: transform 0.3s ease;
}

.country-code.active i {
  transform: rotate(180deg);
}

.country-code-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: rgba(20, 20, 30, 0.98);
  border: 1.5px solid var(--border-glass);
  border-radius: 12px;
  min-width: 200px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
}

.country-code-dropdown.show {
  display: block;
}

.country-option {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.country-option:last-child {
  border-bottom: none;
}

.country-option:hover {
  background: rgba(255, 255, 255, 0.08);
}

.country-option.selected {
  background: rgba(249, 115, 22, 0.15);
}

.country-flag {
  font-size: 20px;
  line-height: 1;
}

.country-name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-white);
}

.country-code-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary-color);
}

.phone-input {
  flex: 1;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid var(--border-glass);
  border-radius: 12px;
  font-size: 15px;
  color: var(--text-dark);
  transition: all 0.3s ease;
  -webkit-appearance: none;
  appearance: none;
}

.phone-input:focus {
  outline: none;
  border-color: var(--primary-color);
  background: rgba(249, 115, 22, 0.04);
}

.code-section {
  margin-bottom: 18px;
  display: block;
}

.code-inputs {
  display: grid;
  grid-template-columns: repeat(4, 1fr) auto repeat(4, 1fr);
  gap: 8px;
  align-items: center;
}

.code-input {
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  background: #fafafa;
  border: 1.5px solid var(--border-glass);
  border-radius: 6px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dark);
  text-align: center;
  transition: all 0.3s ease;
  -webkit-appearance: none;
  appearance: none;
}

.code-input:focus {
  outline: none;
  border-color: var(--primary-color);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.code-input[readonly] {
  background: rgba(249, 115, 22, 0.1);
  border-color: var(--primary-color);
  cursor: default;
  color: var(--primary-color);
  font-weight: 700;
}

.code-dash {
  color: var(--text-light);
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.copy-code-btn {
  width: 100%;
  padding: 10px;
  background: #f5f5f5;
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s ease;
  margin-top: 10px;
  -webkit-tap-highlight-color: transparent;
}

.copy-code-btn:hover {
  background: rgba(249, 115, 22, 0.08);
  border-color: var(--primary-color);
}

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

.copy-code-btn i {
  font-size: 12px;
}

.tutorial-section {
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 18px;
  display: block;
}

.tutorial-section h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 12px;
}

.tutorial-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tutorial-content p {
  font-size: 12px;
  color: var(--text-dark);
  line-height: 1.6;
  margin: 0;
}

.tutorial-content strong {
  color: var(--primary-color);
  font-weight: 600;
}

.connect-modal-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-neon);
  touch-action: manipulation;
  min-height: 48px;
  -webkit-tap-highlight-color: transparent;
  margin-bottom: 18px;
  margin-top: 0;
}

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

/* Bottom Navigation Bar */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 428px;
  background: rgba(15, 23, 42, 0.82);
  border-top: 1px solid rgba(56, 189, 248, 0.25);
  backdrop-filter: blur(26px);
  -webkit-backdrop-filter: blur(26px);
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  padding: 8px 0;
  z-index: 999;
  box-shadow: 0 -18px 40px rgba(8, 47, 73, 0.45);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px 8px;
  text-decoration: none;
  color: rgba(148, 163, 184, 0.85);
  transition: all 0.3s ease;
  -webkit-tap-highlight-color: transparent;
  min-width: 50px;
  flex: 1;
}

.nav-item i {
  font-size: 20px;
  transition: all 0.3s ease;
}

.nav-item[href="profile.html"] i {
  font-weight: 300;
}

.nav-item span {
  font-size: 9px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

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

.nav-item:active {
  transform: scale(0.95);
}

/* Scan Button (Center, Half Outside Footer) */
.scan-btn {
  position: relative;
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.95) 0%, rgba(99, 102, 241, 0.95) 100%);
  border: 3px solid rgba(14, 165, 233, 0.8);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow:
    0 4px 24px rgba(56, 189, 248, 0.55),
    0 0 32px rgba(99, 102, 241, 0.45);
  transition: all 0.3s ease;
  -webkit-tap-highlight-color: transparent;
  z-index: 1000;
  margin-top: -32px;
  flex-shrink: 0;
}

.scan-btn::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.8), rgba(99, 102, 241, 0.8));
  opacity: 0.35;
  z-index: -1;
  animation: pulse-ring 2s ease-out infinite;
}

.scan-btn::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.6), rgba(56, 189, 248, 0.5));
  opacity: 0.25;
  z-index: -2;
  animation: pulse-ring 2s ease-out infinite 0.5s;
}

.scan-btn i {
  font-size: 28px;
  color: var(--text-white);
  z-index: 1;
  animation: scan-icon 2s ease-in-out infinite;
}

.scan-btn:active {
  transform: scale(0.9);
  box-shadow: 0 2px 14px rgba(59, 130, 246, 0.55);
}

@keyframes pulse-ring {
  0% {
    transform: scale(1);
    opacity: 0.3;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.1;
  }
  100% {
    transform: scale(1.2);
    opacity: 0;
  }
}

@keyframes scan-icon {
  0%,
  100% {
    transform: scale(1) rotate(0deg);
  }
  50% {
    transform: scale(1.1) rotate(5deg);
  }
}

/* Tablet and Desktop */
@media (min-width: 769px) {
  .notification {
    top: 20px;
    left: 50%;
    max-width: 75%;
    padding: 12px 18px;
    font-size: 14px;
    text-align: center;
    transform: translate(-50%, -100px);
    white-space: normal;
    word-wrap: break-word;
  }

  .notification.show {
    transform: translate(-50%, 0);
  }

  .nav-item:hover {
    color: var(--primary-light);
  }

  .scan-btn:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow:
      0 10px 35px rgba(56, 189, 248, 0.55),
      0 0 45px rgba(79, 70, 229, 0.45);
  }
}

/* Full Page Loader */
.full-page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.full-page-loader.show {
  display: flex;
  opacity: 1;
}

.loader-content {
  text-align: center;
  color: var(--text-dark);
  padding: 20px;
}

.loader-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(249, 115, 22, 0.2);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 12px;
}

.loader-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dark);
  margin-top: 0;
  letter-spacing: 0.3px;
}

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