﻿@import url('popover.css');

/* Instagram-level Smooth Bottom Sheet */
.bottom-sheet {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.15s;
    will-change: opacity, visibility;
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
}

    .bottom-sheet.show {
        pointer-events: auto;
        opacity: 1;
        visibility: visible;
        transition: opacity 0.15s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear;
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        width: 100%;
        height: 100%;
    }

    .bottom-sheet .sheet-overlay {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0);
        transition: background-color 0.15s cubic-bezier(0.4, 0, 0.2, 1);
        will-change: background-color;
    }

    .bottom-sheet.show .sheet-overlay {
        background: rgba(0, 0, 0, 0.4);
    }

    .bottom-sheet .content {
        position: absolute;
        bottom: 0;
        left: 50%;
        width: 100%;
        max-width: 1150px;
        height: 75vh;
        max-height: 100vh;
        background: #fff;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.08), 0 -8px 40px rgba(0, 0, 0, 0.04);
        transform: translateX(-50%) translateY(100%) translateZ(0);
        transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        will-change: transform;
        padding: 0;
        overflow: hidden;
        /* Hardware acceleration */
        backface-visibility: hidden;
        perspective: 1000px;
    }

    .bottom-sheet.show .content {
        transform: translateX(-50%) translateY(0) translateZ(0);
    }

    .bottom-sheet.dragging .content {
        transition: none;
    }

    .bottom-sheet.fullscreen .content {
        border-radius: 0;
        overflow-y: hidden;
    }

    .bottom-sheet .header {
        width: 100%;
        height: 30px;
        display: flex;
        justify-content: center;
        align-items: center;
        margin-top: 13px;
        padding: 0 25px;
        position: relative;
        z-index: 1;
    }

.header .drag-icon {
    width: 40px;
    height: 4px;
    background: #C7D0E1;
    border-radius: 10px;
    cursor: grab;
    touch-action: none;
    user-select: none;
    transition: background-color 0.2s ease, transform 0.2s ease;
    will-change: background-color, transform;
}

    .header .drag-icon:hover {
        background: #a1a9b8;
        transform: scaleY(1.2);
    }

    .header .drag-icon:active {
        background: #8b95a6;
        cursor: grabbing;
    }

.bottom-sheet .body {
    height: calc(100% - 50px);
    overflow-y: auto;
    padding: 15px 30px 40px;
    scrollbar-width: none;
    transform: translateZ(0);
    /* Smooth momentum scrolling */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    /* Performance optimizations */
    will-change: scroll-position;
    contain: layout style paint;
}

    .bottom-sheet .body::-webkit-scrollbar {
        display: none;
    }

/* Micro-interactions for smooth feel */
.bottom-sheet .content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.06) 50%, transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.bottom-sheet.show .content::before {
    opacity: 1;
}

/* Enhanced fullscreen mode */
.bottom-sheet.fullscreen .content {
    border-radius: 0;
    height: 100vh;
    box-shadow: none;
}

.bottom-sheet.fullscreen .header .drag-icon {
    background: #8b95a6;
}

/* Spring-like bounce effect for over-drag */
@keyframes bounce-back {
    0% {
        transform: translateX(-50%) translateY(-5px) translateZ(0);
    }

    50% {
        transform: translateX(-50%) translateY(2px) translateZ(0);
    }

    100% {
        transform: translateX(-50%) translateY(0) translateZ(0);
    }
}

.bottom-sheet.bounce .content {
    animation: bounce-back 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.bottom-sheet .body h2 {
    font-size: 1.8rem;
}

.bottom-sheet .body p {
    margin-top: 0px;
    font-size: 0.9rem;
}

/* QR Sheet styles (keeping existing) */
.qr-sheet {
    position: absolute;
    top: 50px;
    left: 0;
    display: flex;
    pointer-events: none;
    z-index: 1000;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s linear 0.3s, opacity 0.3s ease;
}

    .qr-sheet.show {
        width: 100%;
        height: 100%;
        pointer-events: auto;
        visibility: visible;
        opacity: 1;
        transition: visibility 0s linear, opacity 0.3s ease;
    }

.qr-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.qr-sheet.show .qr-overlay {
    opacity: 1;
}

.qr-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #fff;
    border-radius: 20px 20px 0 0;
    transition: transform 0.3s ease;
    transform: translateY(100%);
}

