/* Main tooltip overlay */
.quiz-tooltip {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.quiz-tooltip.active {
    opacity: 1;
    visibility: visible;
}

/* Dark background overlay */
.tooltip-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

/* Tooltip modal container */
.tooltip-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

/* Close button */
.tooltip-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    color: #666;
    z-index: 10;
    transition: all 0.2s ease;
}

.tooltip-close:hover {
    background: #d4a574;
    color: white;
}

/* Content area */
.tooltip-content {
    max-height: 85vh;
    overflow-y: auto;
}

/* Loading state */
.tooltip-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 30px;
    text-align: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #d4a574;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.tooltip-loading p {
    color: #666;
    margin: 0;
    font-size: 14px;
}

/* Product info layout */
.quiz-product-info {
    display: flex;
    flex-direction: column;
}

.product-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f5f5f5;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-details {
    padding: 25px;
}

.product-name {
    font-size: 1.4rem;
    color: #2c1810;
    margin: 0 0 8px 0;
    font-weight: 600;
    line-height: 1.3;
}

.product-price {
    font-size: 1.2rem;
    color: #d4a574;
    font-weight: 600;
    margin-bottom: 8px;
}

.product-roaster {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 15px;
    font-style: italic;
}

/* Meta tags */
.product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: #f5f5f5;
    border-radius: 12px;
    font-size: 0.8rem;
    color: #666;
}

.meta-item i {
    color: #d4a574;
    font-size: 0.7rem;
}

/* Tasting notes */
.tasting-notes {
    background: rgba(212, 165, 116, 0.1);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.tasting-notes strong {
    color: #2c1810;
    display: block;
    margin-bottom: 4px;
}

/* Description */
.product-description {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 20px;
}

.product-actions {
    display: flex;
    justify-content: center;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-block;
    min-width: 150px;
}


.btn-primary {
    background: #d4a574;
    color: white;
}

.btn-primary:hover {
    background: #b8956a;
    color: white;
    text-decoration: none;
}

/* Error state */
.tooltip-error {
    text-align: center;
    padding: 40px 30px;
    color: #666;
}

.tooltip-error i {
    font-size: 3rem;
    color: #e74c3c;
    margin-bottom: 15px;
}

.tooltip-error p {
    margin: 0 0 20px 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Prevent body scroll when tooltip is open */
body.quiz-tooltip-open {
    overflow: hidden;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .tooltip-container {
        width: 95%;
        max-height: 90vh;
    }
    
    .product-details {
        padding: 20px;
    }
    
    .product-name {
        font-size: 1.2rem;
    }
    
    .product-actions {
        flex-direction: column;
    }
    
    .tooltip-close {
        top: 10px;
        right: 10px;
        width: 28px;
        height: 28px;
        font-size: 16px;
    }
    
    .product-image {
        height: 150px;
    }

    .btn {
        width: 100%;
        min-width: auto;
    }
}