/* Core Design Variables - PageFleet Theme */
:root {
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  /* Color Palette - PageFleet Premium Scheme (Dark Mode Default) */
  --bg-color: #07090e;                  /* Deep Matte Black (Inner Frame) */
  --card-bg: rgba(18, 23, 35, 0.7);     /* Dark Armor Plate */
  --card-border: rgba(226, 182, 70, 0.1); /* Subtle Gold Edge */
  --card-hover-border: rgba(0, 210, 255, 0.5); /* Glowing Energy Blue Edge */
  
  --text-primary: #f8f9fa;              /* Pure White Armor Plate */
  --text-secondary: #94a3b8;            /* Matte Silver Gray */
  --text-muted: #5e6b7e;
  
  /* Brand Accents */
  --gold-metallic: #e2b646;             /* Pre-painted Gold Trim */
  --gold-metallic-hover: #f1ca62;
  --energy-blue: #00d2ff;               /* Translucent Blue Energy Cloak */
  
  /* Gradients */
  --primary-gradient: linear-gradient(135deg, #e2b646 0%, #3b82f6 50%, #00d2ff 100%);
  --gold-gradient: linear-gradient(135deg, #e2b646 0%, #c09425 100%);
  
  --accent-color: #00d2ff;
  --success-color: #00d2ff;
  --error-color: #ef4444;
  --warning-color: #e2b646;
  
  /* Ambient Glows */
  --glow-gold: rgba(226, 182, 70, 0.08);
  --glow-blue: rgba(0, 210, 255, 0.08);
  
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow: 0 12px 40px -12px rgba(0, 0, 0, 0.8);
}

/* Light Theme Variables Overrides */
body.light-theme {
  --bg-color: #f3f4f6;                  /* Soft Warm Gray */
  --card-bg: rgba(255, 255, 255, 0.75);  /* Clean white card plate */
  --card-border: rgba(226, 182, 70, 0.25); /* More visible gold border */
  --card-hover-border: rgba(59, 130, 246, 0.6); /* Blue accent border */
  
  --text-primary: #0f172a;              /* Slate 900 */
  --text-secondary: #475569;            /* Slate 600 */
  --text-muted: #94a3b8;                /* Slate 400 */
  
  --glow-gold: rgba(226, 182, 70, 0.05);
  --glow-blue: rgba(59, 130, 246, 0.05);
  
  --shadow: 0 10px 30px -10px rgba(15, 23, 42, 0.08);
  --success-color: #2563eb;
  --accent-color: #2563eb;
}

/* Reset & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Ambient Background Glows */
.background-glows {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
}

.glow-1 {
  top: -10%;
  left: 15%;
  width: 500px;
  height: 500px;
  background-color: var(--glow-gold);
  animation: float 20s infinite alternate ease-in-out;
}

.glow-2 {
  bottom: -10%;
  right: 15%;
  width: 600px;
  height: 600px;
  background-color: var(--glow-blue);
  animation: float 25s infinite alternate-reverse ease-in-out;
}

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

/* Header */
.app-header {
  border-bottom: 1px solid var(--card-border);
  background-color: rgba(7, 9, 14, 0.85);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 16px 0;
  transition: border-color 0.3s ease, background-color 0.3s ease;
}

body.light-theme .app-header {
  background-color: rgba(243, 244, 246, 0.85);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.logo-img {
  height: 38px;
  width: auto;
  display: block;
  object-fit: contain;
}

.logo-icon {
  font-size: 28px;
}

.logo-text {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.logo-text span {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Header Controls (Theme Toggle & Node Badge) */
.header-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.theme-toggle-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: var(--transition);
  outline: none;
}

body.light-theme .theme-toggle-btn {
  background: rgba(0, 0, 0, 0.03);
}

.theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--card-hover-border);
  transform: scale(1.05);
}

body.light-theme .theme-toggle-btn:hover {
  background: rgba(0, 0, 0, 0.08);
}

.header-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 8px 16px;
  border-radius: 30px;
  border: 1px solid var(--card-border);
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
}

body.light-theme .header-badge {
  background: rgba(0, 0, 0, 0.02);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--success-color);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--success-color);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 210, 255, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(0, 210, 255, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 210, 255, 0); }
}

