/*
 * Captourio - Landing Page Styles
 */

/* ==================== CSS Variables ==================== */
:root {
  /* Colors */
  --color-primary: #3b82f6;
  --color-primary-dark: #2563eb;
  --color-primary-light: #60a5fa;
  --color-secondary: #0ea5e9;
  --color-accent: #06b6d4;
  
  --color-bg: #0f172a;
  --color-bg-light: #1e293b;
  --color-bg-lighter: #334155;
  
  --color-text: #f8fafc;
  --color-text-muted: #94a3b8;
  --color-text-dim: #64748b;
  
  --color-border: #334155;
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
  --gradient-hero: radial-gradient(ellipse at top, #1e3a5f 0%, var(--color-bg) 70%);
  
  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;
  
  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 2rem;
  --font-size-4xl: 2.5rem;
  --font-size-5xl: 3.5rem;
  
  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
  --shadow-glow: 0 0 40px rgb(59 130 246 / 0.3);
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;
}

/* ==================== Reset & Base ==================== */
*, *::before, *::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
}

/* ==================== Layout ==================== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.landing {
  overflow-x: hidden;
}

/* ==================== Navigation ==================== */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-lg) var(--space-xl);
  max-width: 1400px;
  margin: 0 auto;
  gap: var(--space-2xl);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
}

.logo-icon {
  width: 40px;
  height: 40px;
  color: var(--color-primary);
}

.logo-icon svg {
  width: 100%;
  height: 100%;
}

.logo-text {
  font-size: var(--font-size-2xl);
  font-weight: 800;
  letter-spacing: -0.03em;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

.nav-link {
  color: var(--color-text-muted);
  font-size: var(--font-size-base);
  font-weight: 500;
  transition: color var(--transition-fast);
}

.nav-link:hover {
  color: var(--color-text);
}

/* ==================== Buttons ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm) var(--space-lg);
  font-size: var(--font-size-sm);
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.btn-outline {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn-outline:hover {
  background: var(--color-bg-light);
  border-color: var(--color-text-dim);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
  border: 1px solid transparent;
}

.btn-ghost:hover {
  color: var(--color-text);
  background: var(--color-bg-light);
}

.btn-lg {
  padding: var(--space-md) var(--space-xl);
  font-size: var(--font-size-base);
}

/* ==================== Hero Section ==================== */
.hero {
  min-height: 100vh;
  background: var(--gradient-hero);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.hero-content {
  max-width: 700px;
  padding: var(--space-4xl) var(--space-xl);
  padding-bottom: var(--space-lg);
  position: relative;
  z-index: 2;
}

/* Center hero content on desktop when globe-features layout is shown */
@media (min-width: 1200px) {
  .hero-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
  }
  
  .hero-cta {
    justify-content: center;
  }
}

.hero-title {
  font-size: clamp(var(--font-size-4xl), 8vw, var(--font-size-5xl));
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-lg);
}

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

.hero-subtitle {
  font-size: var(--font-size-lg);
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-bottom: var(--space-2xl);
}

.hero-cta {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}

/* ==================== Globe Animation ==================== */
.hero-visual {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding-top: var(--space-md);
  padding-bottom: var(--space-md);
  z-index: 1;
}

.globe-container {
  width: 450px;
  height: 450px;
  perspective: 1000px;
}

/* Legacy CSS-only globe styles (replaced by 3D globe) */
.globe {
  width: 100%;
  height: 100%;
  position: relative;
  animation: rotate 30s linear infinite;
  transform-style: preserve-3d;
}

@keyframes rotate {
  from { transform: rotateY(0deg); }
  to { transform: rotateY(360deg); }
}

.globe-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  border: 2px solid var(--color-primary);
  border-radius: 50%;
  opacity: 0.3;
}

.globe-ring:nth-child(1) {
  width: 500px;
  height: 500px;
  margin: -250px 0 0 -250px;
  transform: rotateX(75deg);
}

.globe-ring:nth-child(2) {
  width: 450px;
  height: 450px;
  margin: -225px 0 0 -225px;
  transform: rotateX(75deg) rotateY(30deg);
  border-color: var(--color-secondary);
}

.globe-ring:nth-child(3) {
  width: 400px;
  height: 400px;
  margin: -200px 0 0 -200px;
  transform: rotateX(75deg) rotateY(60deg);
  border-color: var(--color-accent);
}

.pin {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--color-primary);
  border-radius: 50%;
  box-shadow: 0 0 20px var(--color-primary);
  animation: pulse 2s ease-in-out infinite;
}

.pin-1 { top: 20%; left: 30%; animation-delay: 0s; }
.pin-2 { top: 35%; left: 60%; animation-delay: 0.5s; }
.pin-3 { top: 50%; left: 45%; animation-delay: 1s; }
.pin-4 { top: 65%; left: 25%; animation-delay: 1.5s; }
.pin-5 { top: 40%; left: 70%; animation-delay: 2s; }

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.7; }
}

/* ==================== Features Section ==================== */
.features {
  padding: var(--space-4xl) 0;
  background: var(--color-bg);
}

.section-title {
  font-size: var(--font-size-3xl);
  font-weight: 700;
  text-align: center;
  margin-bottom: var(--space-md);
  letter-spacing: -0.025em;
}

.section-subtitle {
  font-size: var(--font-size-lg);
  color: var(--color-text-muted);
  text-align: center;
  max-width: 600px;
  margin: 0 auto var(--space-3xl);
}

/* Hero with globe and feature cards layout */
.hero-globe-features {
  display: none; /* Hidden by default, shown on large screens */
}

/* Mobile: Standard grid layout */
.features-grid-mobile {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
}

/* Hide mobile features section on desktop */
@media (min-width: 1200px) {
  .features-mobile-section {
    display: none;
  }
  
  /* Hide the simple hero-visual, show the globe-features layout */
  .hero-visual {
    display: none;
  }
  
  .hero-globe-features {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xl);
    position: relative;
    padding: var(--space-3xl) var(--space-xl);
    margin-top: var(--space-xl);
  }
  
  .features-column {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    width: 300px;
    z-index: 2;
  }
  
  .hero-globe-center {
    position: relative;
    z-index: 3;
    flex-shrink: 0;
  }
  
  .hero-globe-center .globe-container {
    width: 400px;
    height: 400px;
  }
  
  .hero-globe-center .globe-3d {
    min-height: 400px;
  }
  
  /* Feature cards - standard rounded corners */
  .features-column .feature-card {
    background: var(--color-bg-light);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    transition: all var(--transition-base);
  }
  
  /* Middle cards offset outward for depth */
  .features-column-left .feature-card-middle {
    transform: translateX(-20px);
  }
  
  .features-column-right .feature-card-middle {
    transform: translateX(20px);
  }
  
  /* Hover effects */
  .features-column .feature-card:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-glow);
  }
  
  .features-column-left .feature-card:hover {
    transform: translateX(-8px);
  }
  
  .features-column-left .feature-card-middle:hover {
    transform: translateX(-28px);
  }
  
  .features-column-right .feature-card:hover {
    transform: translateX(8px);
  }
  
  .features-column-right .feature-card-middle:hover {
    transform: translateX(28px);
  }
}

/* Extra large screens - larger globe and cards */
@media (min-width: 1400px) {
  .features-column {
    width: 340px;
  }
  
  .hero-globe-center .globe-container {
    width: 460px;
    height: 460px;
  }
  
  .hero-globe-center .globe-3d {
    min-height: 460px;
  }
  
  /* More offset on larger screens */
  .features-column-left .feature-card-middle {
    transform: translateX(-30px);
  }
  
  .features-column-right .feature-card-middle {
    transform: translateX(30px);
  }
  
  .features-column-left .feature-card-middle:hover {
    transform: translateX(-38px);
  }
  
  .features-column-right .feature-card-middle:hover {
    transform: translateX(38px);
  }
}

/* Original grid for reference - keeping for compatibility */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-xl);
}

.feature-card {
  background: var(--color-bg-light);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  transition: all var(--transition-base);
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-glow);
}

.feature-icon {
  width: 48px;
  height: 48px;
  background: var(--gradient-primary);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-lg);
}

.feature-icon svg {
  width: 24px;
  height: 24px;
  color: white;
}

