/* Base Styles & CSS Variables */
:root {
  /* Luxury Palette */
  --primary-gradient: linear-gradient(135deg, #1a1a1a 0%, #000000 100%);
  --primary-color: #111111;
  --primary-dark: #000000;
  --accent-color: #C5A059; /* Muted Gold */
  
  --text-primary: #111111;
  --text-secondary: #555555;
  --text-muted: #888888;
  
  --bg-primary: #ffffff;
  --bg-secondary: #fafafa;
  --bg-tertiary: #f0f0f0;
  
  --border-color: #e0e0e0;
  
  /* Functional Colors */
  --success-bg: #f0fdf4;
  --success-text: #15803d;
  --success-border: #bbf7d0;
  --error-bg: #fef2f2;
  --error-text: #b91c1c;
  --error-border: #fecaca;
  
  /* Shadows - Softer, more diffused */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 6px 12px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 24px 48px rgba(0, 0, 0, 0.1);
  
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  
  --transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  
  --font-heading: 'Playfair Display', serif;
  --font-body: 'Inter', sans-serif;
}

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

body {
  font-family: var(--font-body);
  background: var(--bg-secondary);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  color: var(--text-primary);
  line-height: 1.6;
}

.container {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  max-width: 480px;
  width: 100%;
  padding: 40px;
  transition: var(--transition);
  animation: fadeInUp 0.6s ease-out;
  border: 1px solid rgba(0,0,0,0.03);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.container.is-dashboard {
  max-width: 1600px;
  padding: 48px 56px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-primary);
}

/* Links - Override browser defaults (especially for mobile Chrome) */
/* Exclude buttons from inheriting color */
a:not(.btn) {
  color: inherit;
  text-decoration: none;
}

a:not(.btn):visited {
  color: inherit;
}

a:not(.btn):hover {
  color: inherit;
}

a:not(.btn):active {
  color: inherit;
}

h1 {
  margin-bottom: 12px;
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 28px;
  font-weight: 500;
  margin-bottom: 20px;
}

h3 {
  font-size: 22px;
  font-weight: 500;
  margin-bottom: 12px;
}

.subtitle {
  color: var(--text-muted);
  margin-bottom: 32px;
  font-size: 15px;
}

/* Visibility & Layout Utilities */
.hidden {
  display: none !important;
}

.auth-section {
  display: none;
}

.auth-section.active {
  display: block;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Loading Spinner */
.loading {
  display: none;
  text-align: center;
  margin: 20px 0;
}

.loading.active {
  display: block;
}

.spinner {
  border: 3px solid var(--bg-tertiary);
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

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

/* Toast Notifications */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: white;
  border-radius: 8px;
  padding: 16px 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  min-width: 300px;
  max-width: 500px;
  animation: slideIn 0.3s ease-out;
}

.toast.success {
  border-left: 4px solid #22c55e;
  color: #166534;
}

.toast.info {
  border-left: 4px solid #3b82f6;
  color: #1e40af;
}

.toast.error {
  border-left: 4px solid #ef4444;
  color: #991b1b;
}

.toast.warning {
  border-left: 4px solid #f59e0b;
  color: #92400e;
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

.toast.removing {
  animation: slideOut 0.3s ease-in forwards;
}

/* Highlight/Pulse Animation */
@keyframes pulse-highlight {
  0% {
    box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(102, 126, 234, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(102, 126, 234, 0);
  }
}

.style-image-card.newly-generated {
  animation: pulse-highlight 2s ease-out;
}

/* Responsive */
@media (max-width: 768px) {
  body {
    padding: 16px;
  }

  .container {
    padding: 24px;
  }

  .container.is-dashboard {
    padding: 24px;
  }

  h1 {
    font-size: 28px;
  }

  .toast {
    right: 10px;
    left: 10px;
    min-width: auto;
    max-width: none;
  }
}
