/**
 * hanyaa.shop Custom Component Styles
 *
 * This file contains unified component classes to ensure consistent styling
 * across the application. These classes work alongside Tailwind CSS.
 */

/* ========================================
   ALPINE.JS
   ======================================== */

[x-cloak] {
  display: none !important;
}

/* ========================================
   BUTTONS
   ======================================== */

/* Primary Button - Main Call-to-Action */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: #1f55a7;
  color: white;
  padding: 0.625rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 500;
  font-size: 0.875rem;
  line-height: 1.25rem;
  border: none;
  cursor: pointer;
  transition: background-color 200ms;
}

.btn-primary:hover {
  background-color: #164180;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Secondary Button - Alternative Actions */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: #f3f4f6;
  color: #111827;
  padding: 0.625rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 500;
  font-size: 0.875rem;
  line-height: 1.25rem;
  border: none;
  cursor: pointer;
  transition: background-color 200ms;
  text-decoration: none;
}

.btn-secondary:hover {
  background-color: #e5e7eb;
}

/* Checkout/CTA Button - For checkout and order placement */
.btn-checkout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #1f55a7 0%, #164180 100%);
  color: white;
  padding: 0.875rem 2rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.5rem;
  border: none;
  cursor: pointer;
  transition: all 200ms;
  text-decoration: none;
  box-shadow: 0 4px 6px -1px rgba(31, 85, 167, 0.2), 0 2px 4px -1px rgba(31, 85, 167, 0.1);
}

.btn-checkout:hover {
  background: linear-gradient(135deg, #164180 0%, #0f2d5a 100%);
  box-shadow: 0 10px 15px -3px rgba(31, 85, 167, 0.3), 0 4px 6px -2px rgba(31, 85, 167, 0.15);
  transform: translateY(-1px);
}

.btn-checkout:active {
  transform: translateY(0);
  box-shadow: 0 4px 6px -1px rgba(31, 85, 167, 0.2), 0 2px 4px -1px rgba(31, 85, 167, 0.1);
}

/* Link-style Primary Button */
.btn-link-primary {
  color: #1f55a7;
  font-weight: 500;
  font-size: 0.875rem;
  line-height: 1.25rem;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 200ms;
  text-decoration: none;
}

.btn-link-primary:hover {
  color: #164180;
}

/* Link-style Danger Button */
.btn-link-danger {
  color: #dc2626;
  font-weight: 500;
  font-size: 0.875rem;
  line-height: 1.25rem;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 200ms;
  text-decoration: none;
}

.btn-link-danger:hover {
  color: #b91c1c;
}

/* Admin Edit Button */
.btn-admin-edit {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: #1f55a7;
  color: white;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-weight: 500;
  font-size: 0.875rem;
  line-height: 1.25rem;
  border: none;
  cursor: pointer;
  transition: background-color 200ms;
  text-decoration: none;
}

.btn-admin-edit:hover {
  background-color: #164180;
}

/* Full-width button variant */
.btn-full {
  width: 100%;
}

/* ========================================
   FORM ELEMENTS
   ======================================== */

/* Form Input Fields */
.form-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.form-input:focus {
  outline: none;
  border-color: #1f55a7;
  box-shadow: 0 0 0 3px rgba(31, 85, 167, 0.1);
}

/* Form Labels */
.form-label {
  display: block;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.25rem;
}

/* Form Select */
.form-select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  background-color: white;
  cursor: pointer;
}

.form-select:focus {
  outline: none;
  border-color: #1f55a7;
  box-shadow: 0 0 0 3px rgba(31, 85, 167, 0.1);
}

/* ========================================
   PILLS / TAGS (Filter buttons)
   ======================================== */

/* Active pill/tag */
.pill-active {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  border-radius: 9999px;
  background-color: rgba(31, 85, 167, 0.15);
  color: #1f55a7;
  transition: background-color 200ms;
  cursor: pointer;
  text-decoration: none;
}

.pill-active:hover {
  background-color: rgba(31, 85, 167, 0.25);
}

