/* ==========================================================================
   SlideCraft AI - Application Specific Styles
   Extends main.css with app-specific components
   ========================================================================== */

/* App-specific CSS Variables */
:root {
  /* Glass card styling */
  --glass-bg: rgba(255, 255, 255, 0.95);
  --glass-border: rgba(255, 255, 255, 0.2);
  
  /* Preview colors */
  --preview-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --preview-accent: rgba(255, 255, 255, 0.3);
  
  /* Form colors */
  --input-border: var(--gray-300);
  --input-focus: var(--primary-500);
  --input-bg: white;
}

/* ==========================================================================
   App Layout (gradient-bg moved to main.css for sharing)
   ========================================================================== */

/* ==========================================================================
   Glass Cards with Enhanced Readability
   ========================================================================== */

.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-xl);
  color: var(--gray-800); /* Ensure high contrast */
}

/* ==========================================================================
   Form Elements with Better Contrast
   ========================================================================== */

input, select, textarea {
  border: 2px solid var(--input-border);
  border-radius: var(--radius-md);
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: 1rem;
  transition: all 0.3s ease;
  background: var(--input-bg);
  color: var(--gray-800);
  font-weight: 500;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--input-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

input::placeholder, textarea::placeholder {
  color: var(--gray-500);
  font-weight: 400;
}

label {
  color: var(--gray-700);
  font-weight: 600;
  font-size: 0.875rem;
  display: block;
  margin-bottom: var(--spacing-xs);
}

/* ==========================================================================
   Button Enhancements
   ========================================================================== */

.btn-primary {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
  font-weight: 700;
  position: relative;
  overflow: hidden;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(240, 147, 251, 0.4);
}

/* ==========================================================================
   Preview Card with Enhanced Visibility
   ========================================================================== */

.preview-card {
  background: var(--preview-gradient);
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl);
  min-height: 350px;
  color: white;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}

.preview-card::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 100px;
  height: 100px;
  background: var(--preview-accent);
  border-radius: 50%;
}

.preview-card h3 {
  color: white;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.preview-card p, .preview-card div {
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   Loading States
   ========================================================================== */

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(255, 255, 255, 0.3);
  border-top: 5px solid var(--primary-500);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* ==========================================================================
   Status Messages with High Contrast
   ========================================================================== */

.status-success {
  background: var(--success-500);
  color: white;
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  font-weight: 600;
  text-align: center;
  box-shadow: var(--shadow-md);
}

.status-error {
  background: var(--error-500);
  color: white;
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  font-weight: 600;
  text-align: center;
  box-shadow: var(--shadow-md);
}

.status-warning {
  background: var(--warning-500);
  color: white;
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  font-weight: 600;
  text-align: center;
  box-shadow: var(--shadow-md);
}

/* ==========================================================================
   AI Analysis Results
   ========================================================================== */

.ai-analysis {
  background: var(--primary-50);
  border: 2px solid var(--primary-200);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  color: var(--primary-800);
}

.ai-analysis .icon {
  color: var(--primary-600);
}

.ai-analysis .title {
  font-weight: 600;
  color: var(--primary-800);
}

.ai-analysis .text {
  color: var(--primary-700);
}

/* ==========================================================================
   Template Selection
   ========================================================================== */

.template-selection {
  background: linear-gradient(to right, var(--primary-50), #fdf2f8);
  border: 2px solid var(--primary-200);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
}

.template-option {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm);
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
  cursor: pointer;
  transition: all 0.2s ease;
  background: white;
}

.template-option:hover {
  background: var(--primary-50);
  border-color: var(--primary-300);
}

.template-option input[type="radio"] {
  accent-color: var(--primary-600);
}

.template-option span {
  font-weight: 500;
  color: var(--gray-700);
}

/* ==========================================================================
   Floating Shapes (Subtle Background Elements)
   ========================================================================== */

.floating-shapes {
  position: fixed;
  pointer-events: none;
  z-index: -1;
}

.shape-1, .shape-2 {
  position: absolute;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  animation: float 6s ease-in-out infinite;
}

.shape-1 {
  top: 10%;
  left: 10%;
  width: 60px;
  height: 60px;
}

.shape-2 {
  top: 60%;
  right: 10%;
  width: 80px;
  height: 80px;
  animation-delay: -3s;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
}

/* ==========================================================================
   Language Switcher
   ========================================================================== */

#language-switcher {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  gap: 5px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 5px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-200);
}

#language-switcher button {
  border: none;
  background: transparent;
  color: var(--gray-600);
  padding: 8px 12px;
  border-radius: 15px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
}

