/* ==========================================================================
   GeoVerify - Global Styles & Visitor Dashboard CSS
   ========================================================================== */

:root {
  --bg-primary: #011921; /* OneData deep teal-black */
  --bg-secondary: #01242f; /* OneData ocean-teal-dark */
  --card-bg: rgba(1, 44, 57, 0.7); /* Glassmorphic teal card background */
  --card-border: rgba(255, 255, 255, 0.08);
  --card-border-glow: rgba(0, 188, 212, 0.3);
  
  --accent-cyan: #00bcd4; /* OneData Brand Cyan */
  --accent-purple: #00e676; /* OneData Brand Green/Mint */
  --accent-pink: #80e27e; /* OneData soft green secondary */
  
  --text-primary: #f3f4f6;
  --text-secondary: #b0bec5; /* Light blue-grey */
  --text-muted: #78909c;
  
  --font-family: 'Outfit', sans-serif;
  --transition-speed: 0.3s;
  --border-radius: 16px;
}

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

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

/* Background Glow Effects */
.bg-glow {
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  filter: blur(140px);
  z-index: -1;
  opacity: 0.15;
  pointer-events: none;
}

.bg-glow-1 {
  background: var(--accent-cyan);
  top: -10%;
  left: -10%;
  animation: float-glow 15s infinite alternate ease-in-out;
}

.bg-glow-2 {
  background: var(--accent-purple);
  bottom: -10%;
  right: -10%;
  animation: float-glow 20s infinite alternate-reverse ease-in-out;
}

@keyframes float-glow {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(80px, 50px) scale(1.2);
  }
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--card-border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Container */
.container {
  width: 100%;
  max-width: 1280px;
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  min-height: 100vh;
}

/* Admin Shortcut button */
.admin-shortcut-btn {
  position: absolute;
  top: 24px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  border-radius: 30px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  backdrop-filter: blur(12px);
  transition: all var(--transition-speed) ease;
  z-index: 10;
}

.admin-shortcut-btn:hover {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  border-color: transparent;
  box-shadow: 0 4px 20px rgba(0, 242, 254, 0.3);
  transform: translateY(-2px);
}

.admin-shortcut-btn i {
  width: 16px;
  height: 16px;
}

/* Header */
.header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

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

.logo-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0, 242, 254, 0.4);
}

.logo-icon i {
  color: white;
  width: 24px;
  height: 24px;
}

.logo h1 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.logo h1 span {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  font-weight: 400;
  max-width: 600px;
}

/* Loader */
.loader-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-grow: 1;
  padding: 60px;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(0, 242, 254, 0.1);
  border-top-color: var(--accent-cyan);
  border-bottom-color: var(--accent-purple);
  border-radius: 50%;
  animation: spin 1s infinite linear;
}

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

.loader-container p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* Main Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  flex-grow: 1;
}

/* Column styles */
.info-column {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.map-column {
  height: 100%;
}

/* Glassmorphic Cards */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius);
  padding: 24px;
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: all var(--transition-speed) ease;
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.card-glow {
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
  position: relative;
}

.card-glow::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--border-radius);
  padding: 1px;
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.4), rgba(157, 78, 221, 0.1), transparent);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* Card Header */
.card-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.card-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-icon i {
  width: 20px;
  height: 20px;
}

.ip-icon {
  background: rgba(0, 242, 254, 0.1);
  color: var(--accent-cyan);
}

.geo-icon {
  background: rgba(157, 78, 221, 0.1);
  color: var(--accent-purple);
}

.network-icon {
  background: rgba(255, 0, 127, 0.1);
  color: var(--accent-pink);
}

.device-icon {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.card-header h3 {
  font-size: 1.2rem;
  font-weight: 600;
  flex-grow: 1;
}

/* Badges */
.badge {
  background: linear-gradient(135deg, var(--accent-cyan), rgba(0, 242, 254, 0.5));
  color: #080710;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 30px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.flag-icon {
  font-size: 1.6rem;
}

/* Card Body elements */
.ip-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 1.8rem;
  font-weight: 700;
  font-family: var(--font-family);
  color: var(--text-primary);
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.copy-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.copy-btn:hover {
  color: var(--accent-cyan);
  background: rgba(0, 242, 254, 0.1);
}

.copy-btn i {
  width: 18px;
  height: 18px;
}

.location-display {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.refine-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 242, 254, 0.05);
  border: 1px solid rgba(0, 242, 254, 0.2);
  color: var(--accent-cyan);
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  align-self: flex-start;
  transition: all var(--transition-speed) ease;
}

.refine-btn:hover {
  background: var(--accent-cyan);
  color: #080710;
  border-color: transparent;
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.4);
  transform: translateY(-1px);
}

.refine-btn i {
  width: 14px;
  height: 14px;
}

.refine-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}


