/* These styles are generated from project.scss. */

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

.alert-debug {
  color: black;
  background-color: white;
  border-color: #d6e9c6;
}

.alert-error {
  color: #b94a48;
  background-color: #f2dede;
  border-color: #eed3d7;
}

#div_id_remember {
  display: none;
}

.bg-pf-green {
  background-color: #007a33;
}

.text-pf-green {
  color: #007a33;
}

.border-pf-green {
  border-color: #007a33;
}

.hover\:bg-green-700:hover {
  background-color: #15803d;
}

.ring-pf-green {
  --tw-ring-color: #007a33;
}

/* Radio button styling */
.candidate-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.candidate-option:hover {
  transform: translateY(-1px);
}

.candidate-option.selected {
  border-color: #007a33 !important;
  background-color: #f0fdf4 !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.custom-radio {
  position: relative;
}

.custom-radio input[type="radio"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.custom-radio .radio-circle {
  width: 1rem;
  height: 1rem;
  border: 2px solid #d1d5db;
  border-radius: 50%;
  background: white;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.custom-radio input[type="radio"]:checked + .radio-circle {
  border-color: #007a33;
  background-color: #007a33;
}

.custom-radio input[type="radio"]:checked + .radio-circle::after {
  content: '';
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: white;
}

.custom-radio:hover .radio-circle {
  border-color: #007a33;
}

/* Candidate Card Selection States */
.candidate-card {
  transition: all 0.3s ease;
}

.candidate-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.candidate-card.selected {
  border-color: #007a33 !important;
  background-color: #f0fdf4 !important;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

.candidate-card.selected-vp {
  border-color: #2563eb !important;
  background-color: #eff6ff !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Form styling consistency */
.form-section {
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 2rem;
  margin-bottom: 2rem;
}

/* Progress bar */
.bg-pf-green {
  background-color: #007a33;
}

.text-pf-green {
  color: #007a33;
}

.border-pf-green {
  border-color: #007a33;
}

.hover\:bg-green-700:hover {
  background-color: #15803d;
}

.ring-pf-green {
  --tw-ring-color: #007a33;
}


.candidate-card.selected {
  border-color: #007a33 !important;
  background-color: #f0fdf4 !important;
}


/* VP Candidate Card Styling */
.vp-candidate-card input[type="radio"]:checked + .custom-radio .w-5 > div {
  opacity: 1;
}

.vp-candidate-card.selected-vp {
  border-color: #2563eb !important;
  background-color: #eff6ff !important;
}

.vp-candidate-card {
  transition: all 0.3s ease;
}

.vp-candidate-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* Custom Radio Button Styling for Demographics */
.demographic-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.demographic-option:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.demographic-option.selected {
    border-color: #10b981 !important;
    background-color: #f0fdf4 !important;
}

/* Form section spacing */
.space-y-6 > * + * {
    margin-top: 1.5rem;
}

/* Radio button animations */
.radio-dot {
    transition: opacity 0.2s ease-in-out;
}

.radio-circle {
    transition: border-color 0.2s ease-in-out;
}

/* Info boxes */
.bg-blue-50 {
    background-color: #eff6ff;
}

.bg-green-50 {
    background-color: #f0fdf4;
}

.border-blue-200 {
    border-color: #bfdbfe;
}

.border-green-200 {
    border-color: #bbf7d0;
}

.text-blue-800 {
    color: #1e40af;
}

.text-green-800 {
    color: #166534;
}

.my-indicator{
  display:none;
  opacity:0;
  transition: opacity 500ms ease-in;
}
.htmx-request .my-indicator{
  display:initial;
  opacity:1;
}
.htmx-request.my-indicator{
  display:initial;
  opacity:1;
}

/* Method 1: Fade out content during HTMX requests */
.loading-content {
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
    transform-origin: center;
}

.loading-content.htmx-request {
    opacity: 0.25;
    transform: scale(0.98);
    pointer-events: none;
    filter: brightness(0.9) saturate(0.8);
}

.loading-content.htmx-request::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.05) 50%,
        rgba(255, 255, 255, 0.1) 100%
    );
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    animation: loadingShimmer 2s ease-in-out infinite;
    z-index: 1;
}

/* Enhanced loading, @anas aarabn */

.loading-content-enhanced {
    position: relative;
    transition: all 0.45s cubic-bezier(0.23, 1, 0.32, 1);
    isolation: isolate;
}

.loading-content-enhanced.htmx-request {
    opacity: 0.3;
    transform: scale(0.985) translateY(-2px);
    pointer-events: none;
    filter: contrast(0.9) saturate(0.8);
}

.loading-content-enhanced.htmx-request::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: linear-gradient(
        45deg,
        rgba(16, 185, 129, 0.03) 0%,
        rgba(16, 185, 129, 0.01) 50%,
        rgba(16, 185, 129, 0.03) 100%
    );
    border-radius: 16px;
    opacity: 0;
    animation: backdropPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    z-index: -1;
}

