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

@keyframes deluxeGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes shimmerText {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.reviews-section {
    padding: 5rem 2rem;
    background: linear-gradient(135deg, #0f0f1e 0%, #1a1a2e 50%, #2d2d44 100%);
    position: relative;
    overflow: hidden;
    animation: fadeInSlow 0.8s ease-out forwards;
    opacity: 1;
}

.reviews-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(212, 175, 55, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(212, 175, 55, 0.12) 0%, transparent 50%);
    pointer-events: none;
    animation: deluxeGradient 8s ease infinite;
}

.average-rating-section {
    text-align: center;
    margin-bottom: 4rem;
    padding: 3rem;
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.95) 0%, rgba(45, 45, 68, 0.95) 100%);
    border-radius: 20px;
    color: white;
    border: 2px solid rgba(212, 175, 55, 0.4);
    box-shadow: 0 10px 40px rgba(0,0,0,0.5), 0 0 30px rgba(212, 175, 55, 0.3), inset 0 0 60px rgba(212, 175, 55, 0.1);
    position: relative;
    z-index: 1;
}

/* Bronze gradient for ratings 1.0-2.0 */
@keyframes shimmerBronze {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.average-rating-section.rating-bronze .average-number {
    background: linear-gradient(135deg, #cd7f32 0%, #b87333 25%, #daa520 50%, #b87333 75%, #cd7f32 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: shimmerBronze 3s ease infinite;
    text-shadow: 0 0 30px rgba(205, 127, 50, 0.4);
}

@supports not (-webkit-background-clip: text) {
    .average-rating-section.rating-bronze .average-number {
        -webkit-text-fill-color: #cd7f32;
        color: #cd7f32;
    }
}

.average-rating-section.rating-bronze {
    border-color: rgba(205, 127, 50, 0.5);
    box-shadow: 0 10px 40px rgba(0,0,0,0.5), inset 0 0 60px rgba(205, 127, 50, 0.2);
}

/* Silver gradient for ratings 2.0-4.0 */
@keyframes shimmerSilver {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.average-rating-section.rating-silver .average-number {
    background: linear-gradient(135deg, #c0c0c0 0%, #a8a8a8 25%, #e8e8e8 50%, #a8a8a8 75%, #c0c0c0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: shimmerSilver 3s ease infinite;
    text-shadow: 0 0 30px rgba(192, 192, 192, 0.4);
}

@supports not (-webkit-background-clip: text) {
    .average-rating-section.rating-silver .average-number {
        -webkit-text-fill-color: #c0c0c0;
        color: #c0c0c0;
    }
}

.average-rating-section.rating-silver {
    border-color: rgba(192, 192, 192, 0.5);
    box-shadow: 0 10px 40px rgba(0,0,0,0.5), inset 0 0 60px rgba(192, 192, 192, 0.2);
}

/* Gold gradient for ratings 4.0-5.0 */
@keyframes shimmerGold {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.average-rating-section.rating-gold .average-number {
    background: linear-gradient(135deg, #f5f5f5 0%, #e8c547 50%, #f5f5f5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: shimmerGold 3s ease infinite;
    text-shadow: 0 0 30px rgba(212, 175, 55, 0.4);
}

@supports not (-webkit-background-clip: text) {
    .average-rating-section.rating-gold .average-number {
        -webkit-text-fill-color: #e8c547;
        color: #e8c547;
    }
}

.average-rating-section.rating-gold {
    border-color: rgba(212, 175, 55, 0.5);
    box-shadow: 0 10px 40px rgba(0,0,0,0.5), inset 0 0 60px rgba(212, 175, 55, 0.2);
}

.average-rating-box {
    display: inline-block;
}

.average-number {
    font-size: 4.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    text-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.average-stars {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #ffd93d;
    letter-spacing: 0.2rem;
}

.average-text {
    font-size: 1.2rem;
    opacity: 0.9;
}

.review-form-section {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.95) 0%, rgba(45, 45, 68, 0.95) 100%);
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(212, 175, 55, 0.2);
    border: 1px solid rgba(212, 175, 55, 0.3);
    margin-bottom: 3rem;
    position: relative;
    z-index: 1;
}

.review-form-section h2 {
    color: #e8c547;
    margin-bottom: 2rem;
    font-size: 2rem;
    font-weight: 700;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
    background: linear-gradient(135deg, #f5f5f5 0%, #e8c547 50%, #f5f5f5 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmerText 3s ease-in-out infinite;
}

.review-submit-hint {
    margin-top: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.95) 0%, rgba(45, 45, 68, 0.95) 100%);
    border: 2px solid rgba(212, 175, 55, 0.5);
    border-radius: 10px;
    color: #e8c547;
    font-size: 0.95rem;
    line-height: 1.5;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
}

.review-form button[type="submit"]:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    pointer-events: none;
}

.review-form button[type="submit"]:not(:disabled) {
    opacity: 1;
    cursor: pointer;
}

.login-prompt {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.95) 0%, rgba(45, 45, 68, 0.95) 100%);
    border: 2px solid rgba(212, 175, 55, 0.4);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    margin-bottom: 3rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(212, 175, 55, 0.2);
    position: relative;
    z-index: 1;
}

.login-prompt p {
    color: rgba(245, 245, 245, 0.9);
    font-size: 1.1rem;
    margin: 0;
}

.already-reviewed-msg {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.95) 0%, rgba(45, 45, 68, 0.95) 100%);
    border: 2px solid rgba(212, 175, 55, 0.4);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    margin-bottom: 3rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(212, 175, 55, 0.2);
    position: relative;
    z-index: 1;
}