.feature-title {
  font-size: var(--font-size-xl);
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.feature-description {
  color: var(--color-text-muted);
  line-height: 1.7;
}

/* ==================== How It Works Section ==================== */
.how-it-works {
  padding: var(--space-4xl) 0;
  background: var(--color-bg-light);
}

.steps {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: var(--space-xl);
  margin-top: var(--space-3xl);
  flex-wrap: wrap;
}

.step {
  flex: 1;
  min-width: 250px;
  max-width: 320px;
  text-align: center;
}

.step-number {
  width: 64px;
  height: 64px;
  background: var(--gradient-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-2xl);
  font-weight: 700;
  margin: 0 auto var(--space-lg);
  box-shadow: var(--shadow-glow);
}

.step-title {
  font-size: var(--font-size-xl);
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.step-description {
  color: var(--color-text-muted);
  line-height: 1.7;
}

.step-connector {
  width: 80px;
  height: 2px;
  background: var(--color-border);
  margin-top: 32px;
  flex-shrink: 0;
}

/* ==================== CTA Section ==================== */
.cta-section {
  padding: var(--space-4xl) 0;
  background: var(--gradient-hero);
  text-align: center;
}

.cta-title {
  font-size: var(--font-size-3xl);
  font-weight: 700;
  margin-bottom: var(--space-md);
}

.cta-subtitle {
  font-size: var(--font-size-lg);
  color: var(--color-text-muted);
  max-width: 500px;
  margin: 0 auto var(--space-2xl);
}

/* ==================== Footer ==================== */
.footer {
  padding: var(--space-3xl) 0;
  background: var(--color-bg);
  text-align: center;
  border-top: 1px solid var(--color-border);
}

.footer .logo-icon {
  width: 24px;
  height: 24px;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.footer-tagline {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-lg);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: var(--space-xl);
  margin-bottom: var(--space-lg);
}

.footer-links a {
  color: var(--color-text-dim);
  font-size: var(--font-size-sm);
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--color-text);
}

.footer-copyright {
  color: var(--color-text-dim);
  font-size: var(--font-size-sm);
}

/* ==================== Interactive 3D Globe ==================== */
.globe-3d {
  width: 100%;
  height: 100%;
  min-height: 400px;
  position: relative;
  cursor: grab;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.globe-3d:active {
  cursor: grabbing;
}

/* Globe Auto-Rotate Toggle Button */
.globe-rotate-toggle {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  z-index: 10;
  width: 36px;
  height: 36px;
  border: 1px solid var(--color-border);
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-dim);
  transition: all var(--transition-fast);
  padding: 0;
}

.globe-rotate-toggle:hover {
  background: rgba(15, 23, 42, 0.9);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.globe-rotate-toggle.active {
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.globe-rotate-toggle.active svg {
  animation: globe-rotate-spin 2s linear infinite;
}

.globe-rotate-toggle svg {
  width: 16px;
  height: 16px;
}

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

.globe-3d canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
}

/* Globe Modal Popup */
.globe-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-base), visibility var(--transition-base);
  touch-action: auto;
}

.globe-modal.active {
  opacity: 1;
  visibility: visible;
}

.globe-modal-content {
  background: var(--color-bg-light);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  max-width: 480px;
  width: 90%;
  position: relative;
  transform: scale(0.9) translateY(20px);
  transition: transform var(--transition-base);
  box-shadow: var(--shadow-xl), var(--shadow-glow);
  touch-action: auto;
}

.globe-modal.active .globe-modal-content {
  transform: scale(1) translateY(0);
}

.globe-modal-close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  width: 40px;
  height: 40px;
  border: none;
  background: var(--color-bg-lighter);
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  transition: all var(--transition-fast);
  z-index: 10;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.globe-modal-close:hover {
  background: var(--color-primary);
  color: white;
}

.globe-modal-close svg {
  width: 16px;
  height: 16px;
}

.globe-modal-title {
  font-size: var(--font-size-xl);
  font-weight: 600;
  margin-bottom: var(--space-md);
  padding-right: var(--space-xl);
}

.globe-modal-image {
  background: var(--color-bg);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3xl);
  text-align: center;
  color: var(--color-text-dim);
  margin-bottom: var(--space-md);
}

.globe-modal-image-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto var(--space-md);
  color: var(--color-text-dim);
}

/* Medium screens - 2 column grid */
@media (min-width: 769px) and (max-width: 1199px) {
  .features-grid-mobile {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==================== Flash Messages ==================== */
.flash {
  position: fixed;
  top: var(--space-lg);
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 500;
  max-width: 500px;
  width: calc(100% - var(--space-2xl));
  text-align: center;
  animation: flash-in 0.3s ease, flash-out 0.4s ease 4s forwards;
  pointer-events: none;
}

.flash-notice {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

.flash-alert {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

@keyframes flash-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-12px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes flash-out {
  from { opacity: 1; transform: translateX(-50%) translateY(0); }
  to { opacity: 0; transform: translateX(-50%) translateY(-12px); }
}

/* ==================== Auth Pages (Sign In / Sign Up / Password) ==================== */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-hero);
  padding: var(--space-xl);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--color-bg-light);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-3xl);
  box-shadow: var(--shadow-xl);
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-2xl);
  text-decoration: none;
}

.auth-brand .logo-icon {
  width: 32px;
  height: 32px;
}

.auth-brand .logo-text {
  font-size: var(--font-size-xl);
}

.auth-title {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  text-align: center;
  margin-bottom: var(--space-xs);
  letter-spacing: -0.025em;
}

.auth-subtitle {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.auth-label {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text);
}

.auth-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.auth-forgot-link {
  font-size: var(--font-size-sm);
  color: var(--color-primary-light);
  transition: color var(--transition-fast);
}

.auth-forgot-link:hover {
  color: var(--color-primary);
}

.auth-hint {
  font-size: 0.8rem;
  color: var(--color-text-dim);
  font-style: italic;
}

.auth-input {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  font-size: var(--font-size-base);
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.auth-input::placeholder {
  color: var(--color-text-dim);
}

.auth-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.auth-checkbox-field {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.auth-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.auth-checkbox-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  cursor: pointer;
}

.auth-submit {
  width: 100%;
  margin-top: var(--space-sm);
}

.auth-footer-text {
  text-align: center;
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-xl);
}

.auth-footer-link {
  color: var(--color-primary-light);
  font-weight: 500;
  transition: color var(--transition-fast);
}

.auth-footer-link:hover {
  color: var(--color-primary);
}

/* Auth error messages */
.auth-errors {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-sm);
}

.auth-errors-title {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: #fca5a5;
  margin-bottom: var(--space-sm);
}

.auth-errors-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.auth-errors-list li {
  font-size: var(--font-size-sm);
  color: #fca5a5;
  padding: var(--space-xs) 0;
}

.auth-errors-list li::before {
  content: "\2022";
  margin-right: var(--space-sm);
}

/* Auth danger zone (edit account) */
.auth-danger-zone {
  margin-top: var(--space-2xl);
  padding-top: var(--space-xl);
  border-top: 1px solid rgba(239, 68, 68, 0.2);
}

.auth-danger-title {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: #fca5a5;
  margin-bottom: var(--space-xs);
}

.auth-danger-text {
  font-size: var(--font-size-sm);
  color: var(--color-text-dim);
  margin-bottom: var(--space-md);
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm) var(--space-lg);
  font-size: var(--font-size-sm);
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
}

/* ==================== Dashboard ==================== */
.dashboard {
  min-height: 100vh;
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
}

.dashboard-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) var(--space-xl);
  background: var(--color-bg-light);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.btn-sm {
  padding: var(--space-xs) var(--space-md);
  font-size: var(--font-size-sm);
}

.dashboard-topbar .nav-brand .logo-icon {
  width: 28px;
  height: 28px;
}

.dashboard-topbar .nav-brand .logo-text {
  font-size: var(--font-size-lg);
}

.dashboard-main {
  flex: 1;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-xl);
}

.dashboard-welcome-card {
  text-align: center;
  margin-bottom: var(--space-lg);
}

/* ==================== Dashboard Tabs ==================== */

.dashboard-tabs {
  display: flex;
  gap: var(--space-xs);
  margin-bottom: var(--space-xl);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0;
}

.dashboard-tab {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  border: none;
  background: none;
  color: var(--color-text-muted);
  font-size: var(--font-size-base);
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.dashboard-tab:hover {
  color: var(--color-text);
}

.dashboard-tab--active {
  color: var(--color-primary-light);
  border-bottom-color: var(--color-primary);
}

.dashboard-tab svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.dashboard-tab--active svg {
  opacity: 1;
}

.dashboard-tab-panel {
  /* Panels are visible by default */
}

.dashboard-tab-panel--hidden {
  display: none;
}

/* ==================== Collections Section ==================== */

.collections-section {
  margin-top: var(--space-2xl);
}

.collections-title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-lg);
}

.collections-title svg {
  color: var(--color-primary-light);
  flex-shrink: 0;
}

.collections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-lg);
}

.collection-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xl) var(--space-lg);
  background: var(--color-bg-light);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  text-align: center;
  position: relative;
}

.collection-card:hover {
  background: var(--color-bg-lighter);
  border-color: var(--color-primary);
  transform: translateY(-2px);
}

.collection-card-icon {
  color: var(--color-primary-light);
  opacity: 0.8;
}

.collection-card:hover .collection-card-icon {
  opacity: 1;
}

.collection-card-name {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--color-text);
}

