
.recent-purchases-widget {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.9) 100%);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 24px;
    margin: 16px 0;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.06),
        0 8px 30px rgba(0, 0, 0, 0.04),
        0 2px 6px rgba(0, 0, 0, 0.02),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.6);
    max-width: 100%;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.recent-purchases-widget.active {
    opacity: 1;
    transform: translateY(0);
}



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

.smart-recommendations-section {
    padding: 0;
}

.section-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ai-powered-badge {
    background: linear-gradient(135deg, #8B4513 0%, #D2691E 100%);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: pulse 2s infinite;
    margin-left: 2rem;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.recommendations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.recommendation-card {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: inherit;
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 16px;
    min-height: 80px;
}

.recommendation-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    border-color: #8B4513;
    color: inherit;
    text-decoration: none;
}

.recommendation-card.recent-purchase {
    border-left: 4px solid #8B4513;
}

.recommendation-card.recent-purchase:hover {
    border-left-color: #D2691E;
}

.product-image-container {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    margin-right: 16px;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #f8f9fa;
    transition: transform 0.3s ease;
}

.recommendation-card:hover .product-image {
    transform: scale(1.05);
}

.product-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #8B4513;
}

.placeholder-icon {
    font-size: 1.5rem;
    margin-bottom: 2px;
}

.placeholder-text {
    font-size: 0.6rem;
    font-weight: 500;
    opacity: 0.7;
}

.recommendation-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.product-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 4px 0;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recommendation-reason {
    font-size: 1rem;
    color: #7f8c8d;
    margin: 0 0 8px 0;
    display: block;
}

.recommendation-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
}

.match-score {
    background: #4ade80;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 16px;
    white-space: nowrap;
}

.product-link-btn {
    color: #8B4513;
    font-weight: 600;
    font-size: 1rem;
    background: rgba(139, 69, 19, 0.1);
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
    border: 1px solid rgba(139, 69, 19, 0.2);
}

.recommendation-card:hover .product-link-btn {
    background: #8B4513;
    color: white;
    transform: translateX(2px);
    border-color: #8B4513;
}

.recent-purchases-widget.loading {
    text-align: center;
    padding: 40px 24px;
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transform: translateY(0);
}

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.loading-spinner {
    font-size: 32px;
    animation: coffeeSpiral 2s ease-in-out infinite;
    filter: drop-shadow(0 2px 8px rgba(139, 69, 19, 0.3));
    display: inline-block;
    line-height: 1;
}

@keyframes coffeeSpiral {
    0% { 
        transform: rotate(0deg) scale(1);
        filter: drop-shadow(0 2px 8px rgba(139, 69, 19, 0.3));
    }
    25% { 
        transform: rotate(90deg) scale(1.1);
        filter: drop-shadow(0 4px 12px rgba(210, 105, 30, 0.4));
    }
    50% { 
        transform: rotate(180deg) scale(1.2);
        filter: drop-shadow(0 6px 16px rgba(139, 69, 19, 0.5));
    }
    75% { 
        transform: rotate(270deg) scale(1.1);
        filter: drop-shadow(0 4px 12px rgba(210, 105, 30, 0.4));
    }
    100% { 
        transform: rotate(360deg) scale(1);
        filter: drop-shadow(0 2px 8px rgba(139, 69, 19, 0.3));
    }
}

.loading-text {
    color: #475569;
    font-size: 14px;
    margin: 0;
    font-weight: 500;
    animation: none !important;
    transform: none !important;
    animation-name: none !important;
    animation-duration: 0s !important;
    animation-iteration-count: 0 !important;
}

.recent-purchases-widget.loading p,
.recent-purchases-widget.loading span,
.recent-purchases-widget.loading div:not(.loading-spinner) {
    animation: none !important;
    transform: none !important;
    animation-name: none !important;
    animation-duration: 0s !important;
}

