/**
 * UI Enhancements for GQRC Plugin
 * Smooth transitions, animations, and improved visual feedback
 */

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

.gqrc-modal-overlay {
    animation: gqrc-fade-in 0.3s ease;
}

.gqrc-modal-overlay.active .gqrc-modal-content {
    animation: gqrc-slide-up 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes gqrc-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes gqrc-slide-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modal Close with Scale */
.gqrc-modal-close {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.gqrc-modal-close:hover {
    transform: scale(1.1) rotate(90deg);
}

/* ============================================
   CARD HOVER ENHANCEMENTS
   ============================================ */

.gqrc-review-card {
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform, box-shadow;
}

.gqrc-review-card:hover {
    transform: scale(1.05) translateY(-8px);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.7),
        0 0 0 1px rgba(255, 255, 255, 0.1);
}

.gqrc-review-card:active {
    transform: scale(1.02) translateY(-4px);
}

/* Card Image Zoom Effect - DISABLED to prevent double zoom */
/* Only the card itself should scale, not the content inside */

/* Badge Pulse on Hover - DISABLED */
.gqrc-card-badge {
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(74, 222, 128, 0.4);
}

/* ============================================
   HERO SLIDER ENHANCEMENTS
   ============================================ */

.gqrc-hero-slide {
    transition: opacity 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hero Button Animations */
.gqrc-hero-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.gqrc-hero-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.gqrc-hero-btn:hover::before {
    left: 100%;
}

.gqrc-hero-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.gqrc-hero-btn:active {
    transform: translateY(0);
}

/* Hero Indicators Enhanced */
.gqrc-hero-indicator {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.gqrc-hero-indicator:hover {
    transform: scale(1.2);
    background: rgba(255, 255, 255, 0.7);
}

/* ============================================
   SCROLL BUTTON ANIMATIONS
   ============================================ */

.gqrc-scroll-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.gqrc-scroll-btn:hover {
    transform: translateY(-50%) scale(1.1);
}

.gqrc-scroll-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.gqrc-scroll-left:hover {
    animation: gqrc-pulse-left 0.8s ease infinite;
}

.gqrc-scroll-right:hover {
    animation: gqrc-pulse-right 0.8s ease infinite;
}

@keyframes gqrc-pulse-left {
    0%, 100% { transform: translateY(-50%) translateX(0); }
    50% { transform: translateY(-50%) translateX(-5px); }
}

@keyframes gqrc-pulse-right {
    0%, 100% { transform: translateY(-50%) translateX(0); }
    50% { transform: translateY(-50%) translateX(5px); }
}

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

/* Search Toggle Ripple Effect */
.gqrc-search-toggle {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.gqrc-search-toggle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.gqrc-search-toggle:active::after {
    width: 100%;
    height: 100%;
}

/* Search Input Slide In */
.gqrc-search-input-wrapper {
    animation: gqrc-slide-in-right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes gqrc-slide-in-right {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Search Results Stagger Animation */
.gqrc-search-results-grid .gqrc-review-card {
    animation: gqrc-fade-in-up 0.4s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.gqrc-search-results-grid .gqrc-review-card:nth-child(1) { animation-delay: 0.05s; }
.gqrc-search-results-grid .gqrc-review-card:nth-child(2) { animation-delay: 0.1s; }
.gqrc-search-results-grid .gqrc-review-card:nth-child(3) { animation-delay: 0.15s; }
.gqrc-search-results-grid .gqrc-review-card:nth-child(4) { animation-delay: 0.2s; }
.gqrc-search-results-grid .gqrc-review-card:nth-child(5) { animation-delay: 0.25s; }
.gqrc-search-results-grid .gqrc-review-card:nth-child(6) { animation-delay: 0.3s; }

@keyframes gqrc-fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Sort Buttons */
.gqrc-sort-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.gqrc-sort-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: rgba(74, 222, 128, 0.1);
    transform: scale(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.gqrc-sort-btn:hover::before {
    transform: scale(1);
}

.gqrc-sort-btn.active {
    animation: gqrc-bounce-in 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes gqrc-bounce-in {
    0% { transform: scale(0.8); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* ============================================
   FOCUS STATES (ACCESSIBILITY)
   ============================================ */

/* Remove default outline and add custom focus */
.gqrc-review-card:focus,
.gqrc-search-toggle:focus,
.gqrc-hero-btn:focus,
.gqrc-sort-btn:focus,
.gqrc-scroll-btn:focus {
    outline: none;
}

.gqrc-review-card:focus-visible {
    outline: 3px solid #4ade80;
    outline-offset: 4px;
    border-radius: 8px;
    box-shadow: 0 0 0 6px rgba(74, 222, 128, 0.2);
}

.gqrc-search-toggle:focus-visible {
    outline: 3px solid #4ade80;
    outline-offset: 2px;
    box-shadow: 0 0 0 6px rgba(74, 222, 128, 0.2);
}

.gqrc-hero-btn:focus-visible {
    outline: 3px solid #4ade80;
    outline-offset: 2px;
    box-shadow: 0 0 0 6px rgba(74, 222, 128, 0.3);
}

.gqrc-sort-btn:focus-visible {
    outline: 2px solid #4ade80;
    outline-offset: 2px;
}

.gqrc-search-input:focus {
    outline: none;
    border-color: #4ade80;
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.2);
}

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

/* Spinner Rotation */
.fa-spinner {
    animation: gqrc-spin 1s linear infinite;
}

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

/* Pulsing Effect for Loading States */
.gqrc-modal-loading {
    animation: gqrc-pulse-opacity 1.5s ease-in-out infinite;
}

@keyframes gqrc-pulse-opacity {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ============================================
   MOBILE OPTIMIZATIONS
   ============================================ */

@media (max-width: 900px) {
    /* Reduce animation intensity on mobile */
    .gqrc-review-card:hover {
        transform: scale(1.02) translateY(-4px);
    }

    /* Faster animations on mobile */
    .gqrc-modal-overlay.active .gqrc-modal-content {
        animation-duration: 0.3s;
    }

    .gqrc-search-results-grid .gqrc-review-card {
        animation-duration: 0.3s;
    }
}

@media (max-width: 600px) {
    /* Minimal animations on small screens */
    .gqrc-review-card:hover {
        transform: scale(1.01);
    }
}

/* ============================================
   REDUCED MOTION (ACCESSIBILITY)
   ============================================ */

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

    .gqrc-review-card:hover,
    .gqrc-hero-btn:hover,
    .gqrc-scroll-btn:hover {
        transform: none;
    }
}
