/**
 * Developer Feedback Slider - Styles
 * Beautiful animated slider for Upwork client feedback
 */

/* Container */
.feedback-slider-container {
    position: relative;
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(0, 119, 194, 0.1);
}

/* Decorative Glow */
.slider-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle at center,
        rgba(0, 119, 194, 0.08) 0%,
        transparent 50%
    );
    pointer-events: none;
    z-index: 0;
    animation: glowPulse 4s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

/* Decorative Frame */
.slider-frame {
    position: absolute;
    inset: 8px;
    border: 2px solid rgba(0, 119, 194, 0.1);
    border-radius: 12px;
    pointer-events: none;
    z-index: 5;
}

.frame-corner {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid #0077c2;
    z-index: 6;
}

.frame-corner.top-left {
    top: -2px;
    left: -2px;
    border-right: none;
    border-bottom: none;
    border-radius: 8px 0 0 0;
}

.frame-corner.top-right {
    top: -2px;
    right: -2px;
    border-left: none;
    border-bottom: none;
    border-radius: 0 8px 0 0;
}

.frame-corner.bottom-left {
    bottom: -2px;
    left: -2px;
    border-right: none;
    border-top: none;
    border-radius: 0 0 0 8px;
}

.frame-corner.bottom-right {
    bottom: -2px;
    right: -2px;
    border-left: none;
    border-top: none;
    border-radius: 0 0 8px 0;
}

/* Main Slider */
.feedback-slider {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    z-index: 1;
}

/* Individual Slides */
.feedback-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    transition: opacity 0.8s ease, transform 0.8s ease, visibility 0.8s;
}

.feedback-slide img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.feedback-slide.active {
    opacity: 1;
    visibility: visible;
}

/* Animation: Fade (Default) */
[data-animation="fade"] .feedback-slide {
    transform: scale(1);
}

[data-animation="fade"] .feedback-slide.active {
    animation: fadeIn 0.8s ease forwards;
}

[data-animation="fade"] .feedback-slide.exit {
    animation: fadeOut 0.8s ease forwards;
}

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

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

/* Animation: Slide */
[data-animation="slide"] .feedback-slide {
    transform: translateX(100%);
}