/* Inactive pill/tag */
.pill-inactive {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  border-radius: 9999px;
  background-color: #f3f4f6;
  color: #111827;
  transition: background-color 200ms;
  cursor: pointer;
  text-decoration: none;
}

.pill-inactive:hover {
  background-color: #e5e7eb;
}

/* ========================================
   PAGINATION
   ======================================== */

.pagination-btn {
  display: inline-flex;
  align-items: center;
  border-radius: 0.375rem;
  border-width: 1px;
  background-color: white;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  transition: background-color 200ms;
  text-decoration: none;
}

.pagination-btn-active {
  border-color: #d1d5db;
  color: #374151;
}

.pagination-btn-active:hover {
  background-color: #f9fafb;
}

.pagination-btn-disabled {
  border-color: #e5e7eb;
  color: #9ca3af;
  cursor: not-allowed;
  pointer-events: none;
}

/* ========================================
   ALERTS / MESSAGES
   ======================================== */

.alert {
  padding: 0.75rem 1rem;
  border-radius: 0.375rem;
  margin-bottom: 1rem;
  border-width: 1px;
}

.alert-error {
  background-color: #fee2e2;
  border-color: #f87171;
  color: #991b1b;
}

.alert-success {
  background-color: #d1fae5;
  border-color: #34d399;
  color: #065f46;
}

.alert-warning {
  background-color: #fed7aa;
  border-color: #fb923c;
  color: #92400e;
}

