/* ====================================================================
   SKIN ANALYSIS APP - MODERN DERMATOLOGY UI/UX
   Inspired by ai-derm.com & cetaphil.com
   Design: Medical-grade, professional, premium
   ==================================================================== */

:root {
  /* Primary Dermatology Color Palette */
  --primary: #1E40AF;
  --primary-light: #3B82F6;
  --primary-dark: #1E3A8A;
  --secondary: #FF6B9D;
  --secondary-light: #FFB8D1;
  --accent: #6366F1;
  --accent-light: #A5B4FC;
  
  /* Medical Neutrals */
  --white: #FFFFFF;
  --off-white: #F8FAFB;
  --light-gray: #E8EEF2;
  --gray: #B8C5D0;
  --dark-gray: #5A6C7D;
  --charcoal: #2C3E50;
  --black: #1A202C;
  
  /* Semantic Colors */
  --success: #10B981;
  --warning: #F59E0B;
  --error: #EF4444;
  --info: #3B82F6;
  
  /* Background Gradients */
  --gradient-primary: linear-gradient(135deg, #1E40AF 0%, #3B82F6 100%);
  --gradient-secondary: linear-gradient(135deg, #FF6B9D 0%, #FFB8D1 100%);
  --gradient-hero: linear-gradient(135deg, #F8FAFB 0%, #EFF6FF 50%, #F8FAFB 100%);
  
  /* Shadows */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 2px 8px rgba(30, 64, 175, 0.08);
  --shadow-md: 0 4px 16px rgba(30, 64, 175, 0.12);
  --shadow-lg: 0 8px 32px rgba(30, 64, 175, 0.16);
  --shadow-xl: 0 20px 48px rgba(30, 64, 175, 0.2);
  
  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Poppins', 'Inter', sans-serif;
  
  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --spacing-2xl: 4rem;
  
  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ====================================================================
   RESET & BASE STYLES
   ==================================================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-primary);
  background: var(--off-white);
  color: var(--charcoal);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

/* ====================================================================
   TYPOGRAPHY
   ==================================================================== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--charcoal);
  margin-bottom: var(--spacing-sm);
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  letter-spacing: -0.01em;
}

h3 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

h4 {
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
}

p {
  margin-bottom: var(--spacing-sm);
  color: var(--dark-gray);
  line-height: 1.7;
}

.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ====================================================================
   HEADER & NAVIGATION
   ==================================================================== */

header {
  position: sticky;
  top: 0;
  background: var(--white);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
  z-index: 1000;
  transition: all var(--transition-base);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  transition: transform var(--transition-base);
}

.logo:hover {
  transform: scale(1.02);
}

.logo-icon {
  width: 48px;
  /* height: 48px; */
  /* background: var(--gradient-primary); */
  /* border-radius: var(--radius-md); */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  /* box-shadow: var(--shadow-md); */
}

nav {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

/* ====================================================================
   HERO SECTION
   ==================================================================== */

.hero {
  background: var(--gradient-hero);
  padding: var(--spacing-2xl) var(--spacing-md);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(79, 195, 211, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  animation: float 6s ease-in-out infinite;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -50%;
  left: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255, 107, 157, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  animation: float 8s ease-in-out infinite reverse;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0) translateX(0);
  }
  50% {
    transform: translateY(-20px) translateX(20px);
  }
}

.hero-content {
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero h1 {
  margin-bottom: var(--spacing-md);
}

.hero-subtitle {
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  color: var(--dark-gray);
  margin-bottom: var(--spacing-xl);
  line-height: 1.6;
}

.hero-badges {
  display: flex;
  justify-content: center;
  gap: var(--spacing-md);
  flex-wrap: wrap;
  margin-top: var(--spacing-xl);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--white);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--charcoal);
}

.badge-icon {
  font-size: 1.2rem;
}

/* ====================================================================
   STEPS SECTION
   ==================================================================== */

.steps-section {
  padding: var(--spacing-2xl) var(--spacing-md);
  max-width: 1200px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: var(--spacing-xl);
}

.section-subtitle {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--spacing-xs);
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-lg);
  margin-top: var(--spacing-xl);
}