.qr-sheet.show .qr-content {
    transform: translateY(0);
}

.qr-sheet.dragging .qr-content {
    transition: none;
}

.qr-header {
    width: 100%;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 13px;
}

.qr-drag-icon {
    width: 50px;
    height: 5px;
    background: #ccc;
    border-radius: 10px;
    cursor: grab;
    touch-action: none;
}

.qr-body {
    padding: 20px;
    max-height: calc(100vh - 50px);
    overflow-y: auto;
    scrollbar-width: none;
}

    .qr-body::-webkit-scrollbar {
        display: none;
    }

.qr-modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    text-align: center;
}

.qr-modal-content {
    display: flex;
    justify-content: center;
    align-items: center;
    /*padding: 0px 20px 20px;*/
}

    .qr-modal-content canvas, .qr-modal-content svg {
        min-width: 250px;
        min-height: 250px;
    }

.qr-skeleton {
    display: flex;
    justify-content: center;
    padding: 20px;
}

.qr-skeleton-box {
    width: 280px;
    height: 280px;
    background: #e0e0e0;
    border-radius: 10px;
    animation: pulse 1.5s ease-in-out infinite;
}

/* Rest of your existing styles */
.popup {
    position: fixed;
    left: 50%;
    bottom: -100%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    background: #ffffff;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.15);
    padding: 35px;
    z-index: 20000;
    display: none;
    overflow: hidden;
    opacity: 0;
}

.popup-content {
    text-align: center;
}

.popup-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    background: rgba(229, 231, 235, 0.8);
    border: none;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

    .popup-close-btn:hover {
        transform: scale(1.1);
    }

.popup-content.review-list {
    margin-top: 20px;
}

.qr-popup {
    position: fixed;
    left: 50%;
    bottom: -100%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    background: #ffffff;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.15);
    padding: 35px;
    z-index: 20000;
    display: none;
    overflow: hidden;
    opacity: 0;
    bottom: 0px;
}

    .qr-popup > button {
        font-size: 24px !important;
        padding: 1px 3px 0px 3px;
        font-weight: 100;
    }

.qr-popup-content canvas,
.qr-popup-content #canvas > svg {
    display: block;
    margin: 20px auto;
    width: 280px;
    height: 280px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.review-item {
    background: #ffffff;
    border: 1px solid #f0e4b0;
    border-radius: 10px;
    padding: 10px 18px;
    margin-bottom: 16px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

    .review-item:hover {
        transform: translateY(-6px);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18), 0 0 10px rgba(245, 224, 80, 0.4);
    }

    .review-item:last-child {
        margin-bottom: 0;
    }

.review-rating .star,
.rating-wrapper .star {
    font-size: 28px;
    transition: transform 0.2s ease, text-shadow 0.2s ease;
}

    .review-rating .star.filled,
    .rating-wrapper .star.filled {
        color: #f4b400;
    }

    .rating-wrapper .star:not(.filled) {
        color: #e0e0e0;
    }

    .review-rating .star:hover,
    .rating-wrapper .star:hover {
        transform: scale(1.3);
        text-shadow: 0 0 8px #ffd700;
        animation: sparkle 0.5s ease-in-out;
    }

@keyframes sparkle {
    0% {
        text-shadow: 0 0 8px #ffd700;
    }

    50% {
        text-shadow: 0 0 12px #ffd700, 0 0 16px #ffe082;
    }

    100% {
        text-shadow: 0 0 8px #ffd700;
    }
}

.review-comment {
    font-size: 18px;
    font-weight: 600;
    color: #121212;
    padding: 8px 5px 8px;
    line-height: 1.7;
}

.review-date {
    font-size: 14px;
    font-weight: 400;
    font-style: italic;
    color: #666;
    margin: 0;
}

.rating-wrapper {
    display: inline-flex;
    align-items: center;
}

    .rating-wrapper .star {
        font-size: 24px;
    }

.no-reviews {
    font-size: 18px;
    font-weight: 400;
    font-style: italic;
    color: #666;
    text-align: center;
    margin: 20px 0;
}

