/**
 * TripDust Yacht Charter - UX Enhancements
 * Animations, loading states, and micro-interactions
 * Note: Social proof styles are now in the centralized social-proof module
 */

/* ========================================
   REVIEWS SECTION
   ======================================== */

/* Reviews Section */
.tdyacht-reviews-section {
    margin: var(--yacht-spacing-2xl) 0;
    padding: var(--yacht-spacing-2xl) var(--yacht-spacing-lg);
    background: linear-gradient(to bottom, var(--yacht-gray-100), var(--yacht-white));
    border-radius: var(--yacht-radius-md);
}

.tdyacht-reviews-section h3 {
    font-family: 'Playfair Display', serif;
    font-size: 32px;
    font-weight: 700;
    color: var(--yacht-primary);
    text-align: center;
    margin-bottom: var(--yacht-spacing-xl);
}

.tdyacht-reviews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--yacht-spacing-lg);
    max-width: 1200px;
    margin: 0 auto;
}

.tdyacht-review-card {
    background: var(--yacht-white);
    border: 1px solid var(--yacht-gray-200);
    border-radius: var(--yacht-radius);
    padding: var(--yacht-spacing-lg);
    box-shadow: var(--yacht-shadow);
    transition: all 0.3s ease;
}

.tdyacht-review-card:hover {
    box-shadow: var(--yacht-shadow-md);
    transform: translateY(-2px);
}

.tdyacht-review-stars {
    color: var(--yacht-accent);
    font-size: 18px;
    margin-bottom: var(--yacht-spacing-sm);
    letter-spacing: 2px;
}

.tdyacht-review-text {
    font-size: 15px;
    color: var(--yacht-gray-700);
    line-height: 1.6;
    margin-bottom: var(--yacht-spacing);
    font-style: italic;
}

.tdyacht-review-author {
    display: flex;
    align-items: center;
    gap: var(--yacht-spacing);
    padding-top: var(--yacht-spacing);
    border-top: 1px solid var(--yacht-gray-200);
}

.tdyacht-review-author img {
    width: 40px;
    height: 40px;
    border-radius: var(--yacht-radius-full);
    object-fit: cover;
}

.tdyacht-review-name {
    font-weight: 700;
    color: var(--yacht-gray-900);
    font-size: 14px;
}

.tdyacht-review-date {
    font-size: 12px;
    color: var(--yacht-gray-500);
}

/* Urgency Banner */
.tdyacht-urgency-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--yacht-spacing-sm);
    padding: var(--yacht-spacing);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.05));
    border: 1px solid var(--yacht-warning);
    border-radius: var(--yacht-radius);
    margin: var(--yacht-spacing-lg) 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--yacht-gray-900);
    animation: pulse 2s ease-in-out infinite;
}

.tdyacht-urgency-banner svg {
    width: 20px;
    height: 20px;
    color: var(--yacht-warning);
    flex-shrink: 0;
}

.tdyacht-urgency-banner strong {
    color: var(--yacht-warning);
}

/* ========================================
   LOADING STATES
   ======================================== */

.tdyacht-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-radius: var(--yacht-radius);
}

.tdyacht-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--yacht-gray-200);
    border-top-color: var(--yacht-accent);
    border-radius: var(--yacht-radius-full);
    animation: spin 0.8s linear infinite;
}

.tdyacht-spinner-small {
    width: 24px;
    height: 24px;
    border-width: 3px;
}

/* Button Loading State */
.tdpb-btn.is-loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.tdpb-btn.is-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: var(--yacht-radius-full);
    animation: spin 0.6s linear infinite;
    opacity: 0.7;
}

/* Skeleton Loader */
.tdyacht-skeleton {
    background: linear-gradient(90deg, var(--yacht-gray-200) 25%, var(--yacht-gray-300) 50%, var(--yacht-gray-200) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--yacht-radius-sm);
}

.tdyacht-skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.tdyacht-skeleton-heading {
    height: 24px;
    margin-bottom: 12px;
    width: 60%;
}

/* ========================================
   FORM VALIDATION & FEEDBACK
   ======================================== */

