/**
 * AI Review Modal Styles
 * @package Tavana
 */

/* Overlay */
.ai-review-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Backdrop */
.ai-review-backdrop {
    position: absolute;
    inset: 0;
    background: var(--bg-overlay);
    backdrop-filter: blur(4px);
}

/* Modal */
.ai-review-modal {
    position: relative;
    width: 100%;
    max-width: 600px;
    max-height: 85vh;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Header */
.ai-review-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}

.ai-review-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.ai-review-header-title i {
    width: 22px;
    height: 22px;
    color: var(--primary);
}

.ai-review-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--bg-body);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.ai-review-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.ai-review-close i {
    width: 18px;
    height: 18px;
}

/* Rate Limit Badge */
.ai-review-rate-limit {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-body);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    font-size: 12px;
    color: var(--text-secondary);
    margin-right: auto;
    margin-left: 12px;
}

.ai-review-rate-limit i {
    width: 14px;
    height: 14px;
    color: var(--warning);
}

/* Product Info */
.ai-review-product {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    background: var(--bg-body);
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}

.ai-review-product-img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
}

.ai-review-product-info h3 {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0 0 4px 0;
    line-height: 1.4;
}

.ai-review-product-info p {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
}

/* Product Actions */
.ai-review-product-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: auto;
}

.ai-review-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    background: var(--bg-body);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.ai-review-action-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.ai-review-action-btn i {
    width: 20px;
    height: 20px;
}

/* Wishlist Button */
.ai-review-wishlist-btn.is-wishlisted {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger);
    color: var(--danger);
}

.ai-review-wishlist-btn.is-wishlisted i {
    fill: var(--danger);
}

/* Cart Button */
.ai-review-cart-btn {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

.ai-review-cart-btn:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #ffffff;
}

.ai-review-cart-btn.is-added {
    background: var(--success);
    border-color: var(--success);
}

.ai-review-cart-btn .btn-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Tooltip */
.ai-review-action-btn.has-tooltip {
    position: relative;
}

.ai-review-action-btn .tooltip-text {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 12px;
    background: var(--text-primary);
    color: #ffffff;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    border-radius: var(--radius-sm);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 10;
}

.ai-review-action-btn .tooltip-text::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: var(--text-primary);
}

.ai-review-action-btn:hover .tooltip-text {
    opacity: 1;
    visibility: visible;
}

/* Quantity Selector */
.ai-review-quantity {
    display: flex;
    align-items: center;
    gap: 0;
    height: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
}

.ai-review-quantity .qty-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 100%;
    background: var(--bg-body);
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.ai-review-quantity .qty-btn:hover {
    background: var(--bg-hover);
    color: var(--accent);
}

.ai-review-quantity .qty-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ai-review-quantity .qty-btn i {
    width: 16px;
    height: 16px;
}

.ai-review-quantity .qty-value {
    min-width: 36px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Content */
.ai-review-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Skeleton Loading */
.ai-review-skeleton {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.skeleton-line {
    height: 16px;
    background: linear-gradient(90deg, var(--bg-body) 25%, var(--bg-hover) 50%, var(--bg-body) 75%);
    background-size: 200% 100%;
    border-radius: 4px;
    animation: skeletonShimmer 1.5s infinite;
}

.skeleton-line.skeleton-title {
    height: 20px;
    width: 60%;
}

.skeleton-line.skeleton-short {
    width: 40%;
}

@keyframes skeletonShimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Error State */
.ai-review-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
    gap: 16px;
}

.ai-review-error i {
    width: 48px;
    height: 48px;
    color: var(--danger);
}

.ai-review-error p {
    color: var(--text-secondary);
    margin: 0;
}

/* Rate Limit Error */
.ai-review-error.is-rate-limit i {
    color: var(--warning);
}

.ai-review-error.is-rate-limit p {
    color: var(--text-primary);
    font-weight: 500;
}

/* Review Text */
.ai-review-text {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-primary);
}

.ai-review-text p {
    margin: 0 0 14px 0;
}

.ai-review-text ul {
    margin: 0 0 14px 0;
    padding-right: 20px;
}

.ai-review-text li {
    margin-bottom: 8px;
}

.ai-review-text strong {
    color: var(--primary);
}

/* Footer */
.ai-review-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-body);
    flex-shrink: 0;
}

.ai-review-powered,
.ai-review-cached {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.ai-review-powered i,
.ai-review-cached i {
    width: 14px;
    height: 14px;
}

/* Responsive */
@media (max-width: 640px) {
    .ai-review-overlay {
        padding: 10px;
    }

    .ai-review-modal {
        max-height: 90vh;
    }

    .ai-review-header {
        padding: 14px 16px;
    }

    .ai-review-product {
        padding: 12px 16px;
    }

    .ai-review-content {
        padding: 16px;
    }

    .ai-review-footer {
        padding: 10px 16px;
    }
}