.step-card {
  background: var(--white);
  padding: var(--spacing-lg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  text-align: center;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.step-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transition: transform var(--transition-base);
}

.step-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.step-card:hover::before {
  transform: scaleX(1);
}

.step-number {
  width: 60px;
  height: 60px;
  margin: 0 auto var(--spacing-md);
  background: var(--gradient-primary);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  box-shadow: var(--shadow-md);
}

.step-icon {
  font-size: 2.5rem;
  margin-bottom: var(--spacing-sm);
}

.step-card h3 {
  color: var(--charcoal);
  font-size: 1.25rem;
  margin-bottom: var(--spacing-sm);
}

.step-card p {
  color: var(--dark-gray);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ====================================================================
   BUTTONS
   ==================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: all var(--transition-base);
  cursor: pointer;
  border: none;
  outline: none;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: var(--gradient-primary);
  color: var(--white);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.btn-secondary {
  background: var(--white);
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-secondary:hover {
  background: var(--primary);
  color: var(--white);
}

.btn-large {
  padding: 1.25rem 2.5rem;
  font-size: 1.1rem;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* ====================================================================
   CARDS
   ==================================================================== */

.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-lg);
}

.card-header {
  margin-bottom: var(--spacing-md);
}

.card-title {
  font-size: 1.5rem;
  color: var(--charcoal);
  margin-bottom: var(--spacing-xs);
}

.card-subtitle {
  color: var(--dark-gray);
  font-size: 0.95rem;
}

/* ====================================================================
   FORMS
   ==================================================================== */

.form-group {
  margin-bottom: var(--spacing-md);
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--charcoal);
  font-size: 0.95rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid var(--light-gray);
  border-radius: var(--radius-md);
  font-size: 1rem;
  color: var(--charcoal);
  background: var(--white);
  transition: all var(--transition-base);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(0, 164, 184, 0.1);
}

.form-input::placeholder {
  color: var(--gray);
}

.form-error {
  color: var(--error);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.form-hint {
  color: var(--dark-gray);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* ====================================================================
   SUBSCRIPTION GATE
   ==================================================================== */

.subscription-gate {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(26, 32, 44, 0.9);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-md);
}

.subscription-modal {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: var(--spacing-xl);
  max-width: 500px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.subscription-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto var(--spacing-md);
  background: var(--gradient-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: var(--white);
}

.subscription-modal h2 {
  text-align: center;
  margin-bottom: var(--spacing-sm);
}

.subscription-modal p {
  text-align: center;
  margin-bottom: var(--spacing-lg);
}

.subscription-features {
  list-style: none;
  margin-bottom: var(--spacing-lg);
}

.subscription-features li {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) 0;
  color: var(--dark-gray);
}

.subscription-features li::before {
  content: '✓';
  width: 24px;
  height: 24px;
  background: var(--gradient-primary);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 700;
}

/* ====================================================================
   PHONE INPUT
   ==================================================================== */

.phone-input-group {
  position: relative;
}

.phone-prefix {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 600;
  color: var(--charcoal);
  pointer-events: none;
}

.phone-input {
  padding-left: 3rem;
}

/* ====================================================================
   OTP INPUT
   ==================================================================== */

.otp-input-group {
  display: flex;
  gap: var(--spacing-sm);
  justify-content: center;
  margin: var(--spacing-lg) 0;
}

.otp-input {
  width: 50px;
  height: 60px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  border: 2px solid var(--light-gray);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
}

.otp-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(0, 164, 184, 0.1);
}

/* ====================================================================
   LOADER
   ==================================================================== */

.loader {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid var(--light-gray);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ====================================================================
   ALERTS
   ==================================================================== */

.alert {
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-md);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert-success {
  background: #D1FAE5;
  color: #065F46;
  border-left: 4px solid var(--success);
}

.alert-error {
  background: #FEE2E2;
  color: #991B1B;
  border-left: 4px solid var(--error);
}

.alert-warning {
  background: #FEF3C7;
  color: #92400E;
  border-left: 4px solid var(--warning);
}

.alert-info {
  background: #DBEAFE;
  color: #1E40AF;
  border-left: 4px solid var(--info);
}

/* ====================================================================
   CONTAINER
   ==================================================================== */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

.section {
  padding: var(--spacing-2xl) 0;
}

/* ====================================================================
   UTILITY CLASSES
   ==================================================================== */

.text-center {
  text-align: center;
}

.text-primary {
  color: var(--primary);
}

.text-secondary {
  color: var(--dark-gray);
}

.hidden {
  display: none !important;
}

.mt-1 {
  margin-top: var(--spacing-sm);
}

.mt-2 {
  margin-top: var(--spacing-md);
}

.mb-1 {
  margin-bottom: var(--spacing-sm);
}

.mb-2 {
  margin-bottom: var(--spacing-md);
}

/* ====================================================================
   RESPONSIVE DESIGN - MOBILE FIRST
   ==================================================================== */

/* Small Mobile Devices - 320px to 480px */
@media (max-width: 480px) {
  /* Root font size adjustment for better mobile scaling */
  :root {
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 0.75rem;
    --spacing-lg: 1rem;
    --spacing-xl: 1.5rem;
    --spacing-2xl: 2rem;
  }

  /* Typography - fluid scaling */
  body {
    font-size: clamp(0.875rem, 2.5vw, 1rem);
  }

  h1 {
    font-size: clamp(1.5rem, 6vw, 2rem);
    line-height: 1.2;
  }

  h2 {
    font-size: clamp(1.25rem, 5vw, 1.75rem);
  }

  h3 {
    font-size: clamp(1.1rem, 4vw, 1.35rem);
  }

  h4 {
    font-size: clamp(1rem, 3.5vw, 1.15rem);
  }

  /* Header - compact mobile header */
  .header-content {
    padding: 0.75rem 1rem;
    gap: 0.5rem;
  }

  .logo {
    font-size: 1.1rem;
    gap: 0.5rem;
  }

  .logo-icon {
    width: 80% !important;
    /* height: 36px !important; */
    font-size: 1.25rem;
  }

  nav {
    gap: 0.5rem;
    font-size: 0.85rem;
  }

  /* Hero - mobile optimized */
  .hero {
    padding: 2rem 1rem;
  }

  .hero h1 {
    margin-bottom: 1rem;
  }

  .hero p {
    font-size: 1rem;
    margin-bottom: 1.5rem;
  }

  /* Buttons - touch-friendly sizing (min 44x44px) */
  .btn {
            padding: 10px;
        font-size: 10px;
        min-height: 44px;
        min-width: 76px;
    }

  .btn-large {
    padding: 1rem 1.75rem;
    font-size: 1rem;
    min-height: 48px;
  }

  /* Forms - full width inputs on mobile */
  .form-group {
    margin-bottom: 1rem;
  }

  .form-input,
  .form-select,
  .form-textarea {
    font-size: 1rem;
    min-height: 44px;
  }

  /* Cards - full width with reduced padding */
  .card {
    padding: 1rem;
    border-radius: var(--radius-md);
  }

  .card-title {
    font-size: 1.25rem;
  }

  /* Steps Grid - single column */
  .steps-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .step-card {
    padding: 1rem;
  }

  .step-number {
    width: 50px;
    height: 50px;
    font-size: 1.25rem;
  }

  .step-icon {
    font-size: 2rem;
  }

  /* Subscription Modal - full screen approach */
  .subscription-modal {
    padding: 1.5rem;
    max-width: calc(100vw - 2rem);
    margin: 1rem;
  }

  .subscription-icon {
    width: 60px;
    height: 60px;
    font-size: 2rem;
  }

  /* Container - mobile padding */
  .container {
    padding: 0 1rem;
  }

  .section {
    padding: 2rem 0;
  }

  /* Camera/Canvas - mobile optimized */
  #video-container,
  #canvas-container {
    min-height: 280px !important;
    margin-bottom: 1rem !important;
  }

  #video,
  #canvas {
    max-height: 400px;
  }

  #zoom-controls {
    bottom: 5px !important;
    right: 5px !important;
    gap: 0.25rem !important;
  }

  #zoom-controls button {
    padding: 0.5rem !important;
    font-size: 1rem !important;
    min-width: 44px;
    min-height: 44px;
  }

  /* Upload area - compact */
  #upload-area {
    padding: 2rem 0.5rem !important;
  }

  #upload-area > div:first-child {
    font-size: 3rem !important;
  }

  /* Image controls - stack on small mobile */
  #image-controls {
    flex-direction: column !important;
    gap: 0.75rem !important;
  }

  #image-controls .btn {
    width: 100%;
  }

  /* Tips section - single column on small mobile */
  .card ul[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 0.5rem;
  }

  /* Medical Disclaimer - compact */
  div[style*="border-left: 4px solid"] {
    padding: 1rem !important;
  }

  div[style*="border-left: 4px solid"] div[style*="display: flex"] {
    flex-direction: column;
    gap: 0.5rem !important;
  }
}