.isp-display {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}

/* Grid & Rows in card body */
.meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  padding: 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.meta-item.full-width {
  grid-column: span 2;
}

.meta-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.meta-value {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
  word-break: break-all;
}

/* Map Card */
.map-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius);
  backdrop-filter: blur(16px);
  overflow: hidden;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.map-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--card-border);
}

.map-title-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.map-title-wrapper i {
  color: var(--accent-cyan);
  width: 20px;
  height: 20px;
}

.map-title-wrapper h3 {
  font-size: 1.2rem;
  font-weight: 600;
}

.map-container {
  flex-grow: 1;
  min-height: 450px;
  background-color: var(--bg-secondary) !important;
  z-index: 1;
}

.map-footer {
  padding: 16px 24px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.map-footer i {
  width: 16px;
  height: 16px;
  color: var(--accent-cyan);
  flex-shrink: 0;
}

/* Dark mode Leaflet tweaks */
.leaflet-container {
  color: #fff;
}
.leaflet-bar a {
  background-color: var(--card-bg) !important;
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  backdrop-filter: blur(8px);
}
.leaflet-bar a:hover {
  background-color: var(--accent-cyan) !important;
  color: var(--bg-primary) !important;
}

/* Pulsing Custom Marker */
.pulse-marker {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 0 0 rgba(0, 188, 212, 0.7);
  animation: pulse-marker-anim 1.5s infinite;
}

@keyframes pulse-marker-anim {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(0, 188, 212, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 12px rgba(0, 188, 212, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(0, 188, 212, 0);
  }
}

/* Footer */
.footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: auto;
  padding-top: 40px;
}

/* Animations */
.animate-fade-in {
  opacity: 0;
  animation: fadeIn 1s forwards ease;
}

.animate-slide-up {
  opacity: 0;
  transform: translateY(30px);
  animation: slideUp 0.8s forwards cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
  to { opacity: 1; }
}

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

.hidden {
  display: none !important;
}

/* Responsive Rules */
@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  
  .map-container {
    min-height: 400px;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 24px 16px;
  }
  .logo h1 {
    font-size: 2rem;
  }
  .ip-display {
    font-size: 1.4rem;
  }
  .meta-grid {
    grid-template-columns: 1fr;
  }
  .meta-item.full-width {
    grid-column: span 1;
  }
  .admin-shortcut-btn {
    top: 16px;
    right: 16px;
    padding: 8px 12px;
  }
  .admin-shortcut-btn span {
    display: none;
  }
}

/* Visit Main Site Button */
.main-site-btn {
  position: absolute;
  top: 24px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: rgba(0, 188, 212, 0.1);
  border: 1px solid rgba(0, 188, 212, 0.25);
  border-radius: 30px;
  color: var(--accent-cyan);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  backdrop-filter: blur(12px);
  transition: all var(--transition-speed) ease;
  z-index: 10;
}

.main-site-btn:hover {
  background: var(--accent-cyan);
  color: #011921;
  border-color: transparent;
  box-shadow: 0 4px 20px rgba(0, 188, 212, 0.4);
  transform: translateY(-2px);
}

.main-site-btn i {
  width: 16px;
  height: 16px;
}

/* Welcome Modal Overlay */
.welcome-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(1, 20, 26, 0.85);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.welcome-modal-overlay.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.welcome-card {
  width: 100%;
  max-width: 480px;
  background: rgba(1, 38, 50, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 50px rgba(0, 188, 212, 0.15);
  border-radius: 20px;
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 24px;
  position: relative;
  animation: modal-zoom-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes modal-zoom-in {
  from {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.welcome-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 230, 118, 0.1);
  border: 1px solid rgba(0, 230, 118, 0.25);
  color: var(--accent-purple);
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.welcome-card h2 span {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.welcome-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin-top: 8px;
  animation: fadeIn 0.4s ease forwards;
}

.btn-precise {
  background: rgba(0, 188, 212, 0.1);
  border: 1px solid rgba(0, 188, 212, 0.25);
  color: var(--accent-cyan);
  width: 100%;
  font-family: var(--font-family);
  font-weight: 600;
  border-radius: 10px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all var(--transition-speed);
}

.btn-precise:hover {
  background: rgba(0, 188, 212, 0.2);
  transform: translateY(-1px);
}

.btn-precise i {
  width: 18px;
  height: 18px;
}

/* Modal Progress Loader */
.loader-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  margin-top: 8px;
}

.loader-bar-fill {
  height: 100%;
  width: 35%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
  border-radius: 10px;
  position: absolute;
  animation: loader-fill-anim 1.5s infinite linear;
}

@keyframes loader-fill-anim {
  0% {
    left: -35%;
  }
  100% {
    left: 100%;
  }
}

.animate-spin {
  animation: spin 1.2s infinite linear;
}