.alert-info {
  background-color: #dbeafe;
  border-color: #60a5fa;
  color: #1e3a8a;
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

/* Card container */
.card {
  background-color: white;
  padding: 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

/* Form container */
.form-container {
  max-width: 400px;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* Form container wide */
.form-container-wide {
  max-width: 600px;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* ========================================
   GLASSMORPHISM EFFECTS
   ======================================== */

/* Light Glass Effect - For cards, panels */
.glass {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 32px 0 rgba(38, 64, 115, 0.2);
}

/* Medium Glass - For navbar, footer, modals */
.glass-medium {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 8px 32px 0 rgba(38, 64, 115, 0.25);
}

/* Heavy Glass - For prominent CTAs, overlays */
.glass-heavy {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 2px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 12px 40px 0 rgba(38, 64, 115, 0.3);
}

/* Dark Glass Variant - For contrast areas */
.glass-dark {
  background: rgba(38, 64, 115, 0.3);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* ========================================
   CHROME/LIQUID METAL TEXT EFFECTS
   ======================================== */

/* Chrome Effect for h1 Headings */
.text-chrome {
  background: linear-gradient(135deg,
    #e8e8e8 0%, #ffffff 20%, #d0d0d0 40%,
    #ffffff 60%, #e0e0e0 80%, #f5f5f5 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 200% auto;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.5), 0 2px 4px rgba(0, 0, 0, 0.3);
  font-weight: 700;
  filter: brightness(1.2);
}

/* Animated Chrome - For h2, Logos */
.text-chrome-animated {
  background: linear-gradient(135deg,
    #c0c0c0, #ffffff, #a0a0a0, #e0e0e0, #b0b0b0, #d0d0d0
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 200% auto;
  animation: chromeShine 3s linear infinite;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
  font-weight: 700;
}

/* Liquid Metal - For Product Titles */
.text-liquid {
  background: linear-gradient(135deg,
    #8e9eab 0%, #eef2f3 25%, #8e9eab 50%,
    #eef2f3 75%, #8e9eab 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 300% auto;
  animation: liquidFlow 4s ease-in-out infinite;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.15);
  font-weight: 600;
}

/* Mercury Effect - For Buttons */
.text-mercury {
  background: linear-gradient(135deg,
    #b8c6db 0%, #f5f7fa 25%, #b8c6db 50%,
    #f5f7fa 75%, #b8c6db 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 200% auto;
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* Hover variants for chrome and liquid text effects */
.hover\:text-chrome:hover {
  background: linear-gradient(135deg,
    #e8e8e8 0%, #ffffff 20%, #d0d0d0 40%,
    #ffffff 60%, #e0e0e0 80%, #f5f5f5 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 200% auto;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.5), 0 2px 4px rgba(0, 0, 0, 0.3);
  filter: brightness(1.2);
}

.hover\:text-liquid:hover {
  background: linear-gradient(135deg,
    #8e9eab 0%, #eef2f3 25%, #8e9eab 50%,
    #eef2f3 75%, #8e9eab 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 300% auto;
  animation: liquidFlow 4s ease-in-out infinite;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.15);
}

/* ========================================
   GLASS BUTTON VARIANTS
   ======================================== */

/* Glass Primary Button */
.btn-glass-primary {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 2px solid rgba(255, 255, 255, 0.4);
  color: white;
  padding: 0.625rem 1.5rem;
  border-radius: 0.75rem;
  font-weight: 600;
  transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 24px rgba(38, 64, 115, 0.25);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-glass-primary:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 12px 32px rgba(38, 64, 115, 0.35);
  transform: translateY(-2px);
}

.btn-glass-primary:active {
  transform: translateY(0);
}

.btn-glass-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Glass Checkout Button */
.btn-glass-checkout {
  background: linear-gradient(135deg,
    rgba(38, 64, 115, 0.6) 0%,
    rgba(61, 90, 153, 0.6) 100%
  );
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 2px solid rgba(255, 255, 255, 0.5);
  color: white;
  padding: 0.875rem 2rem;
  border-radius: 0.75rem;
  font-weight: 700;
  transition: all 300ms;
  box-shadow: 0 12px 40px rgba(38, 64, 115, 0.4);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-glass-checkout:hover {
  background: linear-gradient(135deg,
    rgba(38, 64, 115, 0.8) 0%,
    rgba(61, 90, 153, 0.8) 100%
  );
  box-shadow: 0 16px 48px rgba(38, 64, 115, 0.5);
  transform: translateY(-3px);
}

.btn-glass-checkout:active {
  transform: translateY(-1px);
}

/* Glass Secondary Button */
.btn-glass-secondary {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 0.625rem 1.5rem;
  border-radius: 0.75rem;
  font-weight: 500;
  transition: all 300ms;
  box-shadow: 0 8px 24px rgba(38, 64, 115, 0.2);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-glass-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
}

/* ========================================
   GLASS FORM ELEMENTS
   ======================================== */

/* Glass Input Fields */
.form-input-glass {
  width: 100%;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: white;
  transition: all 200ms;
}

.form-input-glass::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.form-input-glass:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.2);
}

/* Glass Select */
.form-select-glass {
  width: 100%;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: white;
  transition: all 200ms;
  cursor: pointer;
}

.form-select-glass:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.2);
}

/* Glass Label */
.form-label-glass {
  display: block;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
  color: white;
  margin-bottom: 0.5rem;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

/* ========================================
   GLASS PILLS/TAGS
   ======================================== */

/* Glass Active Pill */
.pill-glass-active {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: white;
  transition: all 200ms;
  cursor: pointer;
  text-decoration: none;
}

.pill-glass-active:hover {
  background: rgba(255, 255, 255, 0.35);
  border-color: rgba(255, 255, 255, 0.5);
}

/* Glass Inactive Pill */
.pill-glass-inactive {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.8);
  transition: all 200ms;
  cursor: pointer;
  text-decoration: none;
}

.pill-glass-inactive:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  color: white;
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes chromeShine {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes liquidFlow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ========================================
   RESPONSIVE OPTIMIZATIONS
   ======================================== */

@media (max-width: 768px) {
  .glass,
  .glass-medium,
  .glass-heavy,
  .glass-dark {
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
  }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

@media (prefers-reduced-motion: reduce) {
  .text-chrome-animated,
  .text-liquid,
  .text-mercury {
    animation: none !important;
    background-position: 50% 50%;
  }
}
