/* Lightweight Tailwind fallback for offline/PWA use.
   Covers the utility classes used in index.html.
*/

/* Base */
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; }

/* Display */
.hidden { display: none !important; }
.flex { display: flex; }
.inline-block { display: inline-block; }

/* Flexbox helpers */
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-around { justify-content: space-around; }
.justify-between { justify-content: space-between; }

/* Gap (limited) */
.gap-5 { gap: 1.25rem; }
.gap-8 { gap: 2rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-x-4 > * + * { margin-left: 1rem; }

/* Positioning */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.top-4 { top: 1rem; }
.left-4 { left: 1rem; }
.z-50 { z-index: 50; }

/* Sizing */
.w-full { width: 100%; }
.max-w-sm { max-width: 24rem; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.max-w-4xl { max-width: 56rem; }
.w-10 { width: 2.5rem; }
.h-10 { height: 2.5rem; }
.w-48 { width: 12rem; }
.h-2 { height: 0.5rem; }
.h-24 { height: 6rem; }
.w-px { width: 1px; }
.min-h-screen { min-height: 100vh; }

/* Spacing */
.mx-auto { margin-left: auto; margin-right: auto; }
.my-auto { margin-top: auto; margin-bottom: auto; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-8 { margin-top: 2rem; }
.my-6 { margin-top: 1.5rem; margin-bottom: 1.5rem; }
.p-2 { padding: 0.5rem; }
.p-4 { padding: 1rem; }
.p-8 { padding: 2rem; }
.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; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.pt-0 { padding-top: 0; }

/* Typography */
.text-center { text-align: center; }
.text-white { color: #fff; }
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-gray-700 { color: #374151; }
.text-gray-800 { color: #1f2937; }
.text-purple-600 { color: #7c3aed; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.text-5xl { font-size: 3rem; line-height: 1; }
.text-6xl { font-size: 3.75rem; line-height: 1; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }

/* Backgrounds */
.bg-white { background-color: #fff; }
.bg-gray-100 { background-color: #f3f4f6; }
.bg-gray-200 { background-color: #e5e7eb; }
.bg-gray-300 { background-color: #d1d5db; }
.bg-purple-600 { background-color: #7c3aed; }
.bg-purple-700 { background-color: #6d28d9; }
.bg-green-500 { background-color: #10b981; }
.bg-red-500 { background-color: #ef4444; }

/* Hover backgrounds (basic) */
.hover\:bg-gray-100:hover { background-color: #f3f4f6; }
.hover\:bg-gray-300:hover { background-color: #d1d5db; }
.hover\:bg-purple-600:hover { background-color: #7c3aed; }
.hover\:bg-purple-700:hover { background-color: #6d28d9; }
.hover\:bg-green-600:hover { background-color: #059669; }
.hover\:bg-red-600:hover { background-color: #dc2626; }

/* Opacity */
.bg-opacity-80 { --bg-opacity: 0.8; }
.bg-opacity-80 { background-color: rgba(243, 244, 246, var(--bg-opacity)); }

/* Borders */
.border { border-width: 1px; border-style: solid; border-color: #e5e7eb; }
.border-2 { border-width: 2px; }
.border-gray-200 { border-color: #e5e7eb; }
.border-gray-300 { border-color: #d1d5db; }
.border-gray-400 { border-color: #9ca3af; }
.border-purple-300 { border-color: #c4b5fd; }
.border-opacity-50 { border-color: rgba(196, 181, 253, 0.5); }
.hover\:border-opacity-75:hover { border-color: rgba(196, 181, 253, 0.75); }

/* Radius */
.rounded-full { border-radius: 9999px; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-3xl { border-radius: 1.5rem; }

/* Shadows */
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05); }

/* Transitions */
.transition-all { transition: all 0.3s ease; }
.transition-colors { transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease; }
.duration-300 { transition-duration: 300ms; }

/* Overflow */
.overflow-x-hidden { overflow-x: hidden; }

/* Utilities used in markup */
.w-full.max-w-md { width: 100%; max-width: 28rem; }

/* Custom height utilities for centering */
.min-h-\[70vh\] { min-height: 70vh; }

/* Center the end screen */
#endScreen {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 1rem;
}

/* Move showcase grid closer to top */
.showcase-grid {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 140px;
  z-index: 1;
  pointer-events: none;
}

/* PWA Install Toast */
.pwa-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  color: #374151;
  padding: 12px 16px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  display: none;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
  max-width: calc(100vw - 40px);
  min-width: 280px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.pwa-toast.show {
  display: flex;
  animation: slideUp 0.3s ease-out;
}

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

.pwa-toast span {
  flex: 1;
  min-width: 0;
  color: #4b5563;
}

.pwa-toast button {
  background: #4f46e5;
  border: none;
  color: white;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.pwa-toast button:hover {
  background: #4338ca;
  transform: translateY(-1px);
}

.pwa-toast button:active {
  transform: translateY(0);
}

.pwa-toast .close {
  background: none;
  border: none;
  color: #6b7280;
  padding: 4px;
  border-radius: 6px;
  font-size: 16px;
  line-height: 1;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.pwa-toast .close:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #374151;
}

/* Mobile responsive adjustments */
@media (max-width: 480px) {
  .pwa-toast {
    bottom: 16px;
    left: 16px;
    right: 16px;
    transform: none;
    max-width: none;
    min-width: auto;
    padding: 10px 14px;
    font-size: 13px;
    gap: 10px;
    border-radius: 10px;
  }
  
  .pwa-toast button {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
  }
  
  .pwa-toast .close {
    width: 20px;
    height: 20px;
    font-size: 14px;
  }
  
  @keyframes slideUp {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

/* Custom responsive text sizes */
@media (min-width: 640px) {
  .sm\:text-\[1\.5rem\] { font-size: 1.5rem; }
  .sm\:text-\[5rem\] { font-size: 5rem; }
}

/* Improved button styling */
.bg-green-500 {
  background-color: #10b981;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

.bg-red-500 {
  background-color: #ef4444;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

.hover\:bg-green-600:hover {
  background-color: #059669;
  transform: translateY(-1px);
  box-shadow: 0 6px 12px -1px rgba(0, 0, 0, 0.15);
}

.hover\:bg-red-600:hover {
  background-color: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 6px 12px -1px rgba(0, 0, 0, 0.15);
}

/* Home icon fallback when Font Awesome doesn't load */
.fas.fa-home::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' viewBox='0 0 24 24'%3E%3Cpath d='M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* Feedback icons fallback when Font Awesome doesn't load */
.fas.fa-check-circle::before {
  content: "";
  display: inline-block;
  width: 60px;
  height: 60px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 24 24'%3E%3Cpath d='M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0zm-1.25 17.292l-4.5-4.364 1.857-1.858 2.643 2.506 5.643-5.784 1.857 1.858-7.5 7.642z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.fas.fa-times-circle::before {
  content: "";
  display: inline-block;
  width: 60px;
  height: 60px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 24 24'%3E%3Cpath d='M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0zm4.95 16.364l-1.414 1.414L12 14.242 8.464 17.778l-1.414-1.414L10.586 12 7.05 8.464l1.414-1.414L12 10.586l3.536-3.536 1.414 1.414L13.414 12l3.536 3.536z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* Better text color for purple */
.hover\:text-purple-600:hover {
  color: #7c3aed;
}

/* Responsive (md:) subset */
@media (min-width: 768px) {
  .md\:flex-row { flex-direction: row; }
}
