/* ========================================
   BOBA ROYAL - COMMON STYLES
   Shared utility classes and components
   ======================================== */

/* ===== SKELETON LOADING ANIMATION ===== */
@keyframes skeleton-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.dark .skeleton {
  background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
  background-size: 200% 100%;
}

/* Image loading state */
.img-loading {
  background: linear-gradient(90deg, #f3f4f6 0%, #e5e7eb 50%, #f3f4f6 100%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.dark .img-loading {
  background: linear-gradient(90deg, #1f2937 0%, #374151 50%, #1f2937 100%);
  background-size: 200% 100%;
}

/* Fade in when image loads */
.img-loaded {
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ===== FONT DISPLAY UTILITY ===== */
.font-display {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ===== CUSTOM COLOR CLASSES (TAILWIND COMPATIBLE) ===== */
/* Background colors */
.bg-background-light {
  background-color: #fdfbf7;
}

.bg-background-dark {
  background-color: #221016;
}

.bg-surface-light {
  background-color: #ffffff;
}

.bg-surface-dark {
  background-color: #331822;
}

/* Dark mode background colors */
.dark .dark\:bg-background-dark {
  background-color: #221016;
}

.dark .dark\:bg-surface-dark {
  background-color: #331822;
}

/* ===== PRIMARY COLOR ===== */
.text-primary {
  color: #ee2b6c;
}

.bg-primary {
  background-color: #ee2b6c;
}

.bg-primary\/5 {
  background-color: rgba(238, 43, 108, 0.05);
}

.bg-primary\/10 {
  background-color: rgba(238, 43, 108, 0.1);
}

.dark .dark\:bg-primary\/10 {
  background-color: rgba(238, 43, 108, 0.1);
}

.border-primary {
  border-color: #ee2b6c;
}

.border-primary\/10 {
  border-color: rgba(238, 43, 108, 0.1);
}

.hover\:text-primary:hover {
  color: #ee2b6c;
}

.hover\:bg-primary:hover {
  background-color: #ee2b6c;
}

.hover\:bg-primary\/90:hover {
  background-color: rgba(238, 43, 108, 0.9);
}

.hover\:border-primary:hover {
  border-color: #ee2b6c;
}

.group-hover\:border-primary:hover {
  border-color: #ee2b6c;
}

.focus\:ring-primary:focus {
  --tw-ring-color: #ee2b6c;
}

.focus\:border-primary:focus {
  border-color: #ee2b6c;
}

/* ===== DARK MODE TEXT ===== */
.dark .dark\:text-white {
  color: #ffffff;
}

.dark .dark\:text-gray-300 {
  color: #d1d5db;
}

.dark .dark\:text-gray-400 {
  color: #9ca3af;
}

/* ===== DARK MODE BORDERS ===== */
.dark .dark\:border-gray-800 {
  border-color: #1f2937;
}

.dark .dark\:border-\[\#4a2e36\] {
  border-color: #4a2e36;
}

/* ===== DARK MODE HOVER ===== */
.dark .dark\:hover\:bg-gray-800:hover {
  background-color: #1f2937;
}

/* ===== MATERIAL SYMBOLS ICON FIXES ===== */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'liga';
}

/* ===== BUTTON STYLES ===== */
.btn-primary {
  background-color: #ee2b6c;
  color: white;
  font-weight: 700;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  transition: all 200ms ease-in-out;
}

.btn-primary:hover {
  background-color: rgba(238, 43, 108, 0.9);
  transform: scale(1.02);
}

/* ===== CARD STYLES ===== */
.card-container {
  background-color: #ffffff;
  border-radius: 1.5rem;
  border: 1px solid #f4f0f2;
  overflow: hidden;
}

.dark .card-container {
  background-color: #331822;
  border-color: #4a2e36;
}

/* ===== FORM INPUT STYLES ===== */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
textarea,
select {
  transition: border-color 200ms ease-in-out, box-shadow 200ms ease-in-out;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #ee2b6c;
  box-shadow: 0 0 0 3px rgba(238, 43, 108, 0.1);
}

/* ===== LINK TRANSITIONS ===== */
a {
  transition: color 200ms ease-in-out;
}

/* ===== GRAYSCALE FILTER UTILITIES ===== */
.grayscale {
  filter: grayscale(100%);
}

.grayscale-0 {
  filter: grayscale(0%);
}

.group:hover .group-hover\:grayscale-0 {
  filter: grayscale(0%);
}

/* ===== SCALE UTILITIES ===== */
.hover\:scale-105:hover {
  transform: scale(1.05);
}

/* ===== EXPAND ICON ROTATION ===== */
details[open] .expand-icon {
  transform: rotate(180deg);
}

/* ===== RESPONSIVE FIXES ===== */
@media (max-width: 768px) {
  /* Fix mobile padding */
  .px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  /* Ensure touch targets are large enough */
  button, 
  a,
  input,
  select,
  textarea {
    min-height: 44px;
  }
  
  /* Fix grid on mobile */
  .grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ===== PRINT STYLES ===== */
@media print {
  .no-print {
    display: none !important;
  }
}
