* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: #110A06;
  color: #FFF8E1;
  font-family: 'Crimson Pro', serif;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Film grain overlay */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 0.5;
}

/* Warm ambient glow at the top */
body::after {
  content: '';
  position: fixed;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 600px;
  background: radial-gradient(ellipse, rgba(255, 143, 0, 0.08) 0%, rgba(255, 143, 0, 0.03) 40%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: #1A0E0A;
}
::-webkit-scrollbar-thumb {
  background: #5D4037;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #795548;
}

/* Shimmer loading animation */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.shimmer {
  background: linear-gradient(90deg, #1A0E0A 25%, #2E1B10 50%, #1A0E0A 75%);
  background-size: 200% 100%;
  animation: shimmer 2s ease-in-out infinite;
}

/* Pulse glow */
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(255, 143, 0, 0.1); }
  50% { box-shadow: 0 0 40px rgba(255, 143, 0, 0.25); }
}

.pulse-glow {
  animation: pulseGlow 2s ease-in-out infinite;
}

/* Fade in animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out forwards;
}

/* Staggered entrance */
.stagger-1 { animation-delay: 0.1s; opacity: 0; }
.stagger-2 { animation-delay: 0.2s; opacity: 0; }
.stagger-3 { animation-delay: 0.3s; opacity: 0; }
.stagger-4 { animation-delay: 0.4s; opacity: 0; }

/* Spinner */
@keyframes spin {
  to { transform: rotate(360deg); }
}
.spinner {
  animation: spin 1s linear infinite;
}

/* Button ripple */
@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* Toast animation */
@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes toastOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

.toast-in {
  animation: toastIn 0.3s ease-out forwards;
}
.toast-out {
  animation: toastOut 0.3s ease-in forwards;
}

/* Warm inner glow for textarea */
.warm-input {
  box-shadow: inset 0 0 30px rgba(255, 143, 0, 0.05), 0 0 0 1px rgba(255, 143, 0, 0.15);
  transition: box-shadow 0.3s ease;
}
.warm-input:focus {
  box-shadow: inset 0 0 30px rgba(255, 143, 0, 0.1), 0 0 0 1px rgba(255, 143, 0, 0.4), 0 0 20px rgba(255, 143, 0, 0.1);
  outline: none;
}

/* Generate button glow */
.generate-btn {
  background: linear-gradient(135deg, #FF8F00, #5D4037);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
.generate-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #FFA000, #6D4C41);
  box-shadow: 0 0 30px rgba(255, 143, 0, 0.3);
  transform: translateY(-1px);
}
.generate-btn:active:not(:disabled) {
  transform: translateY(0);
}
.generate-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Gallery card hover */
.gallery-card {
  transition: all 0.3s ease;
}
.gallery-card:hover {
  transform: scale(1.03);
  box-shadow: 0 0 25px rgba(255, 143, 0, 0.15);
}

/* Style pill */
.style-pill {
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 143, 0, 0.2);
}
.style-pill:hover {
  border-color: rgba(255, 143, 0, 0.5);
  background: rgba(255, 143, 0, 0.1);
}
.style-pill.active {
  border-color: #FF8F00;
  background: rgba(255, 143, 0, 0.2);
  color: #FFC107;
}

/* Aspect ratio toggle */
.aspect-toggle {
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 143, 0, 0.15);
}
.aspect-toggle:hover {
  border-color: rgba(255, 143, 0, 0.4);
}
.aspect-toggle.active {
  border-color: #FF8F00;
  background: rgba(255, 143, 0, 0.15);
}

/* Image card */
.image-card {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
}
.image-card img {
  transition: transform 0.5s ease;
}

/* Confirmation dialog backdrop */
.dialog-backdrop {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

/* Typing cursor effect for loading text */
@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}
.cursor-blink::after {
  content: '|';
  animation: blink 1s step-end infinite;
  color: #FF8F00;
}