.collection-card-count {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

/* Create New Collection card */
.collection-card--create {
  border-style: dashed;
  border-color: var(--color-border);
  background: transparent;
  opacity: 0.7;
  transition: opacity 0.2s, border-color 0.2s, transform 0.15s;
}

.collection-card--create:hover {
  opacity: 1;
  border-color: var(--color-primary);
  background: var(--color-bg-light);
}

.collection-card--create .collection-card-icon {
  color: var(--color-text-muted);
}

.collection-card--create:hover .collection-card-icon {
  color: var(--color-primary-light);
}

.collection-card--create .collection-card-name {
  font-weight: 500;
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

/* Shared collection cards */
.collection-card--shared {
  border-color: rgba(14, 165, 233, 0.2);
  position: relative;
}

.collection-card--shared:hover {
  border-color: var(--color-secondary);
}

.collection-card--shared .collection-card-icon {
  color: var(--color-secondary);
}

.collection-card-owner {
  font-size: 0.75rem;
  color: var(--color-text-dim);
  font-weight: 400;
}

/* Notification badge on collection cards */
.collection-card-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: #ef4444;
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Collaborative indicator on collection cards */
.collection-card-collab-indicator {
  position: absolute;
  top: 8px;
  left: 8px;
  color: var(--color-secondary);
  opacity: 0.6;
}

.collection-card:hover .collection-card-collab-indicator {
  opacity: 1;
}

/* "Shared with me" section subtitle */
.collections-subtitle {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--color-text-muted);
  margin-top: var(--space-xl);
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* Create/Join dialog tabs */
.create-dialog-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-lg);
}

.create-dialog-tab {
  flex: 1;
  padding: var(--space-sm) var(--space-md);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: color var(--transition-fast), border-color var(--transition-fast);
  text-align: center;
}

.create-dialog-tab:hover {
  color: var(--color-text);
}

.create-dialog-tab--active {
  color: var(--color-primary-light);
  border-bottom-color: var(--color-primary);
}

.create-dialog-panel {
  display: none;
}

.create-dialog-panel--active {
  display: block;
}

/* Settings panel tabs (Share Links | Collaborate) */
.settings-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-lg);
}

.settings-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: color var(--transition-fast), border-color var(--transition-fast);
  text-align: center;
}

.settings-tab:hover {
  color: var(--color-text);
}

.settings-tab--active {
  color: var(--color-primary-light);
  border-bottom-color: var(--color-primary);
}

.settings-tab-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: #ef4444;
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.settings-tab-content {
  display: none;
}

.settings-tab-content--active {
  display: block;
}

/* Collaborate tab styles */
.collaborate-section {
  margin-bottom: var(--space-lg);
}

.collaborate-description {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
  line-height: 1.6;
}

.collaborate-enable-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 8px 16px;
  font-size: var(--font-size-sm);
  font-weight: 600;
  font-family: var(--font-sans);
  color: white;
  background: var(--color-secondary);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.collaborate-enable-btn:hover {
  background: #0284c7;
}

.collaborate-warning {
  font-size: 0.75rem;
  color: var(--color-text-dim);
  margin-top: var(--space-sm);
  font-style: italic;
}

/* Invite code display */
.collaborate-invite-code-section {
  margin-bottom: var(--space-lg);
}

.collaborate-code-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
}

.collaborate-code-input {
  flex: 1;
  font-size: var(--font-size-sm);
  font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
  color: var(--color-primary-light);
  font-weight: 500;
  background: transparent;
  border: none;
  outline: none;
  user-select: all;
  overflow: hidden;
  text-overflow: ellipsis;
}

.collaborate-code-copy-btn {
  flex-shrink: 0;
}

/* Pending requests section */
.collaborate-subheading {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-sm);
  margin-top: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.collaborate-count-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: #ef4444;
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.collaborate-member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid rgba(51, 65, 85, 0.3);
}

.collaborate-member-row:last-child {
  border-bottom: none;
}

.collaborate-member-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.collaborate-member-name {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collaborate-member-email {
  font-size: 0.75rem;
  color: var(--color-text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collaborate-member-actions {
  display: flex;
  gap: var(--space-xs);
  flex-shrink: 0;
}

.collaborate-accept-btn,
.collaborate-reject-btn,
.collaborate-remove-btn {
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-sans);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.collaborate-accept-btn {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.collaborate-accept-btn:hover {
  background: #22c55e;
  color: white;
}

.collaborate-reject-btn {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.collaborate-reject-btn:hover {
  background: #ef4444;
  color: white;
}

.collaborate-remove-btn {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.collaborate-remove-btn:hover {
  background: #ef4444;
  color: white;
}

/* Members section */
.collaborate-members-list {
  margin-bottom: var(--space-sm);
}

.collaborate-empty {
  font-size: var(--font-size-sm);
  color: var(--color-text-dim);
  text-align: center;
  padding: var(--space-md) 0;
  font-style: italic;
}

/* Collection create form (inside globe-modal) */
.collection-create-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.collection-form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.collection-form-label {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text);
}

.collection-form-optional {
  font-weight: 400;
  color: var(--color-text-muted);
}

.collection-form-input {
  padding: 8px 12px;
  font-size: var(--font-size-base);
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color var(--transition-fast);
}

.collection-form-input:focus {
  border-color: var(--color-primary);
}

.collection-form-input::placeholder {
  color: var(--color-text-dim);
}

.collection-form-textarea {
  resize: vertical;
  min-height: 72px;
}

.collection-form-error {
  font-size: var(--font-size-sm);
  color: var(--color-error, #ef4444);
  padding: var(--space-xs) var(--space-sm);
  background: rgba(239, 68, 68, 0.08);
  border-radius: var(--radius-sm);
}

.collection-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  padding-top: var(--space-sm);
}

/* Upload collection picker */
.upload-collection-picker {
  display: flex;
  align-items: center;
}

.upload-collection-select {
  min-width: 160px;
  max-width: 220px;
}

.dashboard-welcome-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-lg);
  color: var(--color-primary);
  opacity: 0.6;
}

.dashboard-welcome-icon svg {
  width: 100%;
  height: 100%;
}

.dashboard-welcome-title {
  font-size: var(--font-size-3xl);
  font-weight: 700;
  letter-spacing: -0.025em;
}

.dashboard-welcome-subtitle {
  font-size: var(--font-size-lg);
  color: var(--color-text-muted);
  max-width: 500px;
  margin: 0 auto;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  margin-bottom: var(--space-3xl);
}

.dashboard-card {
  background: var(--color-bg-light);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  text-align: center;
  transition: all var(--transition-base);
}

.dashboard-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.dashboard-card-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto var(--space-md);
  background: var(--gradient-primary);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.dashboard-card-icon svg {
  width: 20px;
  height: 20px;
  color: white;
}

.dashboard-card-title {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-xs);
}

.dashboard-card-value {
  font-size: var(--font-size-3xl);
  font-weight: 700;
  margin-bottom: var(--space-xs);
}

.dashboard-card-desc {
  font-size: var(--font-size-sm);
  color: var(--color-text-dim);
}

.dashboard-empty-state {
  text-align: center;
  padding: var(--space-3xl) var(--space-xl);
  background: var(--color-bg-light);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-xl);
}

.dashboard-empty-globe {
  width: 80px;
  height: 80px;
  margin: 0 auto var(--space-xl);
  color: var(--color-text-dim);
  opacity: 0.4;
}

.dashboard-empty-globe svg {
  width: 100%;
  height: 100%;
}

.dashboard-empty-title {
  font-size: var(--font-size-xl);
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.dashboard-empty-text {
  font-size: var(--font-size-base);
  color: var(--color-text-muted);
  max-width: 420px;
  margin: 0 auto var(--space-xl);
  line-height: 1.7;
}

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

/* ==================== Avatar Dropdown ==================== */
.avatar-wrapper {
  position: relative;
}

.avatar-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: none;
  background: var(--gradient-primary);
  color: white;
  font-size: var(--font-size-sm);
  font-weight: 700;
  font-family: var(--font-sans);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  letter-spacing: 0.025em;
}

.avatar-btn:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-glow);
}

.avatar-dropdown {
  position: absolute;
  top: calc(100% + var(--space-sm));
  left: 0;
  min-width: 180px;
  background: var(--color-bg-light);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  z-index: 200;
}

.avatar-dropdown.hidden {
  display: none;
}

.avatar-dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  transition: all var(--transition-fast);
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
}

.avatar-dropdown-item:hover {
  background: var(--color-bg-lighter);
  color: var(--color-text);
}

.avatar-dropdown-item svg {
  flex-shrink: 0;
}

/* ==================== Profile Page ==================== */
.profile-page {
  max-width: 600px;
  margin: 0 auto;
}

.profile-header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.profile-avatar-large {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
  color: white;
  font-size: var(--font-size-2xl);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-lg);
  letter-spacing: 0.025em;
}

.profile-name {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: var(--space-xs);
}

.profile-email {
  font-size: var(--font-size-base);
  color: var(--color-text-muted);
}

.profile-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.profile-section {
  background: var(--color-bg-light);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
}

.profile-section-title {
  font-size: var(--font-size-lg);
  font-weight: 600;
  margin-bottom: var(--space-lg);
}

.profile-section-desc {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-lg);
  line-height: 1.6;
}

.profile-actions {
  display: flex;
  gap: var(--space-md);
  align-items: center;
}