.already-reviewed-msg p {
    color: #e8c547;
    font-size: 1.1rem;
    margin: 0;
    font-weight: 600;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
}

.login-prompt a {
    color: #e8c547;
    font-weight: 600;
    text-decoration: none;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
    transition: all 0.3s ease;
}

.login-prompt a:hover {
    color: #f5f5f5;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.8);
    text-decoration: none;
}

.review-form .form-group {
    margin-bottom: 2rem;
}

.review-form .form-group label {
    color: #e8c547;
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
    display: block;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.star-rating-input {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
}

.star-rating-input .star {
    font-size: 2.5rem;
    color: rgba(245, 245, 245, 0.3);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.star-rating-input .star:hover,
.star-rating-input .star.active {
    color: #e8c547;
    transform: scale(1.2);
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.8);
}

.review-form input[type="text"],
.review-form input[type="email"] {
    width: 100%;
    padding: 1rem;
    border: 2px solid rgba(212, 175, 55, 0.3);
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: rgba(26, 26, 46, 0.6) !important;
    color: #f5f5f5 !important;
}

.review-form input[type="text"]:focus,
.review-form input[type="email"]:focus {
    outline: none;
    border-color: #e8c547;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.3), 0 0 20px rgba(212, 175, 55, 0.2);
    background: rgba(26, 26, 46, 0.9) !important;
}

.review-form input[type="text"]::placeholder,
.review-form input[type="email"]::placeholder {
    color: rgba(245, 245, 245, 0.35) !important;
}

.review-form input[type="text"]:-webkit-autofill,
.review-form input[type="text"]:-webkit-autofill:hover,
.review-form input[type="text"]:-webkit-autofill:focus,
.review-form input[type="text"]:-webkit-autofill:active,
.review-form input[type="email"]:-webkit-autofill,
.review-form input[type="email"]:-webkit-autofill:hover,
.review-form input[type="email"]:-webkit-autofill:focus,
.review-form input[type="email"]:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px rgba(26, 26, 46, 0.6) inset !important;
    -webkit-text-fill-color: #f5f5f5 !important;
    background: rgba(26, 26, 46, 0.6) !important;
}

.review-form textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid rgba(212, 175, 55, 0.3);
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: all 0.3s ease;
    background: rgba(26, 26, 46, 0.6) !important;
    color: #f5f5f5 !important;
}

.review-form textarea:focus {
    outline: none;
    border-color: #e8c547;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.3), 0 0 20px rgba(212, 175, 55, 0.2);
    background: rgba(26, 26, 46, 0.9) !important;
}