.rating-wrapper .star,
.review-rating .star {
    font-size: 24px;
    transition: transform 0.2s ease, text-shadow 0.2s ease;
}

    .rating-wrapper .star.filled,
    .review-rating .star.filled {
        color: #f4b400;
    }

    .rating-wrapper .star:not(.filled) {
        color: #ffffff;
    }

    .rating-wrapper .star.half,
    .review-rating .star.half {
        color: #f4b400;
        position: relative;
    }

        .rating-wrapper .star.half::after,
        .review-rating .star.half::after {
            content: '★';
            position: absolute;
            left: 0;
            top: 0;
            color: #ffffff;
            clip-path: inset(0 0 0 50%);
        }

    .rating-wrapper .star:hover,
    .review-rating .star:hover {
        transform: scale(1.3);
        text-shadow: 0 0 8px #ffd700;
        animation: sparkle 0.5s ease-in-out;
    }

.review-popup {
    position: fixed;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%) translateY(100%);
    width: 100%;
    max-width: 600px;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    background: #ffffff;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.15);
    padding: 35px;
    z-index: 20000;
    display: none;
    overflow: hidden;
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
    will-change: transform, opacity;
}

    .review-popup.show {
        display: block;
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }

.show-modal {
    outline: none;
    border: none;
    cursor: pointer;
    color: #fff;
    border-radius: 6px;
    font-size: 1.2rem;
    padding: 15px 22px;
    background: #4A98F7;
    transition: 0.3s ease;
    box-shadow: 0 10px 18px rgba(52,87,220,0.18);
}

    .show-modal:hover {
        background: #2382f6;
    }

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #2a2e43;
    padding: 15px 0;
    font-size: 16px;
}

.rating-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 10px;
}

.star.filled {
    color: #ff4500;
}

    .star.filled.half {
        color: #ff4500;
    }

.reviews-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    text-align: center;
}

.review-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    padding: 10px;
}

.review-profile-pic {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
    flex-shrink: 0;
}

.review-content {
    flex: 1;
}

.review-header {
    display: flex;
    justify-content: space-between;
    /*align-items: center;*/
    margin: 7px;
}

.review-name {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.review-date {
    font-size: 10px;
    color: #777;
}

.review-comment {
    font-size: 14px;
    color: #333;
    line-height: 1.4;
}

.no-reviews {
    text-align: center;
    color: #777;
    font-size: 14px;
    padding: 20px;
}

.skeleton-loader {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    padding: 10px;
}

.skeleton-profile-pic {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e0e0e0;
    margin-right: 10px;
    animation: pulse 1.5s ease-in-out infinite;
}

.skeleton-content {
    flex: 1;
}

.skeleton-line {
    height: 12px;
    background: #e0e0e0;
    border-radius: 4px;
    margin-bottom: 8px;
    animation: pulse 1.5s ease-in-out infinite;
}

    .skeleton-line.short {
        width: 60%;
    }

    .skeleton-line.long {
        width: 100%;
    }

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

@media (max-width: 480px) {
    .reviews-title {
        font-size: 18px;
    }

    .review-profile-pic, .skeleton-profile-pic {
        width: 36px;
        height: 36px;
    }

    .review-name {
        font-size: 13px;
    }

    .review-comment {
        font-size: 13px;
    }

    .review-date {
        font-size: 11px;
    }

    .qr-body {
        padding: 15px;
    }

    .qr-modal-title {
        font-size: 18px;
    }

    .qr-modal-content canvas, .qr-skeleton-box {
        max-width: 240px;
        max-height: 240px;
    }
}

.review-rating {
    display: flex;
    justify-content: end;
}

@media screen and (max-width: 375px) {
    .container {
        transform: scale(0.8);
        transition: transform 0.3s ease-in-out;
    }
}

@media screen and (max-width: 400px) {
    .container {
        transform: scale(0.8);
        transition: transform 0.3s ease-in-out;
    }
}

@media (max-width: 767px) {
    .container {
        transform: scale(1.02);
        transition: transform 0.3s ease-in-out;
        border-radius: 0;
    }
}

@media (max-width: 820px) and (min-height: 1000px) {
    .container {
        transform: scale(1.3);
        transition: transform 0.3s ease-in-out;
        border-radius: 0;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .container {
        transform: scale(1.5);
        transition: transform 0.3s ease-in-out;
        border-radius: 0;
    }
}