/* ==================== Responsive Design ==================== */
@media (max-width: 768px) {
  .nav {
    flex-wrap: wrap;
    gap: var(--space-md);
  }
  
  .nav-links {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .hero-content {
    padding: var(--space-2xl) var(--space-lg);
    text-align: center;
  }
  
  .hero-cta {
    justify-content: center;
  }
  
  .hero-visual {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: var(--space-xl);
    padding-bottom: var(--space-4xl);
    min-height: 380px;
  }
  
  .globe-container {
    width: 260px;
    height: 260px;
  }
  
  .globe-3d {
    min-height: 260px;
  }
  
  /* Mobile modal styles */
  .globe-modal {
    padding: var(--space-lg);
    align-items: center;
    justify-content: center;
  }
  
  .globe-modal-content {
    max-width: 340px;
    width: calc(100% - var(--space-xl));
    padding: var(--space-lg);
  }
  
  .globe-modal-image {
    padding: var(--space-lg);
  }
  
  .globe-modal-image-icon {
    width: 36px;
    height: 36px;
  }
  
  .globe-modal-title {
    font-size: var(--font-size-lg);
  }
  
  .globe-ring:nth-child(1) {
    width: 300px;
    height: 300px;
    margin: -150px 0 0 -150px;
  }
  
  .globe-ring:nth-child(2) {
    width: 260px;
    height: 260px;
    margin: -130px 0 0 -130px;
  }
  
  .globe-ring:nth-child(3) {
    width: 220px;
    height: 220px;
    margin: -110px 0 0 -110px;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
  }
  
  .features-grid-mobile {
    grid-template-columns: 1fr;
  }
  
  .steps {
    flex-direction: column;
    align-items: center;
  }
  
  .step-connector {
    width: 2px;
    height: 40px;
    margin: 0;
  }
  
  /* Auth responsive */
  .auth-card {
    padding: var(--space-xl);
  }
  
  /* Dashboard responsive */
  .dashboard-topbar {
    padding: var(--space-sm) var(--space-md);
  }
  
  .dashboard-main {
    padding: var(--space-xl) var(--space-md);
  }
  
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  
  .dashboard-welcome-title {
    font-size: var(--font-size-2xl);
  }
  
  /* Avatar dropdown responsive */
  .avatar-btn {
    width: 36px;
    height: 36px;
    font-size: 0.75rem;
  }
  
  /* Profile responsive */
  .profile-avatar-large {
    width: 64px;
    height: 64px;
    font-size: var(--font-size-xl);
  }
  
  .profile-name {
    font-size: var(--font-size-xl);
  }
  
  .profile-actions {
    flex-direction: column;
  }
  
  .profile-actions .btn {
    width: 100%;
  }
}

/* ==================== Photo Upload Section ==================== */
.photos-section {
  margin-top: var(--space-3xl);
}

.photos-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-xl);
}

.photos-section-title {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  letter-spacing: -0.025em;
}

.photos-section-count {
  font-size: var(--font-size-sm);
  color: var(--color-text-dim);
  margin-left: var(--space-sm);
  font-weight: 400;
}

/* Upload Drop Zone */
.upload-zone {
  position: relative;
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-3xl) var(--space-xl);
  text-align: center;
  background: var(--color-bg-light);
  transition: all var(--transition-base);
  cursor: pointer;
  margin-bottom: var(--space-2xl);
}

.upload-zone:hover {
  border-color: var(--color-primary);
  background: rgba(59, 130, 246, 0.03);
}

.upload-zone.upload-zone--dragover {
  border-color: var(--color-primary);
  background: rgba(59, 130, 246, 0.08);
  box-shadow: inset 0 0 30px rgba(59, 130, 246, 0.06), var(--shadow-glow);
  transform: scale(1.005);
}

.upload-zone-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto var(--space-lg);
  color: var(--color-text-dim);
  transition: color var(--transition-base);
}

.upload-zone:hover .upload-zone-icon,
.upload-zone--dragover .upload-zone-icon {
  color: var(--color-primary);
}

.upload-zone-icon svg {
  width: 100%;
  height: 100%;
}

.upload-zone-title {
  font-size: var(--font-size-lg);
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.upload-zone-text {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-lg);
  line-height: 1.6;
}

.upload-zone-text strong {
  color: var(--color-primary-light);
  font-weight: 600;
}

.upload-zone-browse {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
}

.upload-zone-formats {
  font-size: 0.75rem;
  color: var(--color-text-dim);
  margin-top: var(--space-md);
  line-height: 1.5;
}

/* Hidden file input */
.upload-zone input[type="file"] {
  display: none;
}

/* Upload Queue */
.upload-queue {
  margin-bottom: var(--space-2xl);
}

.upload-queue-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
}

.upload-queue-title {
  font-size: var(--font-size-base);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.upload-queue-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 var(--space-xs);
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--gradient-primary);
  color: white;
  border-radius: var(--radius-full);
}

.upload-queue-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

/* Individual Upload Item */
.upload-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--color-bg-light);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: all var(--transition-fast);
}

.upload-item--success {
  border-color: rgba(16, 185, 129, 0.3);
}

.upload-item--error {
  border-color: rgba(239, 68, 68, 0.3);
}

.upload-item-preview {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.upload-item-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-item-preview svg {
  width: 20px;
  height: 20px;
  color: var(--color-text-dim);
}

.upload-item-info {
  flex: 1;
  min-width: 0;
}

.upload-item-name {
  font-size: var(--font-size-sm);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upload-item-meta {
  font-size: 0.75rem;
  color: var(--color-text-dim);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: 2px;
}

.upload-item-status {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  flex-shrink: 0;
}

.upload-item-status-icon {
  width: 18px;
  height: 18px;
}

.upload-item-status-icon--success {
  color: #10b981;
}

.upload-item-status-icon--error {
  color: #ef4444;
}

.upload-item-remove {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--color-text-dim);
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.upload-item-remove:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}

.upload-item-remove svg {
  width: 14px;
  height: 14px;
}

/* Upload Progress Bar */
.upload-progress {
  width: 100%;
  height: 4px;
  background: var(--color-bg-lighter);
  border-radius: var(--radius-full);
  margin-top: var(--space-xs);
  overflow: hidden;
}

.upload-progress-bar {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  transition: width var(--transition-fast);
  width: 0%;
}

.upload-progress-bar--success {
  background: #10b981;
}

.upload-progress-bar--error {
  background: #ef4444;
}

/* Upload Actions */
.upload-actions {
  display: flex;
  gap: var(--space-md);
  align-items: center;
}

.upload-actions-primary {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
}

.upload-actions-separator {
  width: 1px;
  height: 24px;
  background: var(--color-border);
  flex-shrink: 0;
}

/* Per-item action buttons (retry + remove) */
.upload-item-actions {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  flex-shrink: 0;
}

.upload-item-retry {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--color-text-dim);
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.upload-item-retry:hover {
  background: rgba(99, 102, 241, 0.15);
  color: var(--color-primary);
}

.upload-item-retry svg {
  width: 14px;
  height: 14px;
}

/* Spinner for uploading state */
.upload-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* ==================== Photos Grid ==================== */
/* ---- Photo Library Section ---- */
.photo-library-section {
  margin-top: var(--space-3xl);
}

.photo-library-title {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  letter-spacing: -0.025em;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.photo-library-title svg {
  color: var(--color-primary);
  flex-shrink: 0;
}

.photo-library-count {
  font-size: var(--font-size-sm);
  color: var(--color-text-dim);
  font-weight: 400;
}

/* ---- Photo Grid ---- */
.photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-lg);
}

.photo-card {
  background: var(--color-bg-light);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
}

.photo-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
}

.photo-card-image {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--color-bg);
}

.photo-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-dim);
}

.photo-card-placeholder svg {
  width: 48px;
  height: 48px;
}

.photo-card-body {
  padding: var(--space-md);
  flex: 1;
  min-width: 0;
}

.photo-card-name {
  font-size: var(--font-size-sm);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.photo-card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--color-text-dim);
  margin-top: var(--space-xs);
}

.photo-card-actions {
  display: flex;
  border-top: 1px solid var(--color-border);
}

.photo-action-btn {
  flex: 1;
  height: 40px;
  border: none;
  background: transparent;
  color: var(--color-text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  text-decoration: none;
  min-width: 60px;
}

.photo-action-btn svg {
  width: 16px;
  height: 16px;
}

.photo-action-btn--download:hover {
  background: rgba(59, 130, 246, 0.1);
  color: var(--color-primary);
}

.photo-action-btn--delete:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
}

/* EXIF metadata badges on photo cards */
.photo-card-exif {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: var(--space-xs);
}

.photo-card-exif-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.65rem;
  color: var(--color-text-dim);
  background: var(--color-bg);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.photo-card-exif-item svg {
  flex-shrink: 0;
}

/* Clickable photo card image */
.photo-card-image[role="button"] {
  cursor: pointer;
  position: relative;
}

.photo-card-image[role="button"]::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background var(--transition-fast);
  pointer-events: none;
}

.photo-card-image[role="button"]:hover::after {
  background: rgba(0, 0, 0, 0.15);
}

.photo-card-image[role="button"]:hover {
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
}

/* ==================== Photo Preview Dialog ==================== */
.photo-preview-dialog {
  border: none;
  background: transparent;
  padding: 0;
  max-width: 90vw;
  max-height: 90vh;
  overflow: visible;
  margin: auto;
  position: fixed;
  inset: 0;
}

.photo-preview-dialog::backdrop {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
}

.photo-preview-dialog-content {
  display: flex;
  background: var(--color-bg-light);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl), var(--shadow-glow);
  overflow: hidden;
  max-height: 85vh;
  max-width: 1100px;
  position: relative;
}

.photo-preview-close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(15, 23, 42, 0.7);
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  transition: all var(--transition-fast);
  z-index: 10;
}

