/* PadelHit Website Styles */
/* Matching the Ionic Mobile App Tailwind Configuration */

/* Custom Colors from Angular Tailwind Config (tailwind.config.js) */
:root {
  --ion-color-primary: #16493a;
  --ion-color-primary-rgb: 22, 73, 58;
  --ion-color-primary-contrast: #ffffff;
  --ion-color-primary-contrast-rgb: 255, 255, 255;
  --ion-color-primary-shade: #134033;
  --ion-color-primary-tint: #2d5a4e;
  
  --ion-color-accent: #f45734;
  --ion-color-accent-rgb: 244, 87, 52;
  --ion-color-accent-contrast: #ffffff;
  --ion-color-accent-contrast-rgb: 255, 255, 255;
  --ion-color-accent-shade: #d74c2e;
  --ion-color-accent-tint: #f56848;
  
  /* Tailwind color values */
  --tw-primary: 22 73 58;    /* #16493a - dark teal/green */
  --tw-accent: 244 87 52;    /* #f45734 - orange-red */
  --padel-background: 244 247 245;  /* #f4f7f5 - light background */
  --padel-surface: 255 255 255;    /* #ffffff - white */
  --padel-text: 15 23 42;          /* #0f172a - dark blue-gray */
}

/* ============================================
   Tailwind CSS Custom Classes
   ============================================ */

.text-padel-primary {
  --tw-text-opacity: 1;
  color: rgb(var(--tw-primary) / var(--tw-text-opacity));
}

.bg-padel-primary {
  --tw-bg-opacity: 1;
  background-color: rgb(var(--tw-primary) / var(--tw-bg-opacity));
}

.border-padel-primary {
  --tw-border-opacity: 1;
  border-color: rgb(var(--tw-primary) / var(--tw-border-opacity));
}

.text-padel-accent {
  --tw-text-opacity: 1;
  color: rgb(var(--tw-accent) / var(--tw-text-opacity));
}

.bg-padel-accent {
  --tw-bg-opacity: 1;
  background-color: rgb(var(--tw-accent) / var(--tw-bg-opacity));
}

.border-padel-accent {
  --tw-border-opacity: 1;
  border-color: rgb(var(--tw-accent) / var(--tw-border-opacity));
}

.text-padel-text {
  --tw-text-opacity: 1;
  color: rgb(var(--padel-text) / var(--tw-text-opacity));
}

.bg-padel-text {
  --tw-bg-opacity: 1;
  background-color: rgb(var(--padel-text) / var(--tw-bg-opacity));
}

.border-padel-text {
  --tw-border-opacity: 1;
  border-color: rgb(var(--padel-text) / var(--tw-border-opacity));
}

.bg-padel-background {
  --tw-bg-opacity: 1;
  background-color: rgb(var(--padel-background) / var(--tw-bg-opacity));
}

.bg-padel-surface {
  --tw-bg-opacity: 1;
  background-color: rgb(var(--padel-surface) / var(--tw-bg-opacity));
}

/* Hover variants */
.hover\:bg-padel-primary\/5:hover {
  --tw-bg-opacity: 0.05;
  background-color: rgb(var(--tw-primary) / var(--tw-bg-opacity));
}

.hover\:bg-padel-primary\/10:hover {
  --tw-bg-opacity: 0.1;
  background-color: rgb(var(--tw-primary) / var(--tw-bg-opacity));
}

.hover\:bg-padel-primary\/50:hover {
  --tw-bg-opacity: 0.5;
  background-color: rgb(var(--tw-primary) / var(--tw-bg-opacity));
}

.hover\:bg-padel-primary\/90:hover {
  --tw-bg-opacity: 0.9;
  background-color: rgb(var(--tw-primary) / var(--tw-bg-opacity));
}

.hover\:bg-padel-text\/5:hover {
  --tw-bg-opacity: 0.05;
  background-color: rgb(var(--padel-text) / var(--tw-bg-opacity));
}

.hover\:bg-padel-text\/10:hover {
  --tw-bg-opacity: 0.1;
  background-color: rgb(var(--padel-text) / var(--tw-bg-opacity));
}

.hover\:bg-padel-text\/30:hover {
  --tw-bg-opacity: 0.3;
  background-color: rgb(var(--padel-text) / var(--tw-bg-opacity));
}

