@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap");

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

:root {
  --primary-color: #f97316;
  --primary-dark: #ea580c;
  --primary-light: #fb923c;
  --secondary-color: #c2410c;
  --accent-color: #fff7ed;
  --neon-green: #fb923c;
  --neon-blue: #fdba74;
  --neon-purple: #ea580c;
  --text-dark: #0a0a0a;
  --text-light: #6b7280;
  --text-white: #ffffff;
  --bg-dark: #ffffff;
  --bg-glass: rgba(249, 115, 22, 0.06);
  --bg-glass-light: rgba(249, 115, 22, 0.1);
  --border-glass: rgba(249, 115, 22, 0.25);
  --shadow-neon: 0 0 20px rgba(249, 115, 22, 0.25);
  --shadow-neon-strong: 0 0 40px rgba(249, 115, 22, 0.35);
  --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.08);
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg-dark);
  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;
}

/* Desktop - solid white background */
@media (min-width: 769px) {
  body {
    background: #ffffff;
  }

  body::before,
  body::after {
    display: none;
  }

  .animated-bg {
    z-index: -1;
  }
}

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

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

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--primary-color);
  border-radius: 50%;
  opacity: 0.6;
  animation: float 20s infinite;
  box-shadow: 0 0 10px var(--primary-color);
}

@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(80px);
  opacity: 0.4;
  animation: orbFloat 20s ease-in-out infinite;
}

.orb-1 {
  width: 400px;
  height: 400px;
  background: transparent;
  top: -200px;
  left: -200px;
  animation-delay: 0s;
}

.orb-2 {
  width: 300px;
  height: 300px;
  background: transparent;
  bottom: -150px;
  right: -150px;
  animation-delay: 7s;
}

.orb-3 {
  width: 350px;
  height: 350px;
  background: transparent;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: 14s;
}

@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: 10px 14px;
  border-radius: 8px;
  color: var(--text-dark);
  font-weight: 500;
  font-size: 13px;
  box-shadow: var(--shadow-glass);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  z-index: 1000;
  width: auto;
  min-width: 200px;
  max-width: 75%;
  text-align: center;
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  white-space: normal;
  word-wrap: break-word;
  line-height: 1.3;
}

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

.notification.success {
  background: rgba(39, 174, 96, 0.2);
  border-color: rgba(39, 174, 96, 0.5);
}

.notification.error {
  background: rgba(231, 76, 60, 0.2);
  border-color: rgba(231, 76, 60, 0.5);
}

.notification.info {
  background: rgba(249, 115, 22, 0.15);
  border-color: rgba(249, 115, 22, 0.4);
}

/* Universal Connection Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  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: #ffffff;
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: none;
  border-top: 1px solid rgba(249, 115, 22, 0.3);
  border-radius: 24px 24px 0 0;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  box-shadow: 0 -10px 40px rgba(249, 115, 22, 0.2);
}

.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(249, 115, 22, 0.4);
  border-radius: 2px;
}

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

.modal-close {
  width: 36px;
  height: 36px;
  background: rgba(249, 115, 22, 0.08);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dark);
  cursor: pointer;
  transition: all 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}

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

.modal-close:active {
  background: rgba(249, 115, 22, 0.15);
  transform: scale(0.95);
}

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

.modal-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.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 {
  background: #fafafa;
  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: #ffffff;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  padding: 8px 0;
  z-index: 999;
  box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.06);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px 8px;
  text-decoration: none;
  color: var(--text-light);
  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-color);
}

.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, var(--primary-color) 0%, var(--primary-dark) 100%);
  border: 3px solid rgba(249, 115, 22, 0.95);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(249, 115, 22, 0.4), 0 0 30px rgba(249, 115, 22, 0.3);
  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, var(--primary-color), var(--primary-dark));
  opacity: 0.3;
  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, var(--primary-color), var(--primary-dark));
  opacity: 0.2;
  z-index: -2;
  animation: pulse-ring 2s ease-out infinite 0.5s;
}

.scan-btn i {
  font-size: 28px;
  color: #ffffff;
  z-index: 1;
  animation: scan-icon 2s ease-in-out infinite;
}

.scan-btn:active {
  transform: scale(0.9);
  box-shadow: 0 2px 10px rgba(249, 115, 22, 0.5);
}

@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-dark);
  }

  .scan-btn:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 6px 30px rgba(249, 115, 22, 0.5), 0 0 40px rgba(249, 115, 22, 0.4);
  }
}

/* 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);
  }
}