body.light-theme @keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(37, 99, 235, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

/* Main Content Layout */
main {
  flex: 1;
  padding-top: 48px;
  padding-bottom: 60px;
}

/* Search Section */
.search-section {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 48px auto;
}

.search-title-wrapper h2 {
  font-size: 36px;
  font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
  background: linear-gradient(180deg, #ffffff 0%, #d4e0f0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

body.light-theme .search-title-wrapper h2 {
  background: linear-gradient(180deg, #0f172a 0%, #475569 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.search-title-wrapper p {
  color: var(--text-secondary);
  font-size: 16px;
  margin-bottom: 32px;
}

/* Input Form - Glassmorphism */
.search-form {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 8px;
  border-radius: var(--radius-md);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.search-form:focus-within {
  border-color: var(--card-hover-border);
  box-shadow: 0 0 30px rgba(0, 210, 255, 0.12);
}

body.light-theme .search-form:focus-within {
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.15);
}

.input-group {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.input-icon {
  font-size: 20px;
  padding-left: 12px;
}

.input-group input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 16px;
  font-family: var(--font-family);
  padding: 12px 4px;
}

.input-group input::placeholder {
  color: var(--text-muted);
}

.input-group button {
  background: var(--gold-gradient);
  border: none;
  outline: none;
  color: #07090e;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(226, 182, 70, 0.2);
}

.input-group button:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, var(--gold-metallic-hover) 0%, #e2b646 100%);
  box-shadow: 0 6px 20px rgba(226, 182, 70, 0.4);
}

.btn-arrow {
  transition: var(--transition);
  font-weight: 800;
}

.input-group button:hover .btn-arrow {
  transform: translateX(3px);
}

/* Results Section */
.results-section {
  margin-top: 24px;
}

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

.section-header h3 {
  font-size: 20px;
  font-weight: 700;
}

.view-btn {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--card-border);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: default;
}

body.light-theme .view-btn {
  background: rgba(0, 0, 0, 0.02);
}

.view-btn.active {
  background: rgba(0, 210, 255, 0.08);
  border-color: rgba(0, 210, 255, 0.3);
  color: var(--accent-color);
  box-shadow: 0 0 10px rgba(0, 210, 255, 0.1);
}

body.light-theme .view-btn.active {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.3);
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.1);
}

/* Grid & Cards */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 24px;
}

@media (max-width: 768px) {
  .results-grid {
    grid-template-columns: 1fr;
  }
}

/* Welcome Card (No search yet) */
.welcome-card {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 40px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.welcome-icon {
  font-size: 48px;
  margin-bottom: 16px;
  animation: hover-bounce 3s infinite ease-in-out;
}

@keyframes hover-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.welcome-card h4 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--gold-metallic);
}

body.light-theme .welcome-card h4 {
  color: #c09425;
}

.welcome-card p {
  color: var(--text-secondary);
  max-width: 460px;
  margin: 0 auto;
}

/* Regional Screenshot Card */
.node-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

.node-card:hover {
  border-color: var(--card-hover-border);
  transform: translateY(-4px);
  box-shadow: 0 16px 30px rgba(0, 210, 255, 0.08);
}

body.light-theme .node-card:hover {
  box-shadow: 0 16px 30px rgba(59, 130, 246, 0.08);
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.01);
}

body.light-theme .card-header {
  background: rgba(0, 0, 0, 0.01);
}

.card-title h4 {
  font-size: 16px;
  font-weight: 600;
}

.badge {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.badge-loading {
  background: rgba(226, 182, 70, 0.1);
  color: var(--gold-metallic);
  border: 1px solid rgba(226, 182, 70, 0.2);
}

body.light-theme .badge-loading {
  color: #c09425;
  border-color: rgba(226, 182, 70, 0.3);
}

.badge-ready {
  background: rgba(0, 210, 255, 0.1);
  color: var(--success-color);
  border: 1px solid rgba(0, 210, 255, 0.2);
}

body.light-theme .badge-ready {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.2);
}

.badge-error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error-color);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Screenshot Frame */
.screenshot-frame {
  position: relative;
  background: #05060a;
  aspect-ratio: 1280 / 800;
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--card-border);
}

body.light-theme .screenshot-frame {
  background: #e2e8f0;
}

.screenshot-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.screenshot-img.loaded {
  opacity: 1;
}

