/**
 * Surprise Me! Styling
 * Creative & fun animations
 */

/* Container */
.surprise-me-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 2rem;
    text-align: center;
}

/* Gender Filter */
.gender-filter {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.gender-btn {
    padding: 0.75rem 1.5rem;
    border: 3px solid #e5e7eb;
    background: white;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.gender-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    border-color: #3b82f6;
}

.gender-btn.active {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    border-color: #3b82f6;
    color: white;
    transform: scale(1.05);
}

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

/* Mood Filter */
.mood-filter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.mood-filter label {
    font-weight: 600;
    color: #6b7280;
}

.mood-select {
    padding: 0.5rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    background: white;
    transition: all 0.2s;
}

.mood-select:hover {
    border-color: #3b82f6;
}

.mood-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Surprise Button */
.surprise-btn {
    position: relative;
    padding: 1.25rem 3rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 50%, #3b82f6 100%);
    background-size: 200% 200%;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(236, 72, 153, 0.4);
    transition: all 0.3s ease;
    animation: gradientShift 3s ease infinite;
    overflow: hidden;
}

.surprise-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.surprise-btn:hover::before {
    width: 300px;
    height: 300px;
}

.surprise-btn:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 15px 40px rgba(236, 72, 153, 0.5);
}

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

.surprise-btn.loading {
    pointer-events: none;
    opacity: 0.8;
}

.surprise-icon {
    display: inline-block;
    margin-right: 0.5rem;
    font-size: 1.5rem;
}

.surprise-text {
    position: relative;
    z-index: 1;
}

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

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Loading State */
.surprise-loading {
    padding: 4rem 2rem;
    text-align: center;
}

.surprise-loader {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 2rem;
}

.loader-gift {
    font-size: 4rem;
    animation: bounce 1s ease infinite;
}

.loader-sparkles {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    animation: rotate 2s linear infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

@keyframes rotate {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Results */
.surprise-results {
    margin-top: 3rem;
    min-height: 400px;
}

.surprise-message {
    margin-bottom: 2rem;
    animation: fadeInDown 0.5s ease;
}

.surprise-message h3 {
    font-size: 2rem;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
}

.surprise-subtitle {
    color: #6b7280;
    font-size: 1.1rem;
}

/* Product Grid */
.surprise-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .surprise-grid {
        grid-template-columns: 1fr;
    }
}

/* Product Card */
.surprise-product {
    position: relative;
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(30px) scale(0.9);
}

.surprise-product.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.surprise-product:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* Badge */
.surprise-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
    z-index: 10;
}

.badge-icon {
    margin-right: 0.25rem;
}

/* Product Image */
.surprise-product-image {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
}

.surprise-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.surprise-product:hover .surprise-product-image img {
    transform: scale(1.1);
}

.surprise-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.surprise-product:hover .surprise-overlay {
    opacity: 1;
}

.quick-view-btn {
    padding: 0.75rem 1.5rem;
    background: white;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.surprise-product:hover .quick-view-btn {
    transform: translateY(0);
}

/* Product Content */
.surprise-product-content {
    text-align: left;
}

.surprise-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 0.25rem;
    margin-bottom: 0.5rem;
}

.surprise-product-name {
    font-size: 1.25rem;
    margin: 0.5rem 0;
    line-height: 1.4;
}

.surprise-product-name a {
    color: #1a1a1a;
    text-decoration: none;
    transition: color 0.2s;
}

.surprise-product-name a:hover {
    color: #3b82f6;
}

/* Rating */
.surprise-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.stars {
    display: flex;
    gap: 0.125rem;
}

.star {
    font-size: 0.875rem;
}

.rating-value {
    font-weight: 600;
    color: #6b7280;
    font-size: 0.875rem;
}

.rating-count {
    font-size: 0.75rem;
    color: #9ca3af;
}

/* Fun Fact */
.surprise-fun-fact {
    padding: 0.75rem;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #92400e;
    margin-bottom: 0.75rem;
}

/* Why This */
.surprise-why {
    padding: 0.75rem;
    background: #f0f9ff;
    border-left: 3px solid #3b82f6;
    border-radius: 0.25rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.why-label {
    font-weight: 700;
    color: #1e40af;
    display: block;
    margin-bottom: 0.25rem;
}

.why-text {
    color: #1e40af;
}

/* Price */
.surprise-price {
    font-size: 1.75rem;
    font-weight: 700;
    color: #3b82f6;
    margin-bottom: 1rem;
}

/* Actions */
.surprise-actions-row {
    display: flex;
    gap: 0.5rem;
}

.btn-add-to-cart-surprise {
    flex: 2;
    padding: 0.75rem;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add-to-cart-surprise:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-view-detail {
    flex: 1;
    padding: 0.75rem;
    background: white;
    color: #3b82f6;
    border: 2px solid #3b82f6;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s;
}

.btn-view-detail:hover {
    background: #3b82f6;
    color: white;
}

/* Sparkles Animation */
.surprise-sparkles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.sparkle {
    position: absolute;
    font-size: 1.5rem;
    opacity: 0;
    animation: sparkleFloat 3s ease-in-out infinite;
}

.sparkle:nth-child(1) {
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.sparkle:nth-child(2) {
    top: 20%;
    right: 15%;
    animation-delay: 1s;
}

.sparkle:nth-child(3) {
    bottom: 15%;
    left: 20%;
    animation-delay: 2s;
}

@keyframes sparkleFloat {
    0%, 100% {
        opacity: 0;
        transform: translateY(0) scale(0.5);
    }
    50% {
        opacity: 1;
        transform: translateY(-20px) scale(1);
    }
}

/* Surprise Again Button */
.surprise-actions {
    margin-top: 2rem;
}

.surprise-again-btn {
    padding: 1rem 2rem;
    background: white;
    color: #3b82f6;
    border: 3px solid #3b82f6;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.surprise-again-btn:hover {
    background: #3b82f6;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

/* Error State */
.surprise-error {
    padding: 3rem;
    text-align: center;
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.surprise-error p {
    font-size: 1.1rem;
    color: #6b7280;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 640px) {
    .surprise-me-container {
        padding: 1rem;
    }

    .gender-filter {
        flex-direction: column;
    }

    .gender-btn {
        width: 100%;
    }

    .surprise-btn {
        width: 100%;
        padding: 1rem 2rem;
        font-size: 1rem;
    }

    .surprise-message h3 {
        font-size: 1.5rem;
    }

    .surprise-product {
        padding: 1rem;
    }
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    .surprise-product {
        background: #2d2d2d;
        color: #f9fafb;
    }

    .surprise-product-name a {
        color: #f9fafb;
    }

    .surprise-category {
        background: #404040;
        color: #9ca3af;
    }

    .mood-select,
    .gender-btn {
        background: #2d2d2d;
        color: #f9fafb;
    }
}