#language-switcher button.active,
#language-switcher button:hover {
  background: var(--primary-600);
  color: white;
}

/* ==========================================================================
   App Specific Animations
   ========================================================================== */

.animate-pulse-custom {
  animation: pulseCustom 2s infinite;
}

@keyframes pulseCustom {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.9; }
}

/* ==========================================================================
   Utility Classes (Tailwind-like)
   ========================================================================== */

/* Layout */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.flex { display: flex; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }
.text-center { text-align: center; }
.hidden { display: none; }
.w-full { width: 100%; }
.h-32 { height: 8rem; }
.max-w-md { max-width: 28rem; }
.max-w-7xl { max-width: 80rem; }

/* Spacing */
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-x-2 > * + * { margin-left: 0.5rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-12 { margin-bottom: 3rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-16 { margin-top: 4rem; }
.ml-2 { margin-left: 0.5rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Typography */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-5xl { font-size: 3rem; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.leading-relaxed { line-height: 1.625; }

/* Colors */
.text-white { color: white; }
.text-gray-600 { color: #4b5563; }
.text-gray-700 { color: #374151; }
.text-gray-800 { color: #1f2937; }
.text-blue-600 { color: #2563eb; }
.text-blue-700 { color: #1d4ed8; }
.text-blue-800 { color: #1e40af; }
.text-green-600 { color: #16a34a; }
.text-green-700 { color: #15803d; }
.text-green-800 { color: #166534; }
.text-purple-600 { color: #9333ea; }
.text-red-600 { color: #dc2626; }

.bg-blue-50 { background-color: #eff6ff; }
.bg-blue-100 { background-color: #dbeafe; }
.bg-blue-600 { background-color: #2563eb; }
.bg-blue-700 { background-color: #1d4ed8; }
.bg-green-50 { background-color: #f0fdf4; }
.bg-green-600 { background-color: #16a34a; }
.bg-green-700 { background-color: #15803d; }
.bg-purple-50 { background-color: #faf5ff; }
.bg-purple-100 { background-color: #f3e8ff; }
.bg-purple-600 { background-color: #9333ea; }
.bg-purple-700 { background-color: #7c3aed; }
.bg-gray-600 { background-color: #4b5563; }
.bg-gray-700 { background-color: #374151; }
.bg-red-600 { background-color: #dc2626; }
.bg-red-700 { background-color: #b91c1c; }
.bg-yellow-50 { background-color: #fefce8; }
.bg-white { background-color: white; }

.bg-gradient-to-r { background-image: linear-gradient(to right, var(--tw-gradient-stops)); }
.from-blue-50 { --tw-gradient-from: #eff6ff; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(239, 246, 255, 0)); }
.from-purple-50 { --tw-gradient-from: #faf5ff; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(250, 245, 255, 0)); }
.to-purple-50 { --tw-gradient-to: #faf5ff; }
.to-pink-50 { --tw-gradient-to: #fdf2f8; }

/* White with opacity */
.text-white\/80 { color: rgba(255, 255, 255, 0.8); }
.text-white\/90 { color: rgba(255, 255, 255, 0.9); }
.bg-white\/20 { background-color: rgba(255, 255, 255, 0.2); }
.bg-white\/30 { background-color: rgba(255, 255, 255, 0.3); }

/* Borders */
.border { border-width: 1px; }
.border-gray-200 { border-color: #e5e7eb; }
.border-blue-200 { border-color: #bfdbfe; }
.border-green-200 { border-color: #bbf7d0; }
.border-purple-200 { border-color: #e9d5ff; }
.border-yellow-200 { border-color: #fde047; }
.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-full { border-radius: 9999px; }

/* Form specific */
.resize-none { resize: none; }
.focus\:border-purple-500:focus { border-color: #9333ea; }
.focus\:ring-2:focus { box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow, 0 0 #0000); --tw-ring-shadow: 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color); }
.focus\:ring-purple-200:focus { --tw-ring-color: #ddd6fe; }

/* Transitions */
.transition-all { transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-colors { transition-property: color, background-color, border-color, text-decoration-color, fill, stroke; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.duration-300 { transition-duration: 300ms; }

.hover\:animate-none:hover { animation: none; }
.hover\:bg-blue-50:hover { background-color: #eff6ff; }
.hover\:bg-blue-700:hover { background-color: #1d4ed8; }
.hover\:bg-green-700:hover { background-color: #15803d; }
.hover\:bg-purple-50:hover { background-color: #faf5ff; }
.hover\:bg-purple-700:hover { background-color: #7c3aed; }
.hover\:bg-gray-700:hover { background-color: #374151; }
.hover\:bg-red-700:hover { background-color: #b91c1c; }
.hover\:bg-white\/30:hover { background-color: rgba(255, 255, 255, 0.3); }

/* Position */
.absolute { position: absolute; }
.relative { position: relative; }
.fixed { position: fixed; }
.bottom-0 { bottom: 0px; }
.left-0 { left: 0px; }
.right-0 { right: 0px; }
.top-0 { top: 0px; }

/* Z-index */
.z-10 { z-index: 10; }

/* Other utilities */
.cursor-pointer { cursor: pointer; }
.inline-block { display: inline-block; }
.overflow-hidden { overflow: hidden; }

/* ==========================================================================
   Large Responsive Layout Classes
   ========================================================================== */

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

/* ==========================================================================
   Mobile Optimizations with Enhanced Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
  /* Container adjustments */
  .container {
    padding: 0 1rem !important;
  }
  
  /* Hero section mobile */
  .text-5xl {
    font-size: 2.5rem !important;
    line-height: 1.1 !important;
  }
  
  .text-xl {
    font-size: 1.125rem !important;
    line-height: 1.4 !important;
  }
  
  /* Grid layout mobile */
  .lg\:grid-cols-2,
  .grid-cols-2,
  .grid-cols-3 {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }
  
  /* Glass cards mobile */
  .glass-card {
    padding: 1.5rem !important;
    margin-bottom: 2rem;
  }
  
  /* Form elements mobile */
  .text-2xl {
    font-size: 1.5rem !important;
  }
  
  /* Textarea mobile */
  .h-32 {
    height: 6rem !important;
  }
  
  /* Buttons mobile */
  .btn-primary {
    padding: 1rem 1.5rem !important;
    font-size: 1rem !important;
    width: 100% !important;
  }
  
  /* Preview section mobile */
  .preview-card {
    padding: 1.5rem !important;
    min-height: 250px !important;
  }
  
  /* Navigation buttons mobile */
  #slideNavigation .grid-cols-2 {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }
  
  #slideNavigation button {
    padding: 0.75rem 1rem !important;
    font-size: 0.9rem !important;
  }
  
  /* Waitlist CTA mobile */
  .max-w-md {
    margin: 0 1rem !important;
  }
  
  /* Input elements - prevent zoom on iOS */
  input, select, textarea {
    font-size: 16px !important;
  }
  
  /* Language switcher mobile */
  #language-switcher {
    top: 10px !important;
    right: 10px !important;
    padding: 3px !important;
  }
  
  #language-switcher button {
    padding: 6px 8px !important;
    font-size: 12px !important;
  }
}

@media (max-width: 480px) {
  /* Extra small mobile devices */
  .text-5xl {
    font-size: 2rem !important;
  }
  
  .text-xl {
    font-size: 1rem !important;
  }
  
  .glass-card {
    padding: 1rem !important;
  }
  
  .preview-card {
    padding: 1rem !important;
    min-height: 200px !important;
  }
  
  .container {
    padding: 0 0.5rem !important;
  }
  
  .py-8 {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
  }
  
  .template-selection {
    padding: var(--spacing-sm);
  }
  
  .template-option {
    padding: var(--spacing-xs);
    font-size: 0.875rem;
  }
}