/* Mobile Devices - 481px to 768px */
@media (min-width: 481px) and (max-width: 768px) {
  /* Typography */
  body {
    font-size: 0.95rem;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.75rem;
  }

  /* Header */
  .header-content {
    padding: 1rem 1.5rem;
  }

  .logo {
    font-size: 1.3rem;
  }

  .logo-icon {
    width: 40px !important;
    height: 40px !important;
  }

  /* Hero */
  .hero {
    padding: 3rem 1.5rem;
  }

  /* Buttons - still touch-friendly */
  .btn {
    min-height: 44px;
    padding: 0.875rem 1.75rem;
  }

  .btn-large {
    padding: 1.125rem 2rem;
    min-height: 48px;
  }

  /* Steps Grid - 2 columns on larger phones */
  .steps-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
  }

  /* Cards */
  .card {
    padding: 1.5rem;
  }

  /* Camera/Canvas */
  #video-container,
  #canvas-container {
    min-height: 320px !important;
  }

  #video,
  #canvas {
    max-height: 480px;
  }

  /* Image controls - can be row on medium mobile */
  #image-controls {
    flex-direction: row !important;
    flex-wrap: wrap;
  }

  #image-controls .btn {
    flex: 1;
    min-width: 150px;
  }

  /* Tips - 2 columns */
  .card ul[style*="grid-template-columns"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Subscription Modal */
  .subscription-modal {
    padding: 2rem;
    max-width: 500px;
  }
}