/* Spinner / Loader */
.card-loader {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

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

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

.loader-text {
  font-size: 13px;
  color: var(--text-secondary);
  animation: pulse-text 1.5s infinite alternate;
}

@keyframes pulse-text {
  0% { opacity: 0.5; }
  100% { opacity: 1; }
}

/* Error UI */
.card-error {
  position: absolute;
  padding: 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.error-icon {
  font-size: 32px;
}

.error-msg {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Card Footer Details */
.card-footer {
  padding: 14px 20px;
  background: rgba(0, 0, 0, 0.25);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  transition: background-color 0.3s ease;
}

body.light-theme .card-footer {
  background: rgba(0, 0, 0, 0.03);
}

.stat-item {
  color: var(--text-secondary);
}

.stat-item span {
  font-weight: 600;
  color: var(--text-primary);
}

.card-actions {
  display: flex;
  gap: 8px;
}

.card-action-btn {
  background: transparent;
  border: none;
  outline: none;
  color: var(--gold-metallic);
  cursor: pointer;
  font-weight: 600;
  font-family: var(--font-family);
  font-size: 13px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition);
}

body.light-theme .card-action-btn {
  color: #c09425;
}

.card-action-btn:hover {
  color: var(--gold-metallic-hover);
  text-shadow: 0 0 8px rgba(226, 182, 70, 0.3);
}

body.light-theme .card-action-btn:hover {
  color: #e2b646;
  text-shadow: 0 0 8px rgba(226, 182, 70, 0.15);
}

/* Footer */
.app-footer {
  text-align: center;
  padding: 24px 0;
  border-top: 1px solid var(--card-border);
  background-color: rgba(7, 9, 14, 0.5);
  color: var(--text-muted);
  font-size: 14px;
  margin-top: auto;
  transition: background-color 0.3s ease;
}

body.light-theme .app-footer {
  background-color: rgba(0, 0, 0, 0.02);
}

/* Region Selector Dropdown */
.region-selector-wrapper {
  display: flex;
  align-items: center;
}

.region-selector-container {
  position: relative;
  display: inline-block;
}

.region-select-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
  outline: none;
}

body.light-theme .region-select-btn {
  background: rgba(0, 0, 0, 0.02);
}

.region-select-btn:hover {
  border-color: var(--card-hover-border);
  background: rgba(255, 255, 255, 0.06);
}

body.light-theme .region-select-btn:hover {
  background: rgba(0, 0, 0, 0.04);
}

.dropdown-arrow {
  font-size: 10px;
  transition: transform 0.2s ease;
  color: var(--text-secondary);
}

.region-selector-container.open .dropdown-arrow {
  transform: rotate(180deg);
}

.region-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #0d111d;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 12px;
  min-width: 220px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
  display: none;
  z-index: 50;
  backdrop-filter: blur(16px);
  flex-direction: column;
  gap: 8px;
}

body.light-theme .region-dropdown-menu {
  background: #ffffff;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.1);
}

.region-selector-container.open .region-dropdown-menu {
  display: flex;
}

.region-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.region-option:hover {
  background: rgba(255, 255, 255, 0.05);
}

body.light-theme .region-option:hover {
  background: rgba(0, 0, 0, 0.03);
}

.region-option input[type="checkbox"] {
  accent-color: var(--accent-color);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

/* Responsive adjustments for mobile and tablets */
@media (max-width: 768px) {
  .search-title-wrapper h2 {
    font-size: 28px;
  }
  
  .search-section {
    margin-bottom: 32px;
  }
}

@media (max-width: 576px) {
  .search-form {
    padding: 12px;
  }
  
  .input-group {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  
  .input-icon {
    display: none;
  }
  
  .input-group input {
    width: 100%;
    padding: 12px 10px;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
  }
  
  body.light-theme .input-group input {
    background: rgba(0, 0, 0, 0.02);
  }
  
  .input-group button {
    justify-content: center;
    width: 100%;
    padding: 14px;
  }
  
  .header-container {
    padding: 0 16px;
  }
  
  .logo-img {
    height: 32px;
  }
}

@media (max-width: 480px) {
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .region-selector-wrapper {
    width: 100%;
  }
  
  .region-selector-container {
    width: 100%;
  }
  
  .region-select-btn {
    width: 100%;
    justify-content: space-between;
  }
  
  .region-dropdown-menu {
    width: 100%;
    right: auto;
    left: 0;
  }
}