.hover\:bg-padel-text\/50:hover {
  --tw-bg-opacity: 0.5;
  background-color: rgb(var(--padel-text) / var(--tw-bg-opacity));
}

.hover\:bg-padel-text\/90:hover {
  --tw-bg-opacity: 0.9;
  background-color: rgb(var(--padel-text) / var(--tw-bg-opacity));
}

.hover\:bg-padel-text\/100:hover {
  --tw-bg-opacity: 1;
  background-color: rgb(var(--padel-text) / var(--tw-bg-opacity));
}

/* Ring color variants */
.focus\:ring-padel-text:focus {
  --tw-ring-opacity: 1;
  --tw-ring-color: rgb(var(--padel-text) / var(--tw-ring-opacity));
}

.focus\:ring-padel-primary:focus {
  --tw-ring-opacity: 1;
  --tw-ring-color: rgb(var(--tw-primary) / var(--tw-ring-opacity));
}

/* Focus ring */
.focus\:ring-2:focus {
  --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
  --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
  box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
}

.focus\:ring-offset-2:focus {
  --tw-ring-offset-width: 2px;
}

/* ============================================
   Custom Animations
   ============================================ */

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

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

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.animate-fade-in {
  animation: fadeIn 0.3s ease-out forwards;
}

.animate-fade-in-up {
  animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-fade-in-down {
  animation: fadeInDown 0.3s ease-out forwards;
}

.animate-spin {
  animation: spin 1s linear infinite;
}

.animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}

.fade-in {
  animation: fadeIn 0.5s ease-out forwards;
}

.fade-in-up {
  animation: fadeInUp 0.5s ease-out forwards;
}

/* ============================================
   Custom Scrollbar
   ============================================ */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}
/* ============================================
   Prose Overrides for Legal Pages
   ============================================ */

.prose {
  max-width: 65ch;
  color: var(--padel-text);
}

.prose :where(h1):not(:where([class~="not-prose"] *)) {
  color: var(--padel-text);
  font-weight: 800;
  font-size: 2.25rem;
  line-height: 1.2;
  margin-bottom: 0.5em;
}

.prose :where(h2):not(:where([class~="not-prose"] *)) {
  color: var(--padel-text);
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.3;
  margin-top: 2em;
  margin-bottom: 0.75em;
}

.prose :where(h3):not(:where([class~="not-prose"] *)) {
  color: var(--padel-text);
  font-weight: 600;
  font-size: 1.25rem;
  line-height: 1.4;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

.prose :where(p):not(:where([class~="not-prose"] *)) {
  margin-bottom: 1em;
  line-height: 1.7;
}

.prose :where(ul):not(:where([class~="not-prose"] *)) {
  list-style-type: disc;
  padding-left: 1.5em;
  margin-bottom: 1em;
}

.prose :where(ol):not(:where([class~="not-prose"] *)) {
  list-style-type: decimal;
  padding-left: 1.5em;
  margin-bottom: 1em;
}

.prose :where(li):not(:where([class~="not-prose"] *)) {
  margin-bottom: 0.5em;
}

.prose :where(a):not(:where([class~="not-prose"] *)) {
  color: var(--tw-primary);
  text-decoration: underline;
}

.prose :where(a):not(:where([class~="not-prose"] *)):hover {
  color: var(--ion-color-primary-tint);
}

.prose :where(blockquote):not(:where([class~="not-prose"] *)) {
  border-left: 4px solid var(--tw-primary);
  padding-left: 1em;
  font-style: italic;
  color: #64748b;
}

/* ============================================
   Responsive Tweaks
   ============================================ */

@media (max-width: 640px) {
  .prose {
    font-size: 0.95rem;
  }
  
  .prose :where(h1):not(:where([class~="not-prose"] *)) {
    font-size: 1.875rem;
  }
  
  .prose :where(h2):not(:where([class~="not-prose"] *)) {
    font-size: 1.375rem;
  }
  
  .prose :where(h3):not(:where([class~="not-prose"] *)) {
    font-size: 1.125rem;
  }
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
  body {
    background: white !important;
    color: black !important;
  }
  
  header, footer, .no-print {
    display: none !important;
  }
  
  #main-content {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
  }
}

/* ============================================
   Accessibility
   ============================================ */