.photo-preview-close:hover {
  background: var(--color-primary);
  color: white;
}

.photo-preview-close svg {
  width: 16px;
  height: 16px;
}

/* Image container */
.photo-preview-image-container {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  max-height: 85vh;
  overflow: hidden;
}

.photo-preview-image {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  display: block;
}

/* Info sidebar */
.photo-preview-info {
  width: 280px;
  flex-shrink: 0;
  padding: var(--space-xl);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  border-left: 1px solid var(--color-border);
}

.photo-preview-filename {
  font-size: var(--font-size-base);
  font-weight: 600;
  word-break: break-word;
  line-height: 1.4;
}

/* Meta grid */
.photo-preview-meta-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.photo-preview-meta-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  line-height: 1.4;
}

.photo-preview-meta-item svg {
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--color-text-dim);
}

.photo-preview-meta-item span {
  word-break: break-word;
}

/* Actions in dialog */
.photo-preview-actions {
  margin-top: auto;
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
}

.photo-preview-actions .btn {
  width: 100%;
  gap: var(--space-sm);
}

/* ==================== Storage Usage Bar ==================== */
.storage-bar {
  margin-bottom: var(--space-xl);
}

.storage-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-sm);
}

.storage-bar-label {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text);
}

.storage-bar-usage {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.storage-bar-track {
  width: 100%;
  height: 8px;
  background: var(--color-bg-lighter);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.storage-bar-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  transition: width var(--transition-base);
  min-width: 0;
}

.storage-bar-fill--warning {
  background: #f59e0b;
}

.storage-bar-fill--danger {
  background: #ef4444;
}

.storage-bar-warning {
  font-size: 0.75rem;
  color: #f59e0b;
  margin-top: var(--space-xs);
}

.storage-bar-danger {
  font-size: 0.75rem;
  color: #ef4444;
  margin-top: var(--space-xs);
}

/* ==================== Upload Zone Limit Overlay ==================== */
.upload-zone-wrapper {
  position: relative;
  margin-bottom: var(--space-2xl);
}

.upload-zone-wrapper .upload-zone {
  margin-bottom: 0;
}

.upload-zone-limit-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
}

.upload-zone-limit-text {
  color: #fca5a5;
  font-size: var(--font-size-base);
  font-weight: 600;
  text-align: center;
  line-height: 1.6;
}

.upload-zone--disabled {
  pointer-events: none;
  opacity: 0.5;
}

/* Hidden utility */
.hidden {
  display: none !important;
}

/* Empty photos state */
.photos-empty {
  text-align: center;
  padding: var(--space-2xl) var(--space-xl);
  color: var(--color-text-dim);
  font-size: var(--font-size-sm);
}

/* ==================== Photo Upload Responsive ==================== */
@media (max-width: 768px) {
  .photos-section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-md);
  }

  .upload-zone {
    padding: var(--space-2xl) var(--space-md);
  }

  .upload-zone-icon {
    width: 44px;
    height: 44px;
  }

  /* Switch to 2-column grid on mobile */
  .photos-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
  }

  .upload-item {
    flex-wrap: wrap;
  }

  .upload-queue-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }

  .upload-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  /* Photo preview dialog - stack vertically on mobile */
  .photo-preview-dialog {
    max-width: 95vw;
    max-height: 95vh;
  }

  .photo-preview-dialog-content {
    flex-direction: column;
    max-height: 90vh;
  }

  .photo-preview-image-container {
    max-height: 50vh;
  }

  .photo-preview-image {
    max-height: 50vh;
  }

  .photo-preview-info {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--color-border);
    padding: var(--space-md);
    max-height: 40vh;
    overflow-y: auto;
  }
}

/* ==================== Dashboard Globe Section ==================== */
.dashboard-globe-section {
  position: relative;
  margin-bottom: var(--space-2xl);
  background: var(--color-bg-light);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  min-height: 400px;
}

.dashboard-globe-section .dashboard-globe {
  min-height: 400px;
  width: 100%;
  height: 100%;
}

.dashboard-globe-section .dashboard-globe canvas {
  border-radius: var(--radius-xl);
}

.globe-stat-overlay {
  position: absolute;
  bottom: var(--space-lg);
  left: var(--space-lg);
  display: flex;
  gap: var(--space-md);
  z-index: 10;
  pointer-events: none;
}

.globe-stat {
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--radius-lg);
  padding: var(--space-sm) var(--space-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 72px;
}

.globe-stat-value {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
}

.globe-stat-label {
  font-size: 0.65rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

/* ==================== Activity Timeline Card ==================== */
.activity-timeline-card {
  background: var(--color-bg-light);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  margin-bottom: var(--space-2xl);
}

.activity-timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.activity-timeline-title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--color-text);
}

.activity-timeline-title svg {
  color: var(--color-primary);
}

.activity-year-selector {
  display: flex;
  gap: var(--space-xs);
}

.activity-year-btn {
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.75rem;
  font-weight: 500;
  font-family: var(--font-sans);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.activity-year-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-text);
}

.activity-year-btn.active {
  background: var(--gradient-primary);
  border-color: transparent;
  color: white;
}

.activity-grid-wrapper {
  overflow-x: auto;
  padding-bottom: var(--space-sm);
}

.activity-grid-container {
  display: flex;
  gap: 0;
}

.activity-grid-days {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 2px 8px 2px 0;
  min-width: 28px;
}

.activity-grid-days span {
  font-size: 0.6rem;
  color: var(--color-text-dim);
  height: 13px;
  line-height: 13px;
}

.activity-grid {
  display: flex;
  gap: 3px;
}

.activity-grid-week {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.activity-grid-cell {
  width: 13px;
  height: 13px;
  border-radius: 2px;
  background: var(--color-bg);
  transition: background var(--transition-fast);
}

.activity-grid-cell--outside {
  opacity: 0.3;
}

.activity-grid-cell[data-level="0"] {
  background: var(--color-bg);
}

.activity-grid-cell[data-level="1"] {
  background: rgba(59, 130, 246, 0.25);
}

.activity-grid-cell[data-level="2"] {
  background: rgba(59, 130, 246, 0.5);
}

.activity-grid-cell[data-level="3"] {
  background: rgba(59, 130, 246, 0.75);
}

.activity-grid-cell[data-level="4"] {
  background: var(--color-primary);
}

.activity-grid-cell--clickable {
  cursor: pointer;
}

.activity-grid-cell--clickable:hover {
  outline: 2px solid var(--color-text);
  outline-offset: -1px;
  transform: scale(1.3);
  z-index: 1;
}

.activity-grid-months {
  margin-bottom: var(--space-xs);
}

.activity-month-label {
  font-size: 0.6rem;
  color: var(--color-text-dim);
}

.activity-grid-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: var(--space-sm);
}

.activity-legend-label {
  font-size: 0.6rem;
  color: var(--color-text-dim);
  margin: 0 2px;
}

.activity-legend-cell {
  width: 13px;
  height: 13px;
  border-radius: 2px;
}

.activity-legend-cell[data-level="0"] {
  background: var(--color-bg);
}

.activity-legend-cell[data-level="1"] {
  background: rgba(59, 130, 246, 0.25);
}

.activity-legend-cell[data-level="2"] {
  background: rgba(59, 130, 246, 0.5);
}

.activity-legend-cell[data-level="3"] {
  background: rgba(59, 130, 246, 0.75);
}

.activity-legend-cell[data-level="4"] {
  background: var(--color-primary);
}

/* ==================== Globe Photo Grid (inside modal) ==================== */
.globe-modal-body {
  max-height: 60vh;
  overflow-y: auto;
}

.globe-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--space-md);
}

.globe-photo-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.globe-photo-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.globe-photo-card.selected {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary);
}

.globe-photo-thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.globe-photo-placeholder {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-dim);
}

.globe-photo-placeholder svg {
  width: 32px;
  height: 32px;
}

.globe-photo-loading {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface);
}

.globe-photo-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.globe-photo-card--loaded .globe-photo-thumb {
  animation: photoFadeIn 0.25s ease-out;
}

@keyframes photoFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.globe-photo-name {
  display: block;
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.65rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.globe-modal-loading,
.globe-modal-error,
.globe-modal-empty,
.globe-modal-demo {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-3xl);
  color: var(--color-text-muted);
  text-align: center;
}

.globe-modal-demo-cta {
  margin-top: var(--space-lg);
  font-size: var(--text-sm);
}

.globe-modal-demo-cta a {
  color: var(--color-primary);
  text-decoration: underline;
}

.globe-modal-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-bottom: var(--space-md);
}

/* ==================== Photo Detail Modal ==================== */
.photo-detail-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-base), visibility var(--transition-base);
}

.photo-detail-modal.active {
  opacity: 1;
  visibility: visible;
}

.photo-detail-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
}

.photo-detail-dialog {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  background: var(--color-bg-light);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl), var(--shadow-glow);
  width: 90%;
  max-width: 900px;
  max-height: 85vh;
  overflow: hidden;
  transition: transform var(--transition-base);
}

.photo-detail-modal.active .photo-detail-dialog {
  transform: translate(-50%, -50%) scale(1);
}

.photo-detail-close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  transition: all var(--transition-fast);
  z-index: 10;
}