[data-animation="slide"] .feedback-slide.active {
    transform: translateX(0);
    animation: slideIn 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

[data-animation="slide"] .feedback-slide.exit-left {
    animation: slideOutLeft 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

[data-animation="slide"] .feedback-slide.exit-right {
    animation: slideOutRight 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

[data-animation="slide"] .feedback-slide.enter-left {
    animation: slideInLeft 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

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

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

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

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

/* Animation: Zoom */
[data-animation="zoom"] .feedback-slide {
    transform: scale(0.5);
}

[data-animation="zoom"] .feedback-slide.active {
    animation: zoomIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

[data-animation="zoom"] .feedback-slide.exit {
    animation: zoomOut 0.6s ease forwards;
}

@keyframes zoomIn {
    from { transform: scale(0.5) rotate(-5deg); opacity: 0; }
    to { transform: scale(1) rotate(0); opacity: 1; }
}

@keyframes zoomOut {
    from { transform: scale(1) rotate(0); opacity: 1; }
    to { transform: scale(0.5) rotate(5deg); opacity: 0; }
}

/* Animation: Flip */
[data-animation="flip"] .feedback-slide {
    transform: rotateY(-90deg);
    transform-style: preserve-3d;
    backface-visibility: hidden;
}

[data-animation="flip"] .feedback-slider {
    perspective: 1000px;
}

[data-animation="flip"] .feedback-slide.active {
    animation: flipIn 0.8s ease forwards;
}

[data-animation="flip"] .feedback-slide.exit {
    animation: flipOut 0.8s ease forwards;
}

@keyframes flipIn {
    from { transform: rotateY(-90deg); opacity: 0; }
    to { transform: rotateY(0); opacity: 1; }
}

@keyframes flipOut {
    from { transform: rotateY(0); opacity: 1; }
    to { transform: rotateY(90deg); opacity: 0; }
}

/* Progress Bar */
.slider-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(0, 119, 194, 0.1);
    z-index: 10;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #0077c2, #00a8e8);
    transition: width 0.1s linear;
    box-shadow: 0 0 10px rgba(0, 119, 194, 0.5);
}

.progress-bar.animating {
    animation: progressFill var(--speed, 4000ms) linear forwards;
}

@keyframes progressFill {
    from { width: 0%; }
    to { width: 100%; }
}

/* Navigation Arrows */
.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.slider-arrow:hover {
    background: #0077c2;
    transform: translateY(-50%) scale(1.1);
}

.slider-arrow:hover svg {
    stroke: #fff;
}

.slider-arrow svg {
    width: 18px;
    height: 18px;
    stroke: #333;
    transition: stroke 0.3s ease;
}

.slider-arrow.prev {
    left: 10px;
}

.slider-arrow.next {
    right: 10px;
}

/* Slide Counter */
.slide-counter {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(255, 255, 255, 0.95);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    z-index: 20;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.slide-counter .current {
    color: #0077c2;
    font-size: 16px;
}

.slide-counter .separator {
    margin: 0 4px;
    color: #999;
}

.slide-counter .total {
    color: #666;
}

/* Upwork Badge */
.upwork-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #14a800, #0f8000);
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    z-index: 20;
    box-shadow: 0 4px 15px rgba(20, 168, 0, 0.3);
    animation: badgePulse 2s ease-in-out infinite;
}

.upwork-badge i {
    font-size: 14px;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .feedback-slider-container {
        max-width: 100%;
        width: 100%;
        border-radius: 12px;
        display: block !important;
        visibility: visible !important;
    }

    .feedback-slider {
        aspect-ratio: 4 / 3;
    }

    .feedback-slide {
        padding: 6px;
    }

    .slide-counter {
        top: 10px;
        left: 10px;
        padding: 6px 12px;
        font-size: 12px;
    }

    .slide-counter .current {
        font-size: 14px;
    }

    .upwork-badge {
        top: 10px;
        right: 10px;
        padding: 6px 12px;
        font-size: 11px;
    }

    .upwork-badge span {
        display: none;
    }

    .frame-corner {
        width: 15px;
        height: 15px;
    }
}

@media (max-width: 480px) {
    .feedback-slider {
        aspect-ratio: 1 / 1;
    }
}

/* Pause on hover */
.feedback-slider-container:hover .progress-bar.animating {
    animation-play-state: paused;
}

/* Touch feedback */
.feedback-slider-container.touching {
    cursor: grabbing;
}

/* Loading state */
.feedback-slide img {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: imageLoading 1.5s infinite;
}

.feedback-slide img[src] {
    animation: none;
    background: transparent;
}

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

/* Mobile Image Popup */
@media (max-width: 767px) {
    .feedback-slide img {
        cursor: zoom-in;
    }

    body.popup-open {
        overflow: hidden;
    }

    .feedback-image-popup {
        position: fixed;
        inset: 0;
        z-index: 99999;
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    .feedback-image-popup.active {
        opacity: 1;
        visibility: visible;
    }

    .feedback-image-popup .popup-overlay {
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.9);
        backdrop-filter: blur(10px);
    }

    .feedback-image-popup .popup-content {
        position: relative;
        z-index: 1;
        max-width: 95vw;
        max-height: 90vh;
        transform: scale(0.9);
        transition: transform 0.3s ease;
    }

    .feedback-image-popup.active .popup-content {
        transform: scale(1);
    }

    .feedback-image-popup .popup-content img {
        max-width: 100%;
        max-height: 85vh;
        border-radius: 8px;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    }

    .feedback-image-popup .popup-close {
        position: absolute;
        top: -40px;
        right: 0;
        width: 36px;
        height: 36px;
        background: rgba(255, 255, 255, 0.9);
        border: none;
        border-radius: 50%;
        font-size: 24px;
        line-height: 1;
        color: #333;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    }

    .feedback-image-popup .popup-close:hover {
        background: #fff;
    }

    .feedback-image-popup .popup-nav {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 44px;
        height: 44px;
        background: rgba(255, 255, 255, 0.9);
        border: none;
        border-radius: 50%;
        font-size: 18px;
        color: #333;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 10;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
        transition: all 0.2s ease;
    }

    .feedback-image-popup .popup-nav:active {
        transform: translateY(-50%) scale(0.95);
        background: #fff;
    }

    .feedback-image-popup .popup-prev {
        left: 10px;
    }

    .feedback-image-popup .popup-next {
        right: 10px;
    }

    .feedback-image-popup .popup-counter {
        text-align: center;
        margin-top: 15px;
        color: #fff;
        font-size: 14px;
        font-weight: 500;
    }

    .feedback-image-popup .popup-counter .current {
        color: #0077c2;
        font-weight: 700;
    }

    .feedback-image-popup .popup-content img {
        transition: opacity 0.15s ease;
    }
}