:focus-visible {
  outline: 2px solid var(--tw-primary);
  outline-offset: 2px;
}

/* Skip link for screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sr-only:focus {
  position: static;
  width: auto;
  height: auto;
  padding: 8px 16px;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* ============================================
   Dark Mode Support (Optional)
   ============================================ */

@media (prefers-color-scheme: dark) {
  body {
    background: var(--primary-900);
    color: rgba(255, 255, 255, 0.9);
  }
}

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

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(22, 73, 58, 0.2);
  border-top-color: var(--tw-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ============================================
   Utility Classes
   ============================================ */

.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;
}

.transition-shadow {
  transition-property: box-shadow;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

.transition-transform {
  transition-property: transform;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

.hover\:shadow-lg:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

.hover\:shadow-xl:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.hover\:-translate-y-1:hover {
  transform: translateY(-4px);
}

/* Shadow utilities matching app */
.shadow-card {
  box-shadow: 0 1px 2px rgba(22, 73, 58, 0.04), 0 8px 24px -12px rgba(22, 73, 58, 0.16);
}

.shadow-card-hover {
  box-shadow: 0 2px 4px rgba(22, 73, 58, 0.05), 0 16px 40px -12px rgba(22, 73, 58, 0.24);
}

.shadow-accent-soft {
  box-shadow: 0 8px 20px -6px rgba(244, 87, 52, 0.45);
}

.shadow-primary-soft {
  box-shadow: 0 8px 20px -6px rgba(22, 73, 58, 0.35);
}

/* ================================================
   MODERN RESPONSIVE HERO CARDS (OPTION 1 REFINED)
   ================================================ */
.hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 30px 10px;
}

.hero-cards-stack {
    position: relative;
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    perspective: 1000px;
}

.hero-float-card {
    background: var(--padel-surface, #ffffff);
    border: 1px solid rgba(var(--tw-primary), 0.15);
    border-radius: 24px;
    padding: 22px;
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.08), 0 0 15px rgba(var(--tw-primary), 0.04);
    color: var(--padel-text, #0f172a);
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hero-float-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.12);
}

.card-main {
    transform: rotate(-1.5deg);
    animation: floatCard1 6s ease-in-out infinite;
    z-index: 2;
}

.card-secondary {
    transform: rotate(2deg);
    margin-left: 24px;
    animation: floatCard2 6s ease-in-out infinite 1s;
    z-index: 1;
}

.card-header-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.card-icon-badge {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(var(--tw-primary), 0.15), rgba(var(--tw-primary), 0.05));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.badge-trophy {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.05));
}

.card-title {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -0.01em;
}

.card-subtitle {
    font-size: 0.775rem;
    color: #64748b;
    margin-top: 2px;
}

.card-users-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
}

.user-bubble {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: rgb(var(--tw-primary)) !important;
    color: #ffffff !important;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--padel-surface, #ffffff);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.user-empty {
    background-color: #f1f5f9 !important;
    color: #64748b !important;
    border: 2px dashed #cbd5e1 !important;
    box-shadow: none !important;
}

.spots-left {
    font-size: 0.775rem;
    color: #10b981;
    font-weight: 700;
    margin-left: auto;
    background: rgba(16, 185, 129, 0.1);
    padding: 4px 10px;
    border-radius: 20px;
}

.card-action-btn {
    width: 100%;
    padding: 12px;
    background: var(--tw-primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(var(--tw-primary), 0.25);
}

.card-action-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

@keyframes floatCard1 {
    0%, 100% { transform: translateY(0) rotate(-1.5deg); }
    50% { transform: translateY(-8px) rotate(-0.5deg); }
}

@keyframes floatCard2 {
    0%, 100% { transform: translateY(0) rotate(2deg); }
    50% { transform: translateY(-6px) rotate(1deg); }
}

/* Responsive adjustments for mobile devices */
@media (max-width: 768px) {
    .hero-visual {
        padding: 10px 0;
        display: flex !important;
        width: 100%;
        margin-top: 30px;
    }

    .hero-cards-stack {
        max-width: 100%;
        padding: 0 10px;
    }

    .card-secondary {
        margin-left: 12px; /* Reduces excessive offset on small phone screens */
    }

    .hero-float-card {
        padding: 16px;
        border-radius: 20px;
    }
}