/* Method 2: Completely hide content during HTMX requests */
.hide-on-load.htmx-request {
    visibility: hidden;
}

/* Method 3: Blur content during loading */
.blur-on-load {
    position: relative;
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform-origin: center;
    backface-visibility: hidden;
    perspective: 1000px;
}

.blur-on-load.htmx-request {
    filter: blur(4px) saturate(0.7) brightness(0.95);
    opacity: 0.4;
    transform: scale(0.99) translateZ(0);
    pointer-events: none;
}

.blur-on-load.htmx-request::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(
        circle at center,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.05) 40%,
        transparent 70%
    );
    border-radius: inherit;
    pointer-events: none;
    animation: pulseOverlay 1.5s ease-in-out infinite alternate;
    z-index: 2;
}

.blur-premium {
    position: relative;
    transition: all 0.6s cubic-bezier(0.19, 1, 0.22, 1);
    transform-style: preserve-3d;
}

.blur-premium.htmx-request {
    filter: blur(6px) saturate(0.6) brightness(0.9) contrast(1.1);
    opacity: 0.35;
    transform: scale(0.97) perspective(1000px) rotateX(1deg);
    pointer-events: none;
}

.blur-premium.htmx-request::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.15) 0%,
            transparent 30%,
            transparent 70%,
            rgba(255, 255, 255, 0.1) 100%
        ),
        radial-gradient(
            circle at 30% 30%,
            rgba(16, 185, 129, 0.08) 0%,
            transparent 50%
        );
    border-radius: inherit;
    opacity: 0;
    animation: premiumShimmer 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    z-index: 1;
}

/* Keyframe Animations */
@keyframes loadingShimmer {
    0%, 100% {
        opacity: 0;
        transform: translateX(-100%);
    }
    50% {
        opacity: 1;
        transform: translateX(100%);
    }
}

@keyframes pulseOverlay {
    0% {
        opacity: 0;
        transform: scale(1);
    }
    100% {
        opacity: 1;
        transform: scale(1.02);
    }
}

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

@keyframes premiumShimmer {
    0% {
        opacity: 0;
        transform: translateX(-100%) skewX(-15deg);
    }
    25% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.8;
        transform: translateX(0%) skewX(-15deg);
    }
    75% {
        opacity: 0.3;
    }
    100% {
        opacity: 0;
        transform: translateX(100%) skewX(-15deg);
    }
}

/* Accessibility - Respect motion preferences */
@media (prefers-reduced-motion: reduce) {
    .loading-content,
    .blur-on-load,
    .loading-content-enhanced,
    .blur-premium {
        transition: opacity 0.2s ease;
    }

    .loading-content.htmx-request,
    .loading-content-enhanced.htmx-request {
        transform: none;
        filter: none;
    }

    .blur-on-load.htmx-request,
    .blur-premium.htmx-request {
        filter: blur(2px);
        transform: none;
    }

    .loading-content.htmx-request::before,
    .blur-on-load.htmx-request::after,
    .loading-content-enhanced.htmx-request::before,
    .blur-premium.htmx-request::before {
        animation: none;
        opacity: 0.5;
    }
}

/* Performance optimizations */
.loading-content,
.blur-on-load,
.loading-content-enhanced,
.blur-premium {
    will-change: transform, opacity, filter;
    contain: layout style paint;
}

/* Loading spinner overlay for enhanced variants */
.loading-content-enhanced.htmx-request::after,
.blur-premium.htmx-request::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 2px solid rgba(16, 185, 129, 0.3);
    border-top: 2px solid rgba(16, 185, 129, 0.8);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 3;
    opacity: 0;
    animation-delay: 0.3s;
    animation-fill-mode: both;
}

@keyframes spin {
    0% {
        opacity: 0;
        transform: rotate(0deg) scale(0.8);
    }
    10% {
        opacity: 1;
        transform: rotate(36deg) scale(1);
    }
    90% {
        opacity: 1;
        transform: rotate(324deg) scale(1);
    }
    100% {
        opacity: 0;
        transform: rotate(360deg) scale(0.8);
    }
}

/* Method 4: Scale down content during loading */
.scale-on-load.htmx-request {
    transform: scale(0.95);
    opacity: 0.5;
    pointer-events: none;
    transition: all 0.2s ease;
}

#send-otp-spinner.htmx-request{ display: initial !important;}
