/**
 * TabPad Style Popup Enhancements - CSS
 * Variation selector, quantity stepper, order notes, favorites
 * Version: 1.0.0
 */

/* Enhanced Popup Container */
.resto-global-popup.tabpad-enhanced .popup-container {
    max-width: 520px;
    border-radius: 20px;
}

/* Popup Actions Bar */
.popup-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.popup-favorite-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #adb5bd;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.popup-favorite-btn:hover {
    color: #e74c3c;
    transform: scale(1.1);
}

.popup-favorite-btn.active {
    color: #e74c3c;
    background: #fff5f5;
}

.popup-favorite-btn.active i {
    animation: heartBeat 0.5s ease;
}

@keyframes heartBeat {

    0%,
    100% {
        transform: scale(1);
    }

    25% {
        transform: scale(1.3);
    }

    50% {
        transform: scale(1);
    }

    75% {
        transform: scale(1.2);
    }
}

/* Variations Section */
.popup-variations {
    padding: 20px;
    border-bottom: 1px solid #f1f3f5;
}

.popup-variations-title {
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.popup-variations-title i {
    color: #e74c3c;
    font-size: 12px;
}

.popup-variations-title .required {
    color: #e74c3c;
    font-size: 11px;
    font-weight: 400;
}

.popup-variation-group {
    margin-bottom: 16px;
}

.popup-variation-group:last-child {
    margin-bottom: 0;
}

.popup-variation-group-title {
    font-size: 13px;
    font-weight: 500;
    color: #6c757d;
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.popup-variation-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.popup-variation-option {
    flex: 1;
    min-width: 100px;
}

.popup-variation-option input[type="radio"] {
    display: none;
}

.popup-variation-option label {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 16px;
    background: #fff;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.popup-variation-option label:hover {
    border-color: #e74c3c;
    background: #fff5f5;
}

.popup-variation-option input[type="radio"]:checked+label {
    border-color: #e74c3c;
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.05), rgba(231, 76, 60, 0.1));
    box-shadow: 0 2px 10px rgba(231, 76, 60, 0.15);
}

.popup-variation-option input[type="radio"]:checked+label::before {
    content: '\f00c';
    font-family: FontAwesome;
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    background: #e74c3c;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.popup-variation-option label {
    position: relative;
}

.popup-variation-name {
    font-size: 14px;
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 4px;
}

.popup-variation-price {
    font-size: 13px;
    font-weight: 600;
    color: #e74c3c;
}

.popup-variation-price.extra {
    color: #28a745;
}

/* Quantity Stepper */
.popup-quantity {
    padding: 20px;
    border-bottom: 1px solid #f1f3f5;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.popup-quantity-label {
    font-size: 14px;
    font-weight: 500;
    color: #495057;
}

.popup-quantity-stepper {
    display: flex;
    align-items: center;
    gap: 0;
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e9ecef;
}

.popup-quantity-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #495057;
    transition: all 0.2s ease;
}

.popup-quantity-btn:hover {
    background: #e9ecef;
    color: #e74c3c;
}

.popup-quantity-btn:active {
    transform: scale(0.95);
}

.popup-quantity-btn:disabled {
    color: #adb5bd;
    cursor: not-allowed;
}

.popup-quantity-value {
    width: 50px;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    background: #fff;
    padding: 10px 0;
}

/* Order Notes */
.popup-notes {
    padding: 20px;
    border-bottom: 1px solid #f1f3f5;
}

.popup-notes-label {
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.popup-notes-label i {
    color: #6c757d;
}

.popup-notes-textarea {
    width: 100%;
    min-height: 80px;
    padding: 14px 16px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: all 0.2s ease;
}

.popup-notes-textarea:focus {
    outline: none;
    border-color: #e74c3c;
    box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.1);
}

.popup-notes-textarea::placeholder {
    color: #adb5bd;
}

.popup-notes-counter {
    text-align: right;
    font-size: 12px;
    color: #adb5bd;
    margin-top: 6px;
}

.popup-notes-counter.warning {
    color: #ffc107;
}

.popup-notes-counter.error {
    color: #dc3545;
}

/* Allergen Badges */
.popup-allergens {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.popup-allergens-title {
    font-size: 12px;
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.popup-allergens-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.popup-allergen-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 20px;
    font-size: 12px;
    color: #495057;
}

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

.popup-allergen-badge.warning {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

/* Item Info Row */
.popup-info-row {
    display: flex;
    gap: 15px;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.popup-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #6c757d;
}

.popup-info-item i {
    font-size: 16px;
    color: #e74c3c;
}

.popup-info-item strong {
    color: #495057;
}

/* Total Price Section */
.popup-total {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
}

.popup-total-label {
    font-size: 14px;
    color: #6c757d;
}

.popup-total-price {
    font-size: 24px;
    font-weight: 700;
    color: #e74c3c;
}

/* Add to Cart Button */
.popup-add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: calc(100% - 40px);
    margin: 0 20px 20px;
    padding: 16px 24px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.popup-add-btn:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

.popup-add-btn:active {
    transform: translateY(0);
}

.popup-add-btn i {
    font-size: 18px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .resto-global-popup.tabpad-enhanced .popup-container {
        border-radius: 20px 20px 0 0;
        max-height: 90vh;
    }

    .popup-variation-options {
        flex-direction: column;
    }

    .popup-variation-option {
        min-width: auto;
    }

    .popup-quantity-stepper {
        transform: scale(0.9);
    }

    .popup-add-btn {
        padding: 14px 20px;
        font-size: 15px;
    }
}

/* Highlight animation for search results */
.resto-menu-item.search-highlight {
    animation: searchHighlight 2s ease;
}

@keyframes searchHighlight {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(231, 76, 60, 0.3);
    }
}

/* ============================================
   FAZ 1: Gelişmiş Yorum Sistemi Stilleri
   ============================================ */

/* Review Sorting Controls */
.popup-reviews-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f3f5;
}

