/* Custom styles for Novidades Marketplace */

/* Smooth transitions */
* {
    transition: all 0.2s ease-in-out;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #2563EB;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #1d4ed8;
}

/* Loading animations */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Animações modernas */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-fadeInUp {
    animation: fadeInUp 0.6s ease-out;
}

.animate-scaleIn {
    animation: scaleIn 0.5s ease-out;
}

/* Stagger animation para cards */
.product-card:nth-child(1) { animation-delay: 0.1s; }
.product-card:nth-child(2) { animation-delay: 0.2s; }
.product-card:nth-child(3) { animation-delay: 0.3s; }
.product-card:nth-child(4) { animation-delay: 0.4s; }

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

/* Card hover effects */
.product-card {
    background: white;
    border-radius: 1.5rem;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(0,0,0,0.05);
}

.product-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 
        0 20px 60px -12px rgba(37, 99, 235, 0.3),
        0 0 0 1px rgba(37, 99, 235, 0.1);
}

/* Image Container com Badge */
.product-card-image {
    position: relative;
    padding-top: 75%; /* Aspect ratio 4:3 */
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    overflow: hidden;
}

.product-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 1rem;
    background: white;
}

/* Container de imagem na página de produto */
.product-image-container {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    position: relative;
}

.product-image-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Badge de novo */
.badge-new {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* Info do card */
.product-card-body {
    padding: 1.5rem;
}

.product-card-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1E293B;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-description {
    color: #64748b;
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Footer do card com preço e ação */
.product-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
}

.product-price {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #10b981, #059669);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.product-button {
    background: linear-gradient(135deg, #2563EB, #1d4ed8);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.product-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

/* Button states */
.btn-loading {
    position: relative;
    color: transparent;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Toast notifications */
.toast {
    animation: slideIn 0.3s ease;
}

.toast-error {
    background-color: #ef4444;
}

.toast-success {
    background-color: #10b981;
}

.toast-warning {
    background-color: #f59e0b;
}

/* Modal animations */
.modal {
    animation: fadeIn 0.3s ease;
}

.modal-content {
    animation: fadeIn 0.3s ease;
}

/* Rating stars */
.rating-star {
    color: #fbbf24;
    transition: color 0.2s ease;
}

.rating-star:hover {
    color: #f59e0b;
}

/* Status badges */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-pendente {
    background-color: #fef3c7;
    color: #92400e;
}

.status-aprovado {
    background-color: #d1fae5;
    color: #065f46;
}

.status-cancelado {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Form validation */
.form-error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-success {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Product image placeholder */
.product-image-placeholder {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 3rem;
}

/* Product images - mostrar imagem completa sem cortar */
.product-card img {
    object-fit: contain !important;
    width: 100%;
    height: 100%;
    background: white;
    padding: 10px;
}

/* Download button */
.download-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    transition: all 0.3s ease;
}

.download-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Admin panel specific */
.admin-section {
    animation: fadeIn 0.5s ease;
}

.admin-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.admin-card:hover {
    border-color: #2563EB;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .product-card:hover {
        transform: none;
    }
    
    .modal-content {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
    }
    
    .bg-background {
        background: white !important;
    }
}

/* Dark mode support (future enhancement) */
@media (prefers-color-scheme: dark) {
    /* Dark mode styles can be added here */
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles for better accessibility */
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #2563EB;
    outline-offset: 2px;
}

/* Logo com borda e efeito */
.logo-container {
    position: relative;
    transition: transform 0.3s ease;
}

.logo-container:hover {
    transform: rotate(5deg) scale(1.05);
}

.logo-image {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* =====================
   Botões - Responsivo (Mobile First)
   ===================== */
/* Base responsiva para botões */
.button-base,
.product-button,
button.bg-primary,
button.bg-accent,
button.bg-red-500,
a.bg-primary,
a.bg-accent,
a.bg-red-500 {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    line-height: 1.2;
    text-align: center;
    text-wrap: pretty;
}

/* Largura total e prevenção de estouro no mobile */
@media (max-width: 640px) {
    .product-card .product-button,
    #auth-buttons button,
    #mobile-auth-buttons button,
    #mobile-user-menu a,
    a.bg-primary, a.bg-accent, a.bg-red-500,
    button.bg-primary, button.bg-accent, button.bg-red-500 {
        width: 100%;
    }
}

/* Desativar efeitos de hover pesados em devices sem hover */
@media (hover: none) {
    .product-button:hover {
        transform: none;
        box-shadow: 0 4px 12px rgba(37, 99, 235, 0.30);
    }
}

/* Footer dos cards com espaçamento seguro */
.product-card-footer {
    gap: 0.75rem;
}

/* Foco acessível consistente */
.product-button:focus-visible,
button:focus-visible,
a:focus-visible {
    outline: 2px solid rgba(37, 99, 235, 0.75);
    outline-offset: 2px;
}

/* Ajustes específicos da página de produto (mobile-first) */
@media (max-width: 640px) {
    #buy-button { 
        width: 100%; 
        padding: 1rem;
        font-size: 1rem;
    }
    
    .product-card-image { 
        padding-top: 66%; 
    }
    
    /* Página de produto - ajustes mobile */
    #product-content .grid {
        gap: 1.5rem;
    }
    
    #product-content .sticky {
        position: relative;
        top: 0;
    }
    
    /* Carrinho - botões 100% no mobile */
    #btn-copy-pix, #btn-try-again, #go-downloads { 
        width: 100%; 
    }
    
    /* Imagem do produto mobile */
    .product-image-container {
        min-height: 250px;
    }
}

/* Ajustes para tablets */
@media (min-width: 641px) and (max-width: 1024px) {
    #product-content .grid {
        gap: 2rem;
    }
    
    .product-image-container {
        min-height: 400px;
    }
}