.photo-detail-close:hover {
  background: var(--color-primary);
  color: white;
}

.photo-detail-close svg {
  width: 16px;
  height: 16px;
}

.photo-detail-layout {
  display: flex;
  height: 100%;
  max-height: 85vh;
}

.photo-detail-preview {
  flex: 1;
  min-width: 0;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 300px;
}

.photo-detail-loading {
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-detail-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.photo-detail-image {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
}

.photo-detail-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: none;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
  transition: all var(--transition-fast);
  z-index: 10;
}

.photo-detail-nav:hover {
  background: var(--color-primary);
}

.photo-detail-nav svg {
  width: 20px;
  height: 20px;
}

.photo-detail-nav--prev {
  left: var(--space-md);
}

.photo-detail-nav--next {
  right: calc(280px + var(--space-md));
}

.photo-detail-counter {
  position: absolute;
  bottom: var(--space-md);
  left: calc((100% - 280px) / 2);
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-weight: 500;
  z-index: 10;
}

.photo-detail-sidebar {
  width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--color-border);
  max-height: 85vh;
  overflow: hidden;
}

.photo-detail-sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-xl);
  padding-bottom: var(--space-sm);
}

.photo-detail-filename {
  font-size: var(--font-size-base);
  font-weight: 600;
  word-break: break-word;
  margin-bottom: var(--space-lg);
  padding-right: var(--space-xl);
}

.photo-detail-meta-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.photo-detail-meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.photo-detail-meta-label {
  font-size: 0.65rem;
  color: var(--color-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.photo-detail-meta-value {
  font-size: var(--font-size-sm);
  color: var(--color-text);
  font-weight: 500;
}

.photo-detail-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  flex-shrink: 0;
  padding: var(--space-md) var(--space-xl);
  border-top: 1px solid var(--color-border);
}

.photo-detail-action {
  width: 100%;
  gap: var(--space-sm);
  text-decoration: none;
}

.photo-detail-action svg {
  flex-shrink: 0;
}

.photo-detail-action:disabled,
.photo-detail-action[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* Clickable photo cards */
.photo-card[role="button"] {
  cursor: pointer;
}

.photo-card[role="button"]:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ==================== Photo Detail Modal Responsive ==================== */
@media (max-width: 768px) {
  .photo-detail-dialog {
    width: 95%;
    max-height: 90vh;
  }

  .photo-detail-layout {
    flex-direction: column;
    max-height: 90vh;
  }

  .photo-detail-preview {
    min-height: 200px;
    max-height: 50vh;
  }

  .photo-detail-sidebar {
    width: 100%;
    max-height: 40vh;
    border-left: none;
    border-top: 1px solid var(--color-border);
  }

  .photo-detail-sidebar-content {
    padding: var(--space-md);
    padding-bottom: var(--space-sm);
  }

  .photo-detail-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
  }

  .photo-detail-nav--next {
    right: var(--space-md);
  }

  .photo-detail-counter {
    left: 50%;
  }

  .photo-detail-actions {
    flex-direction: row;
    padding: var(--space-sm) var(--space-md);
  }

  .photo-detail-action {
    flex: 1;
  }

  /* Globe section mobile */
  .dashboard-globe-section {
    min-height: 300px;
  }

  .dashboard-globe-section .dashboard-globe {
    min-height: 300px;
  }

  .globe-stat-overlay {
    bottom: var(--space-sm);
    left: var(--space-sm);
  }

  .globe-stat {
    padding: var(--space-xs) var(--space-sm);
    min-width: 60px;
  }

  .globe-stat-value {
    font-size: var(--font-size-base);
  }

  /* Activity grid mobile */
  .activity-timeline-card {
    padding: var(--space-md);
  }

  .activity-timeline-header {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Globe modal mobile */
  .globe-modal-content {
    max-width: 95%;
    width: 95%;
    max-height: 80vh;
    overflow-y: auto;
  }

  .globe-photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: var(--space-sm);
  }
}

/* ==================== Photo Filter Panel (DuckDB-WASM) ==================== */

/* Filter toggle button */
.photo-filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-md);
  font-size: var(--font-size-sm);
  font-weight: 500;
  font-family: var(--font-sans);
  color: var(--color-text-muted);
  background: var(--color-bg-light);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.photo-filter-toggle:hover {
  border-color: var(--color-primary);
  color: var(--color-text);
}

.photo-filter-toggle--active {
  background: rgba(59, 130, 246, 0.1);
  border-color: var(--color-primary);
  color: var(--color-primary-light);
}

.photo-filter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  font-size: 0.65rem;
  font-weight: 700;
  background: var(--color-primary);
  color: white;
  border-radius: var(--radius-full);
}

/* Photo library header */
.photo-library-header {
  display: flex;
  align-items: center;
  margin-bottom: var(--space-lg);
}

.photo-library-controls {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* ==================== Actions Dropdown ==================== */
.photo-actions-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.photo-actions-dropdown {
  position: absolute;
  top: calc(100% + var(--space-xs));
  right: 0;
  min-width: 220px;
  background: var(--color-bg-light);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  z-index: 200;
}

.photo-actions-dropdown.hidden {
  display: none;
}

.photo-actions-dropdown-header {
  padding: var(--space-sm) var(--space-md);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
}

.photo-actions-dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  transition: all var(--transition-fast);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  font-family: var(--font-sans);
}

.photo-actions-dropdown-item:hover {
  background: var(--color-bg-lighter);
  color: var(--color-text);
}

.photo-actions-dropdown-item svg {
  flex-shrink: 0;
}

.photo-actions-dropdown-item--danger {
  color: #f87171;
}

.photo-actions-dropdown-item--danger:hover {
  background: rgba(248, 113, 113, 0.1);
  color: #ef4444;
}

.photo-actions-dropdown-divider {
  height: 1px;
  background: var(--color-border);
  margin: var(--space-xs) 0;
}

/* ==================== Bulk Action Modals ==================== */
.photo-actions-modal-desc {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-md);
  line-height: 1.5;
}

.photo-actions-confirm-content {
  max-width: 440px;
}

.photo-actions-confirm-title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: #f87171;
}

.photo-actions-confirm-title svg {
  flex-shrink: 0;
  stroke: #f87171;
}

.photo-actions-confirm-msg {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  line-height: 1.6;
  margin-bottom: var(--space-md);
}

.btn-danger {
  background: #ef4444;
  color: white;
  border: none;
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: var(--font-size-sm);
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-danger:hover {
  background: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Filter panel - collapsible */
.photo-filter-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, margin 0.35s ease, opacity 0.25s ease;
  opacity: 0;
  margin-bottom: 0;
}

.photo-filter-panel--open {
  max-height: 1200px;
  opacity: 1;
  margin-bottom: var(--space-lg);
  overflow: visible;
}

.photo-filter-panel-inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  background: var(--color-bg-light);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}

.photo-filter-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.photo-filter-group--wide {
  grid-column: span 2;
}

.photo-filter-group--actions {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
}

.photo-filter-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.photo-filter-row {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.photo-filter-row--location {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-xs);
}

.photo-filter-location-search {
  position: relative;
}

.photo-filter-location-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--color-bg);
  border: 1px solid var(--color-primary, #6366f1);
  border-radius: var(--radius-sm);
  max-height: 240px;
  overflow-y: auto;
  margin-top: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.photo-filter-location-results:empty {
  display: none;
}

.photo-filter-location-result-item {
  display: block;
  width: 100%;
  padding: 10px 12px;
  font-size: var(--font-size-sm);
  color: var(--color-text);
  background: var(--color-bg);
  border: none;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  cursor: pointer;
  font-family: var(--font-sans);
  line-height: 1.4;
}

.photo-filter-location-result-item:last-child {
  border-bottom: none;
}

.photo-filter-location-result-item:hover {
  background: var(--color-bg-light);
}

.photo-filter-location-no-results {
  padding: 10px 12px;
  font-size: var(--font-size-sm);
  color: var(--color-text-dim);
  background: var(--color-bg);
}

.photo-filter-location-selected {
  margin-top: var(--space-xs);
}

.photo-filter-location-selected:empty {
  display: none;
}

.photo-filter-location-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  font-size: var(--font-size-sm);
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  line-height: 1;
}

.photo-filter-location-badge svg {
  color: var(--color-primary);
  flex-shrink: 0;
}

.photo-filter-location-clear {
  background: none;
  border: none;
  color: var(--color-text-dim);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 2px;
  margin-left: 2px;
}

.photo-filter-location-clear:hover {
  color: var(--color-text);
}

.photo-filter-separator {
  font-size: 0.75rem;
  color: var(--color-text-dim);
  flex-shrink: 0;
}

.photo-filter-input {
  width: 100%;
  padding: 6px 8px;
  font-size: var(--font-size-sm);
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--transition-fast);
}

.photo-filter-input:focus {
  border-color: var(--color-primary);
}

.photo-filter-input::placeholder {
  color: var(--color-text-dim);
}

.photo-filter-select {
  width: 100%;
  padding: 6px 8px;
  font-size: var(--font-size-sm);
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition-fast);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%2364748b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 28px;
}

.photo-filter-select:focus {
  border-color: var(--color-primary);
}