.review-form textarea::placeholder {
    color: rgba(245, 245, 245, 0.35) !important;
}

.reviews-list {
    margin-top: 4rem;
}

.reviews-list h2 {
    color: #1a1a2e;
    margin-bottom: 2rem;
    font-size: 2.5rem;
    text-align: center;
}

.review-card {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.95) 0%, rgba(45, 45, 68, 0.95) 100%);
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(212, 175, 55, 0.2);
    border: 1px solid rgba(212, 175, 55, 0.3);
    margin-bottom: 2rem;
    transition: all 0.3s ease;
    animation: fadeInSlow 0.8s ease-out forwards;
    opacity: 0;
    color: rgba(245, 245, 245, 0.9);
}

.review-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.reviewer-name {
    font-weight: 700;
    font-size: 1.3rem;
    color: #e8c547;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.review-date {
    color: rgba(245, 245, 245, 0.6);
    font-size: 0.9rem;
}

.review-rating {
    display: flex;
    gap: 0.2rem;
    margin: 0.5rem 0;
}

.review-rating .star {
    font-size: 1.5rem;
    color: #ffd93d;
}

.review-rating .star.empty {
    color: #ddd;
}

.review-comment {
    color: rgba(245, 245, 245, 0.9);
    line-height: 1.8;
    font-size: 1.05rem;
    margin-top: 1rem;
}

.no-reviews {
    text-align: center;
    padding: 4rem 2rem;
    color: rgba(245, 245, 245, 0.7);
    font-size: 1.2rem;
}

/* Image Upload Styles */
.image-upload-area {
    border: 2px dashed rgba(212, 175, 55, 0.4);
    border-radius: 20px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.6) 0%, rgba(45, 45, 68, 0.6) 100%);
    margin-top: 1rem;
    position: relative;
    overflow: hidden;
}

.image-upload-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.1), transparent);
    transition: left 0.6s ease;
}

.image-upload-area:hover::before {
    left: 100%;
}

.image-upload-area:hover {
    border-color: rgba(212, 175, 55, 0.7);
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.8) 0%, rgba(45, 45, 68, 0.8) 100%);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.2);
}

.image-upload-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    display: block;
    filter: drop-shadow(0 4px 10px rgba(212, 175, 55, 0.3));
    transition: transform 0.3s ease;
}

.image-upload-area:hover .image-upload-icon {
    transform: scale(1.1) rotate(5deg);
}

.image-upload-main-text {
    color: #e8c547;
    font-weight: 600;
    margin: 0.5rem 0;
    font-size: 1.1rem;
    line-height: 1.5;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.image-upload-sub-text {
    color: rgba(245, 245, 245, 0.7);
    font-weight: 400;
    margin: 0.5rem 0 0 0;
    font-size: 0.95rem;
    font-style: italic;
    line-height: 1.4;
}

.image-preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.image-preview-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    aspect-ratio: 1;
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.remove-image-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-weight: bold;
    line-height: 1;
}

.remove-image-btn:hover {
    background: rgba(255, 0, 0, 1);
    transform: scale(1.1);
}

/* Review Images Display */
.review-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(212, 175, 55, 0.3);
}

.review-image-wrapper {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    aspect-ratio: 1;
    cursor: pointer;
    transition: all 0.3s ease;
}

.review-image-wrapper:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.review-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Review Image Modal */
.review-image-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-out;
}

.review-image-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.review-image-modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 3rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    transition: all 0.3s ease;
}

.review-image-modal-close:hover {
    background: rgba(255,255,255,0.2);
    transform: rotate(90deg);
}

.review-image-modal-img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 10px 50px rgba(0,0,0,0.5);
}

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

.user-greeting {
    color: white;
    margin-right: 1rem;
    font-weight: 600;
}

.auth-buttons {
    display: flex;
    align-items: center;
    margin-left: 1rem;
}

.auth-link-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.auth-link-btn:hover {
    background: rgba(255,255,255,0.2);
}