.review-sort-btn {
    padding: 6px 14px;
    border: 1px solid #e9ecef;
    background: #fff;
    border-radius: 20px;
    font-size: 12px;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.2s ease;
}

.review-sort-btn:hover {
    border-color: #e74c3c;
    color: #e74c3c;
}

.review-sort-btn.active {
    background: #e74c3c;
    border-color: #e74c3c;
    color: #fff;
}

/* Review Item Enhanced */
.popup-review-item {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 12px;
}

.popup-review-item:last-child {
    margin-bottom: 0;
}

/* Review Actions (Helpful Button) */
.review-actions {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e9ecef;
}

.review-helpful-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1.5px solid #dee2e6;
    background: #fff;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 500;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    position: relative;
    overflow: hidden;
}

.review-helpful-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(40, 167, 69, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.4s ease;
}

.review-helpful-btn:hover::before {
    width: 150%;
    height: 150%;
}

.review-helpful-btn:hover {
    border-color: #28a745;
    color: #28a745;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.15);
}

.review-helpful-btn:active {
    transform: translateY(0) scale(0.98);
}

.review-helpful-btn.active {
    background: linear-gradient(135deg, #28a745, #20c997);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.35);
}

.review-helpful-btn.active:hover {
    background: linear-gradient(135deg, #218838, #1abc9c);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.review-helpful-btn i {
    font-size: 15px;
    transition: transform 0.3s ease;
}

.review-helpful-btn:hover i {
    transform: rotate(-12deg) scale(1.1);
}

.review-helpful-btn.active i {
    animation: thumbsUp 0.4s ease;
}

@keyframes thumbsUp {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3) rotate(-15deg);
    }

    100% {
        transform: scale(1);
    }
}

.helpful-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    font-size: 12px;
    font-weight: 700;
    background: rgba(40, 167, 69, 0.12);
    color: #28a745;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.review-helpful-btn.active .helpful-count {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.helpful-count.pulse {
    animation: countPulse 0.5s ease;
}

@keyframes countPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.25);
        background: rgba(40, 167, 69, 0.3);
    }

    100% {
        transform: scale(1);
    }
}

/* Review Photos */
.review-photos {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.review-photo-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.review-photo-thumb:hover {
    border-color: #e74c3c;
    transform: scale(1.05);
}

/* Photo Lightbox */
.photo-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    min-width: 200px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    border-radius: 12px;
    padding: 10px;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 85vh;
    min-width: 180px;
    min-height: 180px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 36px;
    height: 36px;
    background: #fff;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.lightbox-close:hover {
    background: #f5f5f5;
    transform: scale(1.1);
}

/* Emoji Reactions */
.popup-emoji-reactions {
    padding: 15px 20px;
    background: linear-gradient(135deg, #fff9f0, #fff5eb);
    border-bottom: 1px solid #f1f3f5;
}

.emoji-label {
    font-size: 13px;
    color: #6c757d;
    margin-bottom: 12px;
    font-weight: 500;
}

.emoji-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.emoji-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 16px;
    border: 2px solid #e9ecef;
    background: #fff;
    border-radius: 12px;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 60px;
}

.emoji-btn:hover {
    border-color: #ffc107;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.2);
}

.emoji-btn.active {
    background: linear-gradient(135deg, #fff9e6, #fff3cd);
    border-color: #ffc107;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

.emoji-count {
    font-size: 11px;
    font-weight: 600;
    color: #495057;
}

/* Admin Reply Styling */
.review-admin-reply {
    margin-top: 12px;
    padding: 10px 12px;
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border-radius: 8px;
    border-left: 3px solid #2196f3;
}

.reply-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #1565c0;
    margin-bottom: 4px;
}

.reply-label i {
    margin-right: 4px;
}

.reply-text {
    display: block;
    font-size: 13px;
    color: #333;
    line-height: 1.5;
}

/* Review Stars Enhancement */
.review-stars {
    color: #ffc107;
}

.review-stars i {
    font-size: 12px;
    margin-right: 1px;
}

/* Mobile Responsive for New Features */
@media (max-width: 768px) {
    .emoji-buttons {
        justify-content: center;
    }

    .emoji-btn {
        padding: 8px 12px;
        font-size: 20px;
        min-width: 50px;
    }

    .popup-reviews-controls {
        justify-content: center;
    }

    .review-photo-thumb {
        width: 50px;
        height: 50px;
    }
}