/* Sort controls */
.photo-sort-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.photo-sort-controls-left {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.photo-sort-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-dim);
  flex-shrink: 0;
}

.photo-sort-field {
  width: auto;
  min-width: 120px;
}

.photo-sort-direction-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--color-border);
  background: var(--color-bg-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  transition: all var(--transition-fast);
  padding: 0;
  flex-shrink: 0;
}

.photo-sort-direction-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary-light);
}

.photo-sort-direction-btn svg {
  transition: transform 0.2s ease;
}

/* Loading overlay */
.photo-filter-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  background: var(--color-bg-light);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.photo-filter-loading.hidden {
  display: none !important;
}

.photo-filter-loading-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

.photo-filter-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.photo-filter-loading-text {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

/* Error state */
.photo-filter-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  color: #fca5a5;
  text-align: center;
}

.photo-filter-error p {
  font-size: var(--font-size-sm);
  max-width: 300px;
}

/* No results state */
.photo-filter-no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-3xl) var(--space-xl);
  color: var(--color-text-dim);
  text-align: center;
}

.photo-filter-no-results svg {
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

.photo-filter-no-results-title {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: var(--space-xs);
}

.photo-filter-no-results-text {
  font-size: var(--font-size-sm);
  color: var(--color-text-dim);
}

/* Virtual scroll container */
.photo-virtual-scroll {
  height: 680px;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  border-radius: var(--radius-lg);
}

.photo-virtual-scroll-content {
  position: relative;
  width: 100%;
}

.photo-virtual-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-lg);
  position: absolute;
  left: 0;
  right: 0;
  will-change: transform;
}

/* Fixed card height inside virtual scroll prevents jitter from variable content */
.photo-virtual-cards .photo-card {
  height: 280px;
  contain: layout style;
}

.photo-virtual-cards .photo-card-body {
  min-height: 0;
  overflow: hidden;
}

/* Thumbnail placeholder with spinner */
.photo-card-placeholder--loading {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
}

.photo-card-thumb-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.photo-card-thumb-loaded {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  animation: photoFadeIn 0.25s ease-out;
}

/* ==================== Manual Selection Mode ==================== */

/* Checkbox overlay on each photo card */
.photo-card-select {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.45);
  cursor: pointer;
  transition: background 0.15s ease;
}

.photo-card-select:hover {
  background: rgba(0, 0, 0, 0.65);
}

.photo-card-select-checkbox {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--color-primary);
}

/* Visual highlight on selected cards */
.photo-card--selected {
  box-shadow: 0 0 0 2px var(--color-primary);
  border-radius: var(--radius-sm);
}

.photo-card--selected .photo-card-image {
  opacity: 0.85;
}

/* Selection bar between sort controls and virtual scroll */
.photo-selection-bar {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-xs) var(--space-sm);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-sm);
}

.photo-selection-count {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text);
  min-width: 80px;
}

.photo-selection-actions {
  display: flex;
  gap: var(--space-xs);
}

.photo-selection-actions button {
  font-size: 0.75rem;
  padding: 2px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.photo-selection-actions button:hover {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

/* Filter panel toggle label for selection mode */
.photo-filter-checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
}

.photo-filter-checkbox-label input[type="checkbox"] {
  accent-color: var(--color-primary);
}

/* Hint text below the selection toggle */
.photo-filter-hint {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* ==================== Dual-Range Slider ==================== */
.dual-range {
  width: 100%;
}

.dual-range-values {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.dual-range-value {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

.dual-range-track {
  position: relative;
  height: 28px;
  display: flex;
  align-items: center;
}

.dual-range-fill {
  position: absolute;
  height: 4px;
  background: var(--color-primary);
  border-radius: 2px;
  pointer-events: none;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
}

.dual-range-input {
  position: absolute;
  width: 100%;
  height: 4px;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
  padding: 0;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  pointer-events: none;
  outline: none;
  z-index: 2;
}

/* Track — invisible since we draw our own fill */
.dual-range-input::-webkit-slider-runnable-track {
  height: 4px;
  background: transparent;
  border-radius: 2px;
}

.dual-range-input::-moz-range-track {
  height: 4px;
  background: transparent;
  border: none;
  border-radius: 2px;
}

/* Base track (drawn only on the first input so it's behind everything) */
.dual-range-input:first-of-type::-webkit-slider-runnable-track {
  background: var(--color-bg-lighter);
}

.dual-range-input:first-of-type::-moz-range-track {
  background: var(--color-bg-lighter);
}

/* Thumbs */
.dual-range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 2px solid var(--color-bg-light);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  z-index: 3;
  margin-top: -6px;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.dual-range-input::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 2px solid var(--color-bg-light);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  z-index: 3;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.dual-range-input::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2), 0 1px 4px rgba(0, 0, 0, 0.3);
}

.dual-range-input::-moz-range-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2), 0 1px 4px rgba(0, 0, 0, 0.3);
}

.dual-range-input:active::-webkit-slider-thumb {
  transform: scale(1.3);
  box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.25), 0 1px 4px rgba(0, 0, 0, 0.3);
}

.dual-range-input:active::-moz-range-thumb {
  transform: scale(1.3);
  box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.25), 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* Mobile touch targets — larger thumbs for 44px touch area */
@media (max-width: 768px) {
  .dual-range-track {
    height: 44px;
  }

  .dual-range-input::-webkit-slider-thumb {
    width: 22px;
    height: 22px;
    margin-top: -9px;
  }

  .dual-range-input::-moz-range-thumb {
    width: 22px;
    height: 22px;
  }
}

/* ==================== Photo Filter Responsive ==================== */
@media (max-width: 900px) {
  .photo-filter-panel-inner {
    grid-template-columns: repeat(2, 1fr);
  }

  .photo-filter-group--wide {
    grid-column: span 2;
  }

  .photo-virtual-cards {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}

@media (max-width: 600px) {
  .photo-filter-panel-inner {
    grid-template-columns: 1fr;
  }

  .photo-filter-group--wide {
    grid-column: span 1;
  }

  .photo-filter-row--location {
    grid-template-columns: 1fr;
  }

  .photo-virtual-scroll {
    height: 500px;
  }

  .photo-virtual-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
  }

  .photo-library-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }

  .photo-sort-controls {
    flex-wrap: wrap;
  }

  .photo-library-controls {
    width: 100%;
  }

  .photo-filter-toggle {
    flex: 1;
    justify-content: center;
  }
}

/* ==================== Dashboard Tabs Responsive ==================== */
@media (max-width: 480px) {
  .dashboard-tab {
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-size-sm);
    gap: var(--space-xs);
  }

  .dashboard-tab svg {
    width: 16px;
    height: 16px;
  }

  .collections-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--space-md);
  }

  .collection-card {
    padding: var(--space-lg) var(--space-md);
  }
}

/* ==================== Collection Settings Panel ==================== */

.globe-modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-md);
  margin-top: var(--space-md);
  border-top: 1px solid var(--color-border);
}

.globe-modal-footer-btn {
  height: 36px;
  padding: 0 var(--space-lg);
  border: none;
  background: var(--color-bg-lighter);
  border-radius: var(--radius-full);
  cursor: pointer;
  color: var(--color-text-muted);
  font-size: var(--font-sm);
  font-weight: 500;
  transition: all var(--transition-fast);
}

.globe-modal-footer-btn:hover {
  background: var(--color-primary);
  color: white;
}

.collection-settings-panel {
  border-bottom: 1px solid var(--color-border);
  padding-bottom: var(--space-lg);
  margin-bottom: var(--space-md);
}

.collection-settings-error {
  font-size: var(--font-size-sm);
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-md);
}

.collection-settings-section {
  margin-bottom: var(--space-lg);
}

.collection-settings-section:last-child {
  margin-bottom: 0;
}

.collection-settings-heading {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--color-border);
}

.collection-settings-danger .collection-settings-heading {
  color: #ef4444;
  border-bottom-color: rgba(239, 68, 68, 0.2);
}

/* Delete Collection */
.collection-delete-description {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
}

.collection-delete-section {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.collection-delete-form {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex: 1;
  min-width: 0;
}

.collection-delete-confirm-input {
  flex: 1;
  padding: 6px 10px;
  font-size: var(--font-size-sm);
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color var(--transition-fast);
}

.collection-delete-confirm-input:focus {
  border-color: #ef4444;
}

.collection-delete-confirm-input::placeholder {
  color: var(--color-text-muted);
  opacity: 0.6;
}

.collection-delete-btn {
  padding: 6px 16px;
  font-size: var(--font-size-sm);
  font-weight: 600;
  font-family: var(--font-sans);
  color: white;
  background: #ef4444;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
  white-space: nowrap;
}

.collection-delete-btn:hover:not(:disabled) {
  background: #dc2626;
}

.collection-delete-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ==================== Share Links ==================== */

.share-links-create-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 6px 14px;
  font-size: var(--font-size-sm);
  font-weight: 600;
  font-family: var(--font-sans);
  color: white;
  background: var(--color-primary);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
  margin-bottom: var(--space-md);
}

.share-links-create-btn:hover {
  background: var(--color-primary-dark);
}

.share-links-create-btn.hidden {
  display: none;
}

/* Share Link Form */
.share-links-form {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
}

.share-links-form.hidden {
  display: none;
}

