/* Hutch AI - Room Redesign App Styles */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:wght@400;500;600;700&display=swap');

/* CSS Variables - Color Palette */
:root {
  --charcoal: #1A1A1A;
  --warm-white: #FAFAFA;
  --off-white: #F5F3F0;
  --sage: #8B9A7D;
  --sage-dark: #6B7A5D;
  --terracotta: #C4856A;
  --slate: #64748B;
  --cloud: #E8E4E0;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--warm-white);
  color: var(--charcoal);
  line-height: 1.6;
  min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 600;
  line-height: 1.2;
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.5rem;
}

p {
  color: var(--slate);
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--cloud);
  background: var(--warm-white);
}

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

.logo {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--charcoal);
  text-decoration: none;
}

.logo span {
  color: var(--sage);
}

/* Main Content */
.main {
  flex: 1;
  padding: 3rem 0;
}

.section-title {
  text-align: center;
  margin-bottom: 0.75rem;
}

.section-subtitle {
  text-align: center;
  margin-bottom: 2.5rem;
  font-size: 1.1rem;
}

/* Upload Zone */
.upload-zone {
  border: 2px dashed var(--cloud);
  border-radius: 16px;
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--off-white);
  max-width: 600px;
  margin: 0 auto;
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--sage);
  background: rgba(139, 154, 125, 0.05);
}

.upload-zone.has-file {
  border-color: var(--sage);
  border-style: solid;
}

.upload-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.5rem;
  color: var(--sage);
}

.upload-title {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
}

.upload-text {
  font-size: 0.9rem;
  color: var(--slate);
  margin-bottom: 1.5rem;
}

.upload-button {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--sage);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.upload-button:hover {
  background: var(--sage-dark);
  transform: translateY(-1px);
}

.upload-preview {
  max-width: 100%;
  max-height: 300px;
  border-radius: 12px;
  margin-top: 1.5rem;
  display: none;
}

.upload-preview.visible {
  display: block;
}

.upload-file-info {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--slate);
  display: none;
}

.upload-file-info.visible {
  display: block;
}

.hidden-input {
  display: none;
}

/* Style Cards Grid */
.styles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.5rem;
  max-width: 800px;
  margin: 0 auto 2.5rem;
}

.style-card {
  position: relative;
  width: 100%;
  height: 200px;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  background: var(--off-white);
}

.style-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.style-card.selected {
  border-color: var(--sage);
}

.style-card-image {
  width: 100%;
  height: 140px;
  object-fit: cover;
  background: linear-gradient(135deg, var(--cloud) 0%, var(--off-white) 100%);
}

.style-card-content {
  padding: 0.75rem;
  text-align: center;
}

.style-card-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--charcoal);
}

.style-checkmark {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--sage);
  display: none;
  align-items: center;
  justify-content: center;
  color: white;
}

.style-card.selected .style-checkmark {
  display: flex;
}

/* Preview Section */
.preview-section {
  max-width: 400px;
  margin: 0 auto 2rem;
  text-align: center;
}

.preview-image {
  width: 100%;
  max-height: 250px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 1rem;
}

.preview-label {
  font-size: 0.9rem;
  color: var(--slate);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 1rem 2rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  text-align: center;
}

.btn-primary {
  background: var(--sage);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: var(--sage-dark);
  transform: translateY(-2px);
}

.btn-primary:disabled {
  background: var(--cloud);
  cursor: not-allowed;
}

.btn-secondary {
  background: transparent;
  color: var(--charcoal);
  border: 2px solid var(--cloud);
}

.btn-secondary:hover {
  border-color: var(--sage);
  color: var(--sage);
}

.btn-block {
  display: block;
  width: 100%;
}

.btn-center {
  margin: 0 auto;
  display: block;
}

/* Loading State */
.loading-container {
  text-align: center;
  padding: 4rem 2rem;
  max-width: 500px;
  margin: 0 auto;
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid var(--cloud);
  border-top-color: var(--sage);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 2rem;
}

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

.loading-title {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.loading-message {
  color: var(--slate);
  font-size: 1rem;
  margin-bottom: 1rem;
}

.loading-progress {
  height: 4px;
  background: var(--cloud);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 1.5rem;
}

.loading-progress-bar {
  height: 100%;
  background: var(--sage);
  width: 0%;
  transition: width 0.3s ease;
}

/* Results Gallery */
.results-container {
  max-width: 900px;
  margin: 0 auto;
}

.main-image-container {
  position: relative;
  margin-bottom: 1.5rem;
  border-radius: 16px;
  overflow: hidden;
  background: var(--off-white);
}

.main-image {
  width: 100%;
  height: auto;
  max-height: 500px;
  object-fit: contain;
  display: block;
}

.image-style-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: rgba(26, 26, 26, 0.8);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
}

.image-actions {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  display: flex;
  gap: 0.5rem;
}

.action-btn {
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.95);
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.action-btn:hover {
  background: white;
  transform: translateY(-1px);
}

/* Thumbnails */
.thumbnails-container {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  -webkit-overflow-scrolling: touch;
}

.thumbnail {
  flex-shrink: 0;
  width: 120px;
  height: 90px;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
}

.thumbnail:hover {
  border-color: var(--cloud);
}

.thumbnail.active {
  border-color: var(--sage);
}

.thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumbnail-original {
  position: relative;
}

.thumbnail-original::after {
  content: 'Original';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(26, 26, 26, 0.8);
  color: white;
  font-size: 0.7rem;
  padding: 0.25rem;
  text-align: center;
}

/* Comparison View */
.comparison-section {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--cloud);
}

.comparison-title {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  text-align: center;
}

.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.comparison-item {
  border-radius: 12px;
  overflow: hidden;
  background: var(--off-white);
}

.comparison-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.comparison-label {
  padding: 0.75rem;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 500;
}

/* Footer Actions */
.footer-actions {
  margin-top: 2rem;
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Error State */
.error-container {
  text-align: center;
  padding: 4rem 2rem;
  max-width: 500px;
  margin: 0 auto;
}

.error-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  color: var(--terracotta);
}

.error-title {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--charcoal);
}

.error-message {
  color: var(--slate);
  margin-bottom: 1.5rem;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
}

.empty-state-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  color: var(--cloud);
}

/* Form Elements */
input[type="text"],
input[type="email"],
textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 1px solid var(--cloud);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--sage);
}

/* Responsive Design */
@media (max-width: 768px) {
  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .main {
    padding: 2rem 0;
  }

  .upload-zone {
    padding: 2rem 1.5rem;
  }

  .styles-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .style-card {
    height: 180px;
  }

  .style-card-image {
    height: 120px;
  }

  .comparison-grid {
    grid-template-columns: 1fr;
  }

  .footer-actions {
    flex-direction: column;
  }

  .footer-actions .btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

  .styles-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .style-card {
    height: 160px;
  }

  .style-card-image {
    height: 100px;
  }

  .thumbnail {
    width: 100px;
    height: 75px;
  }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.4s ease-out;
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--charcoal);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  font-size: 0.9rem;
  z-index: 1000;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translate(-50%, 20px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* Step Indicator */
.step-indicator {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--slate);
}

.step-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--cloud);
  color: var(--slate);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
}

.step.active .step-number {
  background: var(--sage);
  color: white;
}

.step.completed .step-number {
  background: var(--sage);
  color: white;
}

.step-divider {
  width: 40px;
  height: 2px;
  background: var(--cloud);
}

.step.active + .step-divider,
.step.completed + .step-divider {
  background: var(--sage);
}
