/* Preview Cards Styling */
.previews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.preview-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.preview-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.preview-card.selected {
    border: 3px solid #7c3aed;
    box-shadow: 0 8px 30px rgba(124, 58, 237, 0.3);
}

.preview-image {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
    background: #f8fafc;
}

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

.preview-card:hover .preview-image img {
    transform: scale(1.05);
}

.preview-link {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    text-decoration: none;
}

.preview-card:hover .preview-link {
    opacity: 1;
}

.preview-link span {
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    background: #7c3aed;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    transition: background 0.3s ease;
}

.preview-link:hover span {
    background: #6d28d9;
}

.preview-content {
    padding: 1.5rem;
}

.preview-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #1f2937;
}

.preview-content p {
    color: #6b7280;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.preview-colors {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.color-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #e5e7eb;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.preview-features {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.preview-features li {
    padding: 0.25rem 0;
    color: #4b5563;
    font-size: 0.95rem;
}

.preview-features li:before {
    content: "✓";
    color: #10b981;
    font-weight: bold;
    margin-right: 0.5rem;
}

.select-preview-btn {
    width: 100%;
    padding: 0.75rem;
    background: #7c3aed;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s ease;
    margin-top: 1rem;
}

.select-preview-btn:hover {
    background: #6d28d9;
}

.preview-card.selected .select-preview-btn {
    background: #10b981;
}

.preview-card.selected .select-preview-btn:hover {
    background: #059669;
}

/* Loading state */
#previews-container.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

#previews-container.loading:before {
    content: "";
    width: 50px;
    height: 50px;
    border: 3px solid #e5e7eb;
    border-top-color: #7c3aed;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Preview section header */
.preview-section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.preview-section-header h2 {
    font-size: 2.5rem;
    color: #1f2937;
    margin-bottom: 1rem;
}

.preview-section-header p {
    font-size: 1.25rem;
    color: #6b7280;
    max-width: 600px;
    margin: 0 auto;
}

/* Real Preview Badge */
.real-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #10b981;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.preview-card.portfolio .real-badge {
    background: #f59e0b;
}

.preview-card.theme_demo .real-badge {
    background: #8b5cf6;
}

/* Portfolio Info */
.portfolio-info {
    margin: 0.5rem 0;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.portfolio-info small {
    color: #6b7280;
    font-style: italic;
}

/* Preview Overlay for Selection */
.preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(124, 58, 237, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.preview-card.selected .preview-overlay {
    opacity: 1;
}

.check-icon {
    width: 60px;
    height: 60px;
    background: #7c3aed;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4);
}

/* Ensure link is clickable */
.preview-link {
    z-index: 20;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .previews-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .preview-image {
        height: 200px;
    }
    
    .preview-content h3 {
        font-size: 1.25rem;
    }
    
    .preview-features {
        font-size: 0.9rem;
    }
    
    .real-badge {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }
}