.tdpb-input.is-valid {
    border-color: var(--yacht-success);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23059669'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5 13l4 4L19 7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
}

.tdpb-input.is-invalid {
    border-color: var(--yacht-error);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23DC2626'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M6 18L18 6M6 6l12 12'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
}

.tdyacht-field-error {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--yacht-error);
    font-size: 13px;
    margin-top: 6px;
    animation: shake 0.3s ease-in-out;
}

.tdyacht-field-error svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.tdyacht-field-success {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--yacht-success);
    font-size: 13px;
    margin-top: 6px;
}

.tdyacht-field-success svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ========================================
   TOOLTIPS
   ======================================== */

.tdyacht-tooltip-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: var(--yacht-radius-full);
    background: var(--yacht-gray-300);
    color: var(--yacht-white);
    font-size: 12px;
    font-weight: 700;
    cursor: help;
    transition: all 0.2s ease;
}

.tdyacht-tooltip-trigger:hover {
    background: var(--yacht-accent);
    transform: scale(1.1);
}

.tdyacht-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--yacht-gray-900);
    color: var(--yacht-white);
    padding: 8px 12px;
    border-radius: var(--yacht-radius-sm);
    font-size: 13px;
    line-height: 1.4;
    white-space: nowrap;
    box-shadow: var(--yacht-shadow-lg);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.tdyacht-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--yacht-gray-900);
}

.tdyacht-tooltip-trigger:hover .tdyacht-tooltip {
    opacity: 1;
}

/* ========================================
   MICRO-INTERACTIONS
   ======================================== */

/* Hover Effects */
.tdyacht-hover-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tdyacht-hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: var(--yacht-shadow-md);
}

/* Click Ripple Effect */
.tdyacht-ripple {
    position: relative;
    overflow: hidden;
}

.tdyacht-ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: var(--yacht-radius-full);
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.tdyacht-ripple:active::after {
    width: 200px;
    height: 200px;
}

/* Success Animation */
.tdyacht-success-checkmark {
    width: 60px;
    height: 60px;
    border-radius: var(--yacht-radius-full);
    background: var(--yacht-success);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--yacht-spacing);
    animation: scaleIn 0.4s ease-out;
}

.tdyacht-success-checkmark svg {
    width: 36px;
    height: 36px;
    color: var(--yacht-white);
    stroke-width: 3;
}

/* Badge Pulse */
.tdyacht-badge-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Number Counter Animation */
.tdyacht-counter {
    font-variant-numeric: tabular-nums;
    transition: all 0.3s ease;
}

/* ========================================
   ENHANCED MOBILE INTERACTIONS
   ======================================== */

/* Touch Feedback */
@media (hover: none) and (pointer: coarse) {
    .tdpb-btn:active {
        transform: scale(0.98);
    }

    .tdyacht-card-option:active {
        background: var(--yacht-gray-100);
    }

    .tdyacht-counter-btn:active {
        background: var(--yacht-gray-300);
    }
}

/* Swipe Indicator */
.tdyacht-swipe-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: var(--yacht-radius);
    margin: var(--yacht-spacing) 0;
    font-size: 13px;
    color: var(--yacht-gray-600);
}

.tdyacht-swipe-indicator svg {
    width: 20px;
    height: 20px;
    animation: swipeLeft 1.5s ease-in-out infinite;
}

/* ========================================
   ANIMATIONS & KEYFRAMES
   ======================================== */

@keyframes slideInFromLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

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

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

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

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-4px);
    }
    75% {
        transform: translateX(4px);
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes swipeLeft {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(-8px);
    }
}

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

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

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */

@media (max-width: 900px) {
    .tdyacht-reviews-grid {
        grid-template-columns: 1fr;
    }

    .tdyacht-tooltip {
        white-space: normal;
        max-width: 200px;
    }
}

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

/* Focus Visible */
.tdpb-btn:focus-visible,
.tdpb-input:focus-visible {
    outline: 2px solid var(--yacht-accent);
    outline-offset: 2px;
}

/* Reduce Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .tdpb-btn {
        border-width: 2px;
    }
}