.share-links-form-field {
  margin-bottom: var(--space-md);
}

.share-links-form-field:last-of-type {
  margin-bottom: var(--space-sm);
}

.share-links-form-field label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-xs);
}

.share-links-form-hint {
  font-weight: 400;
  color: var(--color-text-dim);
}

.share-links-form-input {
  width: 100%;
  padding: 8px 12px;
  font-size: var(--font-size-sm);
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg-light);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--transition-fast);
}

.share-links-form-input:focus {
  border-color: var(--color-primary);
}

select.share-links-form-input {
  cursor: pointer;
}

/* Toggle label for checkboxes */
.share-links-toggle-label {
  display: flex !important;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  font-weight: 500 !important;
}

.share-links-toggle-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.share-links-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.share-links-form-cancel {
  padding: 6px 14px;
  font-size: var(--font-size-sm);
  font-weight: 500;
  font-family: var(--font-sans);
  color: var(--color-text-muted);
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.share-links-form-cancel:hover {
  background: var(--color-bg-lighter);
  color: var(--color-text);
}

.share-links-form-submit {
  padding: 6px 14px;
  font-size: var(--font-size-sm);
  font-weight: 600;
  font-family: var(--font-sans);
  color: white;
  background: var(--color-primary);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.share-links-form-submit:hover:not(:disabled) {
  background: var(--color-primary-dark);
}

.share-links-form-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.share-links-form-error {
  font-size: var(--font-size-sm);
  color: #ef4444;
  padding: var(--space-xs) var(--space-sm);
  background: rgba(239, 68, 68, 0.08);
  border-radius: var(--radius-sm);
  margin-top: var(--space-sm);
}

.share-links-form-error.hidden {
  display: none;
}

/* Share Links Table */
.share-links-table-wrap {
  margin-top: var(--space-sm);
}

.share-links-empty,
.share-links-error {
  font-size: var(--font-size-sm);
  color: var(--color-text-dim);
  text-align: center;
  padding: var(--space-md) 0;
}

.share-links-loading {
  display: flex;
  justify-content: center;
  padding: var(--space-md) 0;
}

.share-links-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}

.share-links-table th {
  text-align: left;
  font-weight: 600;
  color: var(--color-text-muted);
  padding: var(--space-xs) var(--space-sm);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.share-links-table td {
  padding: var(--space-sm);
  border-bottom: 1px solid rgba(51, 65, 85, 0.3);
  color: var(--color-text);
  vertical-align: middle;
}

.share-link-row.share-link-expired td {
  opacity: 0.5;
}

.share-link-expired-badge {
  font-size: 0.7rem;
  padding: 1px 6px;
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.share-link-no {
  color: var(--color-text-dim);
}

.share-link-actions {
  display: flex;
  gap: var(--space-xs);
  white-space: nowrap;
}

.share-link-copy-btn,
.share-link-delete-btn {
  width: 30px;
  height: 30px;
  border: none;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  transition: all var(--transition-fast);
}

.share-link-copy-btn:hover {
  background: var(--color-primary);
  color: white;
}

.share-link-delete-btn:hover {
  background: #ef4444;
  color: white;
}

/* Copy-to-clipboard tooltip */
.copy-tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--color-text);
  color: var(--color-bg);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 10;
}

.copy-tooltip-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==================== Shared Collection — Password Page ==================== */

.shared-collection-body {
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
}

.shared-collection-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg) var(--space-xl);
  border-bottom: 1px solid var(--color-border);
}

.shared-collection-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-xl);
}

.shared-password-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}

.shared-password-card {
  background: var(--color-bg-light);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-xl);
}

.shared-password-icon {
  color: var(--color-primary-light);
  margin-bottom: var(--space-lg);
}

.shared-password-title {
  font-size: var(--font-size-xl);
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.shared-password-subtitle {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-xl);
}

.shared-password-error {
  font-size: var(--font-size-sm);
  color: #ef4444;
  padding: var(--space-sm) var(--space-md);
  background: rgba(239, 68, 68, 0.08);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-md);
}

.shared-password-form {
  text-align: left;
}

.shared-password-field {
  margin-bottom: var(--space-lg);
}

.shared-password-field label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 600;
  margin-bottom: var(--space-xs);
  color: var(--color-text);
}

.shared-password-input {
  width: 100%;
  padding: 10px 14px;
  font-size: var(--font-size-base);
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color var(--transition-fast);
}

.shared-password-input:focus {
  border-color: var(--color-primary);
}

.shared-password-submit {
  width: 100%;
  padding: 10px 20px;
  font-size: var(--font-size-base);
  font-weight: 600;
  font-family: var(--font-sans);
  color: white;
  background: var(--gradient-primary);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: opacity var(--transition-fast);
}

.shared-password-submit:hover {
  opacity: 0.9;
}

/* ==================== Shared Collection — Gallery Page ==================== */

.shared-gallery {
  width: 100%;
}

.shared-gallery-header {
  margin-bottom: var(--space-xl);
}

.shared-gallery-title {
  font-size: var(--font-size-3xl);
  font-weight: 700;
  margin-bottom: var(--space-xs);
}

.shared-gallery-description {
  font-size: var(--font-size-base);
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
}

.shared-gallery-actions {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.shared-gallery-count {
  font-size: var(--font-size-sm);
  color: var(--color-text-dim);
}

.shared-gallery-download-all {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 8px 16px;
  font-size: var(--font-size-sm);
  font-weight: 600;
  font-family: var(--font-sans);
  color: white;
  background: var(--color-primary);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.shared-gallery-download-all:hover {
  background: var(--color-primary-dark);
}

/* Gallery grid — reuses globe-photo-grid styles */
.shared-gallery-grid {
  min-height: 300px;
}

.shared-gallery-grid .globe-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-md);
}

/* ==================== Shared Detail Modal ==================== */

.shared-detail-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-base), visibility var(--transition-base);
}

.shared-detail-modal.active {
  opacity: 1;
  visibility: visible;
}

.shared-detail-content {
  display: flex;
  max-width: 1100px;
  width: 95%;
  max-height: 90vh;
  background: var(--color-bg-light);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  position: relative;
}

.shared-detail-close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  width: 40px;
  height: 40px;
  border: none;
  background: rgba(15, 23, 42, 0.7);
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  transition: all var(--transition-fast);
  z-index: 10;
}

.shared-detail-close:hover {
  background: var(--color-primary);
  color: white;
}

.shared-detail-close svg {
  width: 16px;
  height: 16px;
}

/* Navigation arrows */
.shared-detail-nav {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

.shared-detail-prev,
.shared-detail-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: none;
  background: rgba(15, 23, 42, 0.6);
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  transition: all var(--transition-fast);
  pointer-events: auto;
}

.shared-detail-prev {
  left: var(--space-md);
}

.shared-detail-next {
  right: var(--space-md);
}

.shared-detail-prev:hover,
.shared-detail-next:hover {
  background: var(--color-primary);
  color: white;
}

/* Image area */
.shared-detail-image-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  min-height: 400px;
  overflow: hidden;
}

.shared-detail-image {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
}

/* Info sidebar */
.shared-detail-info {
  width: 280px;
  flex-shrink: 0;
  padding: var(--space-xl);
  overflow-y: auto;
  border-left: 1px solid var(--color-border);
}

.shared-detail-filename {
  font-size: var(--font-size-base);
  font-weight: 600;
  word-break: break-all;
  margin-bottom: var(--space-lg);
}

.shared-detail-meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.shared-detail-meta-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-sm);
}

.shared-detail-meta-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.shared-detail-meta-value {
  font-size: var(--font-size-sm);
  color: var(--color-text);
  font-weight: 500;
  text-align: right;
}

.shared-detail-download {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 8px 16px;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: white;
  background: var(--color-primary);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition-fast);
  width: 100%;
  justify-content: center;
}

.shared-detail-download:hover {
  background: var(--color-primary-dark);
}

/* ==================== Shared Gallery Responsive ==================== */

@media (max-width: 768px) {
  .shared-collection-main {
    padding: var(--space-md);
  }

  .shared-gallery-title {
    font-size: var(--font-size-2xl);
  }

  .shared-gallery-grid .globe-photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  .shared-detail-content {
    flex-direction: column;
    max-height: 95vh;
  }

  .shared-detail-image-wrap {
    min-height: 250px;
  }

  .shared-detail-info {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--color-border);
    padding: var(--space-md);
  }

  .shared-detail-prev {
    left: var(--space-xs);
  }

  .shared-detail-next {
    right: var(--space-xs);
  }

  /* Settings panel responsive */
  .collection-delete-section {
    flex-direction: column;
    align-items: flex-start;
  }

  .collection-delete-form {
    flex-direction: column;
    width: 100%;
  }

  .collection-delete-confirm-input {
    width: 100%;
  }

  .collection-delete-btn {
    width: 100%;
  }

  .share-links-table {
    font-size: 0.75rem;
  }

  .share-links-table th,
  .share-links-table td {
    padding: var(--space-xs);
  }

  /* Collaborate responsive */
  .collaborate-code-row {
    flex-wrap: wrap;
  }

  .collaborate-member-row {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-xs);
  }

  .collaborate-member-actions {
    align-self: flex-end;
  }
}
