/* ==============================================================================
   Core Variables & Reset
   ============================================================================== */
:root {
  --bg-color: #0b0f19;
  --panel-bg: rgba(17, 24, 39, 0.7);
  --border-color: rgba(255, 255, 255, 0.08);
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  
  --primary-glow: #06b6d4; /* Neon Cyan */
  --secondary-glow: #ec4899; /* Neon Pink */
  --success-color: #10b981; /* Emerald Green */
  --warning-color: #f59e0b; /* Amber */
  --danger-color: #ef4444; /* Coral Red */

  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  position: relative;
  line-height: 1.5;
  padding: 2rem 1rem;
}

/* ==============================================================================
   Background Glowing Orbs
   ============================================================================== */
.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.15;
  z-index: -1;
  pointer-events: none;
}

.orb-1 {
  width: 400px;
  height: 400px;
  background: var(--primary-glow);
  top: -100px;
  left: -100px;
  animation: float 20s infinite alternate;
}

.orb-2 {
  width: 500px;
  height: 500px;
  background: var(--secondary-glow);
  bottom: -100px;
  right: -100px;
  animation: float 25s infinite alternate-reverse;
}

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

/* ==============================================================================
   Layout & Container
   ============================================================================== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* ==============================================================================
   Header Styling
   ============================================================================== */
.app-header {
  text-align: center;
  padding: 1rem 0;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.logo-emoji {
  font-size: 2.5rem;
}

.app-header h1 {
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.05em;
}

.gradient-text {
  background: linear-gradient(135deg, var(--primary-glow), var(--secondary-glow));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  font-weight: 300;
}

/* ==============================================================================
   Telemetry Metrics Dashboard
   ============================================================================== */
.telemetry-card {
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.telemetry-card h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.metric-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition: var(--transition);
}

.metric-box:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.metric-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.metric-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.metric-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.active-db {
  color: var(--primary-glow);
}

/* Failover status colors */
.failover-val.healthy {
  color: var(--success-color);
}

.failover-val.warning {
  color: var(--warning-color);
  animation: pulse-warn 1.5s infinite alternate;
}

.failover-val.danger {
  color: var(--danger-color);
  animation: pulse-danger 1s infinite alternate;
}

@keyframes pulse-warn {
  0% { text-shadow: 0 0 5px rgba(245, 158, 11, 0.2); }
  100% { text-shadow: 0 0 15px rgba(245, 158, 11, 0.6); }
}

@keyframes pulse-danger {
  0% { text-shadow: 0 0 5px rgba(239, 68, 68, 0.2); }
  100% { text-shadow: 0 0 15px rgba(239, 68, 68, 0.7); }
}

/* ==============================================================================
   Storefront Catalog Grid
   ============================================================================== */
.storefront {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.section-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
}

.section-title-bar h2 {
  font-size: 1.5rem;
  font-weight: 600;
}

.refresh-indicator {
  font-size: 0.8rem;
  background: rgba(16, 185, 129, 0.15);
  color: var(--success-color);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  border: 1px solid rgba(16, 185, 129, 0.2);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.refresh-indicator::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: var(--success-color);
  border-radius: 50%;
  animation: blink 1.5s infinite alternate;
}

@keyframes blink {
  0% { opacity: 0.3; }
  100% { opacity: 1; }
}

.nft-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

/* ==============================================================================
   NFT Card Styles
   ============================================================================== */
.nft-card {
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.nft-card:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 12px 35px rgba(6, 182, 212, 0.15);
}

.nft-image-container {
  aspect-ratio: 1 / 1;
  width: 100%;
  background: linear-gradient(135deg, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0.06) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.nft-image-container svg {
  width: 60%;
  height: 60%;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.4));
  transition: var(--transition);
}

.nft-card:hover .nft-image-container svg {
  transform: scale(1.08) rotate(3deg);
}

.nft-info {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex-grow: 1;
}

.nft-title {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.nft-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
  height: 3.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  line-clamp: 3;
  overflow: hidden;
}

.nft-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.price-block {
  display: flex;
  flex-direction: column;
}

.price-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--text-muted);
}

.price-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary-glow);
}

/* ==============================================================================
   Button Styles
   ============================================================================== */
.btn {
  font-family: var(--font-family);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-glow), #0891b2);
  color: #0b0f19;
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #22d3ee, var(--primary-glow));
  box-shadow: 0 6px 18px rgba(6, 182, 212, 0.5);
  transform: scale(1.03);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.15);
}

/* ==============================================================================
   Dialog (Modal) Styling
   ============================================================================== */
.glass-dialog {
  margin: auto;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(20px);
  color: var(--text-main);
  width: 90%;
  max-width: 450px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  padding: 2rem;
}

.glass-dialog::backdrop {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.dialog-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.dialog-nft-title {
  font-size: 1.1rem;
  color: var(--primary-glow);
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-group input {
  font-family: var(--font-family);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 0.75rem;
  color: var(--text-main);
  font-size: 1rem;
  transition: var(--transition);
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary-glow);
  box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.25);
  background: rgba(255, 255, 255, 0.08);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* ==============================================================================
   Skeleton Loading Animation
   ============================================================================== */
.nft-card.skeleton {
  min-height: 380px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.03) 25%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0.03) 75%
  );
  background-size: 200% 100%;
  animation: loading-shimmer 1.5s infinite;
  border-color: rgba(255, 255, 255, 0.03);
}

@keyframes loading-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ==============================================================================
   Toast Notifications
   ============================================================================== */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
  background: rgba(30, 41, 59, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transform: translateY(150%);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-content {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.toast-icon {
  font-size: 1.25rem;
}

.toast-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.toast-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.toast-body {
  font-size: 0.8rem;
  color: var(--text-muted);
}