#logoutBtn {
    margin-left: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .reviews-section {
        padding: 3rem 1rem;
    }

    .average-rating-section {
        padding: 2rem 1.5rem;
        margin-bottom: 3rem;
    }

    .average-number {
        font-size: 3.5rem;
    }

    .average-stars {
        font-size: 1.6rem;
    }

    .average-text {
        font-size: 1rem;
    }

    .review-form-section {
        padding: 2rem 1.5rem;
        margin-bottom: 2rem;
    }

    .review-form-section h2 {
        font-size: 1.6rem;
        margin-bottom: 1.5rem;
    }

    .login-prompt,
    .already-reviewed-msg {
        padding: 1.5rem;
        margin-bottom: 2rem;
    }

    .login-prompt p,
    .already-reviewed-msg p {
        font-size: 1rem;
    }

    .star-rating-input .star {
        font-size: 2rem;
    }

    .review-form input[type="text"],
    .review-form input[type="email"],
    .review-form textarea {
        font-size: 0.95rem;
        padding: 0.9rem;
    }

    .reviews-list {
        margin-top: 3rem;
    }

    .reviews-list h2 {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }

    .review-card {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .review-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }

    .reviewer-name {
        font-size: 1.1rem;
    }

    .review-date {
        font-size: 0.85rem;
    }

    .review-rating .star {
        font-size: 1.3rem;
    }

    .review-comment {
        font-size: 0.95rem;
        line-height: 1.7;
    }

    .no-reviews {
        padding: 3rem 1rem;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .reviews-section {
        padding: 2rem 0.8rem;
    }

    .average-rating-section {
        padding: 1.5rem 1rem;
        margin-bottom: 2rem;
        border-radius: 15px;
    }

    .average-number {
        font-size: 3rem;
    }

    .average-stars {
        font-size: 1.4rem;
    }

    .average-text {
        font-size: 0.9rem;
    }

    .review-form-section {
        padding: 1.5rem 1rem;
        border-radius: 15px;
    }

    .review-form-section h2 {
        font-size: 1.4rem;
        margin-bottom: 1rem;
    }

    .login-prompt,
    .already-reviewed-msg {
        padding: 1rem;
        border-radius: 10px;
    }

    .login-prompt p,
    .already-reviewed-msg p {
        font-size: 0.9rem;
    }

    .star-rating-input {
        gap: 0.3rem;
        justify-content: center;
    }

    .star-rating-input .star {
        font-size: 1.8rem;
    }

    .review-form input[type="text"],
    .review-form input[type="email"],
    .review-form textarea {
        font-size: 0.9rem;
        padding: 0.8rem;
    }

    .reviews-list h2 {
        font-size: 1.6rem;
    }

    .review-card {
        padding: 1.2rem;
        border-radius: 12px;
    }

    .reviewer-name {
        font-size: 1rem;
    }

    .review-date {
        font-size: 0.8rem;
    }

    .review-rating .star {
        font-size: 1.2rem;
    }

    .review-comment {
        font-size: 0.9rem;
    }

    .no-reviews {
        padding: 2rem 0.8rem;
        font-size: 0.95rem;
    }

    .image-upload-area {
        padding: 2rem 1.5rem;
    }

    .image-upload-icon {
        font-size: 3rem;
    }

    .image-upload-main-text {
        font-size: 1rem;
    }

    .image-upload-sub-text {
        font-size: 0.85rem;
    }

    .image-preview-container {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 0.6rem;
    }

    .review-images {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.6rem;
    }

    .review-image-modal-close {
        top: 10px;
        right: 15px;
        font-size: 2rem;
        width: 40px;
        height: 40px;
    }
}

/* Mobile performance: stop infinite animations and blur */
@media (max-width: 1024px) {
    .reviews-section::before {
        animation: none !important;
    }
    .average-rating-section.rating-bronze .average-number,
    .average-rating-section.rating-silver .average-number,
    .average-rating-section.rating-gold .average-number {
        animation: none !important;
    }
    .review-form-section h2 {
        animation: none !important;
    }
    .review-image-modal {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
}

/* Review Language Toggle */