/* Custom styles for Hair Style AI Studio */

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #1a1a2e 100%);
  min-height: 100vh;
  color: white;
}

.app {
  min-height: 100vh;
  padding-bottom: 2rem;
}

/* Header Styles */
.header {
  text-align: center;
  padding: 2rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
}

.app-title {
  font-size: 3.5rem;
  font-weight: 300;
  font-style: italic;
  margin: 0;
  background: linear-gradient(45deg, #ffd700, #ffed4e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.app-tagline {
  font-size: 1.2rem;
  margin: 0.5rem 0 0 0;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 300;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* Main Content */
.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Demo Section */
.demo-section {
  text-align: center;
  margin-bottom: 3rem;
}

.demo-title {
  font-size: 2rem;
  margin-bottom: 2rem;
  color: white;
  font-weight: 300;
}

.demo-gallery {
  justify-content: center;
  margin-bottom: 2rem;
}

.demo-cta {
  background: linear-gradient(45deg, #ffd700, #ffed4e);
  color: #1a1a2e;
  border: none;
  padding: 1rem 2rem;
  font-size: 1.2rem;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.demo-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(255, 215, 0, 0.3);
}

/* Controls Section */
.controls-section {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

@media (max-width: 1024px) {
  .controls-section {
    grid-template-columns: 1fr;
  }
}

.upload-area, .style-selector, .color-selector {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Upload Area */
.upload-zone {
  border: 3px dashed rgba(255, 255, 255, 0.3);
  border-radius: 15px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-zone:hover, .upload-zone.drag-over {
  border-color: #ffd700;
  background: rgba(255, 215, 0, 0.1);
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.uploaded-preview {
  max-width: 100%;
  max-height: 200px;
  border-radius: 10px;
  object-fit: cover;
}

.hidden {
  display: none;
}

.style-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

.style-button {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 1rem;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
}

.style-button:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 215, 0, 0.5);
}

.style-button.selected {
  background: rgba(255, 215, 0, 0.2);
  border-color: #ffd700;
}

.style-name {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.style-desc {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
}

/* Color Selector */
.color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
}

.color-button {
  border: 3px solid transparent;
  border-radius: 12px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.color-button:hover {
  border-color: rgba(255, 255, 255, 0.5);
  transform: scale(1.05);
}

.color-button.selected {
  border-color: #ffd700;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

.color-name {
  color: white;
  font-weight: 600;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
  position: relative;
  z-index: 1;
}

/* Generate Section */
.generate-section {
  text-align: center;
  margin: 2rem 0;
}

.generate-btn {
  background: linear-gradient(45deg, #ffd700, #ffed4e);
  color: #1a1a2e;
  border: none;
  padding: 1rem 2rem;
  font-size: 1.2rem;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.generate-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(255, 215, 0, 0.3);
}

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

/* Results Section */
.results-section {
  margin-top: 3rem;
}

.results-title {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 2rem;
  color: white;
  font-weight: 300;
  font-style: italic;
}

/* Polaroid Gallery */
.polaroid-gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
  padding: 2rem;
  perspective: 1000px;
}

.polaroid-photo {
  background: white;
  padding: 1rem 1rem 3rem 1rem;
  border-radius: 4px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  transform-style: preserve-3d;
}

.polaroid-photo:hover {
  transform: translateY(-10px) scale(1.05);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.polaroid-photo.generating {
  animation: float 2s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(var(--rotation, 0deg)); }
  50% { transform: translateY(-10px) rotate(var(--rotation, 0deg)); }
}

.photo-frame {
  width: 256px;
  height: 256px;
  background: #f5f5f5;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.photo-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s ease;
  opacity: 0;
}

.photo-image.loaded {
  opacity: 1;
}

.loading-placeholder, .error-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: linear-gradient(45deg, #f0f0f0, #e0e0e0);
}

.error-placeholder {
  cursor: pointer;
}

.error-placeholder:hover {
  background: linear-gradient(45deg, #f5f5f5, #e5e5e5);
}

.photo-label {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  right: 1rem;
  text-align: center;
  color: #333;
}

.photo-label .style-name {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
  font-family: 'Marker Felt', cursive;
}

.photo-label .style-description {
  font-size: 0.875rem;
  color: #666;
  font-style: italic;
}

.regenerate-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.polaroid-photo:hover .regenerate-btn {
  opacity: 1;
}

/* Footer */
.footer {
  text-align: center;
  padding: 2rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
  background: rgba(0, 0, 0, 0.2);
}

.footer-link {
  color: #ffd700;
  text-decoration: none;
  margin-left: 1rem;
}

.footer-link:hover {
  text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
  .app-title {
    font-size: 2.5rem;
  }
  
  .polaroid-gallery {
    gap: 1rem;
    padding: 1rem;
  }
  
  .polaroid-photo {
    transform: none !important;
  }
  
  .photo-frame {
    width: 200px;
    height: 200px;
  }
}

@media (max-width: 480px) {
  .app-title {
    font-size: 2rem;
  }
  
  .photo-frame {
    width: 150px;
    height: 150px;
  }
}