/* Tablets - 769px to 1024px */
@media (min-width: 769px) and (max-width: 1024px) {
  /* Container */
  .container {
    max-width: 720px;
  }

  /* Header */
  .header-content {
    padding: 1.25rem 2rem;
  }

  /* Steps Grid - 2-3 columns */
  .steps-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  /* Camera/Canvas - optimal tablet size */
  #video-container,
  #canvas-container {
    max-width: 600px;
    margin: 0 auto 1rem !important;
  }
}

/* Landscape orientation optimization */
@media (max-width: 768px) and (orientation: landscape) {
  /* Reduce vertical spacing in landscape */
  .hero {
    padding: 1.5rem 1rem;
  }

  .section {
    padding: 1.5rem 0;
  }

  /* Camera/Canvas - wider in landscape */
  #video-container,
  #canvas-container {
    max-width: 70vw;
    min-height: 240px !important;
  }

  #video,
  #canvas {
    max-height: 60vh;
  }

  /* Stack controls horizontally in landscape */
  #image-controls {
    flex-direction: row !important;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  /* All touch targets minimum 44x44px */
  button,
  a,
  input[type="button"],
  input[type="submit"],
  label {
    min-height: 44px;
    min-width: 44px;
  }

  /* Larger tap areas for links */
  nav a {
    padding: 0.5rem;
  }

  /* Remove hover effects on touch devices */
  .btn:hover::before {
    display: none;
  }

  .card:hover {
    box-shadow: var(--shadow-md);
  }

  .step-card:hover {
    transform: none;
  }

  /* Better touch scrolling */
  body {
    -webkit-overflow-scrolling: touch;
  }
}

/* High DPI / Retina display optimization */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* Sharper borders and shadows */
  .card,
  .btn,
  .form-input {
    border-width: 1px;
  }
}

/* Accessibility - Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ====================================================================
   ANIMATIONS
   ==================================================================== */

.fade-in {
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.slide-up {
  animation: slideUp 0.5s ease-out;
}

/* ====================================================================
   FOOTER
   ==================================================================== */

footer {
  background: var(--charcoal);
  color: var(--white);
  padding: var(--spacing-xl) var(--spacing-md);
  text-align: center;
}

footer p {
  color: var(--gray);
  margin: 0;
  font-size: clamp(0.85rem, 2vw, 1rem);
}

footer a {
  color: var(--primary-light);
  text-decoration: none;
  transition: color var(--transition-base);
}

footer a:hover {
  color: var(--white);
}
