/* SkinRelief Analyzer - Modern Design System v2.1 Gradients */

/* Header styles */
.app-header {
  background: white;
  border-bottom: 1px solid #e5e7eb;
  padding: 23px 0;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.header-logo {
  height: 34px;
  max-width: 100%;
  object-fit: contain;
}

/* Mobile responsive header */
@media (max-width: 768px) {
  .header-logo {
    height: 24px;
  }
  
  .app-header {
    padding: 6px 0;
  }
}

/* Footer styles */
.app-footer {
  background: white;
  border-top: 1px solid #e5e7eb;
  padding: 12px 0;
  margin-top: auto;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: #9ca3af;
  text-align: center;
}

.footer-links a {
  color: #9ca3af;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: #6b7280;
  text-decoration: underline;
}

.footer-separator {
  margin: 0 6px;
  color: #9ca3af;
}

/* Import Inter font family */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* CSS Custom Properties - Design System */
:root {
  /* Color Palette */
  --primary-blue: #3A5FFF;
  --accent-green: #2ECC71;
  --background-light: #F9FAFB;
  --background-lighter: #F4F5F7;
  --text-primary: #1F2937;
  --text-secondary: #6B7280;
  --card-background: #FFFFFF;
  --border-light: #E5E7EB;
  --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-medium: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-large: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  
  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --line-height: 1.4;
  
  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  
  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;
}

/* Global Styles */
* {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  font-family: var(--font-family);
  line-height: var(--line-height);
  color: var(--text-primary);
  background-color: var(--background-light);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1;
}

/* Typography Hierarchy */
h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 var(--space-md);
  line-height: 1.2;
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 var(--space-lg);
  line-height: 1.3;
}

h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 var(--space-md);
  line-height: 1.3;
}

p {
  font-size: 1rem;
  color: var(--text-secondary);
  margin: 0 0 var(--space-md);
}

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

/* Cards */
.card {
  background: var(--card-background);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-subtle);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  border: 1px solid var(--border-light);
  transition: all 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-medium);
  transform: translateY(-1px);
}