.recent-purchases-widget.login-prompt {
    text-align: center;
    padding: 40px 24px;
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.prompt-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.prompt-icon {
    font-size: 48px;
    opacity: 0.8;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.prompt-container h4 {
    color: #1e293b;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.prompt-container p {
    color: #64748b;
    font-size: 14px;
    margin: 0;
    max-width: 200px;
    line-height: 1.5;
}

.login-btn {
    background: linear-gradient(135deg, #8B4513, #D2691E);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 4px 12px rgba(139, 69, 19, 0.3);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 69, 19, 0.4);
}

.recent-purchases-widget.error,
.recent-purchases-widget.no-data {
    text-align: center;
    padding: 40px 24px;
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.error-container,
.no-data-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.error-icon,
.no-data-icon {
    font-size: 48px;
    opacity: 0.8;
}

.error-container p,
.no-data-container p {
    color: #64748b;
    font-size: 14px;
    margin: 0;
    max-width: 200px;
    line-height: 1.5;
}

.no-data-container h4 {
    color: #1e293b;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.retry-btn,
.browse-btn {
    background: linear-gradient(135deg, #8B4513, #D2691E);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 3px 10px rgba(139, 69, 19, 0.3);
}

.retry-btn:hover,
.browse-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.4);
}

.widget-footer {
    margin-top: 1rem;
    text-align: center;
    padding-top: 1rem;
}

.view-all-btn {
    color: #8B4513;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.2rem;
    padding: 8px 24px;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: inline-block;
    background: #eee;
}

.view-all-btn:hover {
    background: #f8f9fa;
    color: #D2691E;
    text-decoration: none;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.recommendation-card:nth-child(1) { animation-delay: 0.1s; }
.recommendation-card:nth-child(2) { animation-delay: 0.2s; }
.recommendation-card:nth-child(3) { animation-delay: 0.3s; }
.recommendation-card:nth-child(4) { animation-delay: 0.4s; }
.recommendation-card:nth-child(5) { animation-delay: 0.5s; }

@media (max-width: 768px) {
    .recent-purchases-widget {
        margin: 12px;
        padding: 16px;
        border-radius: 16px;
    }
    
    .section-title {
        font-size: 1.1rem;
    }
    
    .recommendations-grid {
        gap: 10px;
    }
    
    .recommendation-card {
        padding: 12px;
        min-height: 70px;
    }
    
    .product-image-container {
        width: 50px;
        height: 50px;
        margin-right: 12px;
    }
    
    .product-name {
        font-size: 1rem;
    }
    
    .recommendation-reason {
        font-size: 0.7rem;
    }
    
    .recommendation-meta {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .recent-purchases-widget {
        margin: 8px;
        padding: 12px;
        border-radius: 12px;
    }
    
    .section-title {
        font-size: 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .recommendations-grid {
        gap: 8px;
    }
    
    .recommendation-card {
        padding: 10px;
        min-height: 60px;
    }
    
    .product-image-container {
        width: 45px;
        height: 45px;
        margin-right: 10px;
    }
    
    .product-name {
        font-size: 1rem;
        margin-bottom: 2px;
    }
    
    .recommendation-reason {
        font-size: 0.65rem;
        margin-bottom: 6px;
    }
    
    .recommendation-meta {
        font-size: 0.7rem;
    }
    
    .match-score {
        font-size: 0.65rem;
        padding: 3px 6px;
    }
    
    .product-link-btn {
        font-size: 0.65rem;
        padding: 3px 6px;
    }
}

.recommendation-card:focus {
    outline: 2px solid #8B4513;
    outline-offset: 2px;
}

.login-btn:focus,
.retry-btn:focus,
.browse-btn:focus {
    outline: 2px solid #8B4513;
    outline-offset: 2px;
}

@media print {
    .recent-purchases-widget {
        box-shadow: none;
        background: white;
    }
    
    .stock-status,
    .retry-btn,
    .browse-btn,
    .login-btn {
        display: none;
    }
} 