/* Grid Layout */
.grid {
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .grid-md-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .grid-md-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid-lg-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Buttons */
.btn {
  font-family: var(--font-family);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  touch-action: manipulation;
  line-height: 1;
  -webkit-appearance: none;
  appearance: none;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary:disabled {
  background: linear-gradient(135deg, #3A5FFF 0%, #2A4FEF 100%);
  color: white;
}

.btn-success:disabled {
  background: linear-gradient(135deg, #2ECC71 0%, #27AE60 100%);
  color: white;
}

.btn-secondary:disabled {
  background: linear-gradient(135deg, rgba(58, 95, 255, 0.1) 0%, rgba(42, 79, 239, 0.1) 100%);
  color: var(--primary-blue);
  border: 2px solid var(--primary-blue);
}

.btn-primary {
  background: linear-gradient(135deg, #3A5FFF 0%, #2A4FEF 100%);
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #2A4FEF 0%, #1A3FDF 100%);
  transform: translateY(-1px);
  box-shadow: var(--shadow-medium);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: linear-gradient(135deg, rgba(58, 95, 255, 0.1) 0%, rgba(42, 79, 239, 0.1) 100%);
  color: var(--primary-blue);
  border: 2px solid var(--primary-blue);
}

.btn-secondary:hover {
  background: linear-gradient(135deg, #3A5FFF 0%, #2A4FEF 100%);
  color: white;
}

.btn-success {
  background: linear-gradient(135deg, #2ECC71 0%, #27AE60 100%);
  color: white;
}

.btn-success:hover {
  background: linear-gradient(135deg, #27AE60 0%, #1E8E4F 100%);
}

.btn-danger {
  background: linear-gradient(135deg, #E53E3E 0%, #C53030 100%);
  color: white;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #C53030 0%, #A02020 100%);
}

.btn-warning {
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  color: white;
}

.btn-warning:hover {
  background: linear-gradient(135deg, #D97706 0%, #B45309 100%);
}

.btn-disabled {
  background: linear-gradient(135deg, #6B7280 0%, #4B5563 100%);
  color: white;
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-disabled:hover {
  transform: none;
  box-shadow: none;
}

.btn-large {
  padding: 16px 32px;
  font-size: 1rem;
  min-height: 48px;
}

/* Upload Zone */
.upload-zone {
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  text-align: center;
  background: var(--card-background);
  transition: all 0.2s ease;
  cursor: pointer;
  margin-bottom: var(--space-lg);
}

.upload-zone:hover {
  border-color: var(--primary-blue);
  background-color: #F0F4FF;
}

.upload-zone.dragover {
  border-color: var(--primary-blue);
  background-color: #E0EBFF;
  transform: scale(1.02);
}

/* Image Preview */
.image-preview {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.image-preview img {
  width: 128px;
  height: 128px;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid white;
  box-shadow: var(--shadow-large);
}

.image-preview .remove-btn {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #E53E3E 0%, #C53030 100%);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: bold;
  transition: all 0.2s ease;
}

.image-preview .remove-btn:hover {
  background: linear-gradient(135deg, #C53030 0%, #A02020 100%);
  transform: scale(1.1);
}

/* Progress Bar */
.progress-container {
  background: var(--background-lighter);
  border-radius: var(--radius-full);
  height: 12px;
  overflow: hidden;
  margin-bottom: var(--space-md);
}

.progress-bar {
  background: linear-gradient(90deg, var(--primary-blue), var(--accent-green));
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

/* Image Display Container */
.image-display {
  display: block;
  max-width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--card-background);
  border: 2px solid var(--border-light);
  margin: 0 auto;
}

.image-display img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}


/* Metric Cards */
.metric-card {
  padding: var(--space-lg);
}

.metric-header {
  display: flex;
  align-items: center;
  margin-bottom: var(--space-md);
}

.metric-title {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
}

.metric-title.wrinkle { color: #E53E3E; }
.metric-title.surface { color: var(--primary-blue); }
.metric-title.pore { color: var(--accent-green); }
.metric-title.texture { color: #8B5CF6; }
.metric-title.global { color: #F59E0B; }
.metric-title.orientation { color: #6366F1; }

.metric-values {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

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

.metric-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.metric-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  z-index: 50;
}

.modal-content {
  background: var(--card-background);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-large);
  max-width: 500px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: var(--space-lg);
}

.modal-header {
  margin-bottom: var(--space-lg);
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
}

/* Error Messages */
.error-card, .warning-card {
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-lg);
  display: flex;
  gap: var(--space-md);
}

.error-card {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #991B1B;
}

.warning-card {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  color: #92400E;
}

.error-icon, .warning-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.error-content h3 {
  font-size: 0.875rem;
  font-weight: 600;
  margin: 0 0 var(--space-sm);
  text-transform: uppercase;
}

.error-content p {
  font-size: 0.875rem;
  margin: 0 0 var(--space-md);
}

/* Camera Modal */
.camera-modal {
  background: var(--card-background);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  max-width: 400px;
  width: 100%;
}

.camera-video {
  width: 100%;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
}

.camera-controls {
  display: flex;
  gap: var(--space-md);
}


/* Evaluation Section */
.evaluation-section {
  background: linear-gradient(135deg, #F0F4FF 0%, #E0EBFF 100%);
  border: 1px solid #C7D2FE;
}

/* Evaluation headers styling */
.eval-header {
  font-weight: bold;
  font-size: 1rem;
  margin: 16px 0 8px 0;
  color: var(--primary-blue);
}

.evaluation-content {
  color: var(--text-primary);
  line-height: 1.7;
  font-size: 0.95rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.evaluation-content p {
  margin: 0 0 var(--space-md);
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}

.evaluation-content p:last-child {
  margin-bottom: 0;
}

.evaluation-content .eval-header {
  color: var(--primary-color);
  font-size: 1rem;
  font-weight: 600;
  margin: var(--space-lg) 0 var(--space-sm) 0;
  text-align: left;
  border-left: 3px solid var(--primary-color);
  padding-left: var(--space-sm);
}

.evaluation-content .eval-header:first-child {
  margin-top: 0;
}

.evaluation-content ul {
  margin: var(--space-sm) 0 var(--space-md);
  padding-left: var(--space-lg);
  list-style-type: disc;
}

.evaluation-content li {
  margin-bottom: var(--space-xs);
  line-height: 1.6;
  text-align: left;
}

.evaluation-content li:last-child {
  margin-bottom: 0;
}

/* Better text formatting for mobile */
@media (max-width: 768px) {
  .evaluation-content {
    font-size: 0.9rem;
    line-height: 1.6;
  }
  
  .evaluation-content p {
    text-align: left;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: var(--space-md);
  }
  
  h1 {
    font-size: 1.75rem;
  }
  
  h2 {
    font-size: 1.25rem;
  }
  
  .btn {
    padding: 14px 20px;
    width: 100%;
  }
  
  .camera-controls .btn {
    flex: 1;
  }
  
  .image-display {
    width: 100%;
  }
}

/* Touch-friendly adjustments */
@media (pointer: coarse) {
  .btn {
    min-height: 48px;
    padding: 16px 24px;
  }
  
  
}

/* Animation utilities */
.transition-all { transition: all 0.2s ease; }
.transition-transform { transition: transform 0.2s ease; }

/* Loading spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--background-lighter);
  border-top: 4px solid var(--primary-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Progress animation */
@keyframes progress-fill {
  0% { width: 0%; }
  100% { width: 100%; }
}

.progress-animate {
  animation: progress-fill 8s ease-out forwards;
}

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

/* Text utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

/* Spacing utilities */
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: var(--space-sm); }
.mb-4 { margin-bottom: var(--space-md); }
.mb-6 { margin-bottom: var(--space-lg); }

.mt-0 { margin-top: 0; }
.mt-2 { margin-top: var(--space-sm); }
.mt-4 { margin-top: var(--space-md); }
.mt-6 { margin-top: var(--space-lg); }