/**
 * Estilos para Carrossel e Grid de Modelos
 * Celebra Chá - Preview de Modelos
 */

/* ========================================
   CARROSSEL DE MODELOS (Splide)
   ======================================== */

.celebra-modelos-carousel-wrapper {
    position: relative;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 16px 16px 16px;
}

.celebra-modelos-carousel-wrapper .splide {
    position: relative;
}

.carousel-header {
    margin-bottom: 2rem;
}

.carousel-title {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.carousel-subtitle {
    font-size: 1.125rem;
    color: #6b7280;
}

.celebra-modelos-carousel-wrapper .splide__track {
    padding: 0px 16px 10px 16px;
}

.celebra-modelos-carousel-wrapper .splide__slide {
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.celebra-modelos-carousel-wrapper .splide__slide:hover {
    box-shadow: 0 16px 20px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);    
}

.celebra-modelos-carousel-wrapper .splide__pagination {
    margin-top: 20px;
    position: relative;
}

/* Cards de Modelo */
.modelo-card {
    background: white;     
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Screenshot */
.modelo-screenshot {
    position: relative;
    width: 100%;
    height: 210px;
    overflow: hidden;
    background: #f3f4f6;
}

.modelo-screenshot img {
    width: 100%;
    height: 100% !important;
    object-fit: cover;    
}

.modelo-card:hover .modelo-screenshot img {
    
}

/* Badge de acesso */
.badge-access {    
    padding: 0.5rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

/* Overlay ao hover */
.modelo-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modelo-card:hover .modelo-overlay {
    opacity: 1;
}

.btn-preview-modelo {
    background: white;
    color: #1f2937;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    transform: scale(0.95);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-preview-modelo:hover {
    background: #f3f4f6;
    transform: scale(1);
}

/* Informações do modelo */
.modelo-info {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.modelo-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.75rem;
}

.modelo-categorias {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.categoria-tag {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

.btn-preview-modelo-mobile {
    padding: 16px;
    font-size: 18px;
}

/* Controles do Splide */
.celebra-modelos-carousel-wrapper .splide__arrow,
.celebra-modelos-carousel-wrapper .splide__arrow:focus {
    background: white;
    width: 3rem;
    height: 3rem;
    border-radius: 50% !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    opacity: 1;
    transition: all 0.2s ease;
}

.celebra-modelos-carousel-wrapper .splide__arrow svg {
    fill: #9378e3;
    width: 1.25rem;
    height: 1.25rem;
}

.celebra-modelos-carousel-wrapper .splide__arrow:hover {
    background: #f3f4f6;    
}

.celebra-modelos-carousel-wrapper .splide__arrow:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.celebra-modelos-carousel-wrapper .splide__arrow--prev {
    left: 10px;
}

.celebra-modelos-carousel-wrapper .splide__arrow--next {
    right: 10px;
}

/* Paginação do Splide */
.celebra-modelos-carousel-wrapper .splide__pagination {
    position: relative;
    bottom: 0;
    margin-top: 0.5rem;
}

.celebra-modelos-carousel-wrapper .splide__pagination__page {
    width: 0.75rem;
    height: 0.75rem;
    background: #d1d5db;
    opacity: 1;
    margin: 0 0.25rem;
}

.celebra-modelos-carousel-wrapper .splide__pagination__page.is-active {
    background: #9378e3;
    transform: scale(1.2);
}

/* ========================================
   MODAL DE PREVIEW
   ======================================== */

.celebra-preview-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 999999;
    animation: fadeIn 0.3s ease;
}

.celebra-preview-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 1400px;
    max-height: 90vh;
    background: white;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

.preview-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: linear-gradient(to right, #9378e3, #ec4899);
    color: white;
}

#celebra-preview-modal .preview-modal-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: white;
}

#celebra-preview-modal .btn-close-preview {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.2rem;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-close-preview:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.preview-modal-iframe {
    width: 100%;
    height: calc(90vh - 4rem);
    border: none;
    background: white;
}

.preview-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 1.25rem;
    color: #6b7280;
}

/* Spinner de loading */
.preview-spinner {
    border: 4px solid #f3f4f6;
    border-top: 4px solid #9333ea;
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

/* ========================================
   ANIMAÇÕES
   ======================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

/* ========================================
   RESPONSIVO
   ======================================== */

@media (max-width: 768px) {
    .carousel-title {
        font-size: 1.5rem;
    }
    
    .carousel-subtitle {
        font-size: 1rem;
    }
    
    .modelo-screenshot {
        height: 12rem;
    }
    
    .celebra-modelos-carousel-wrapper .splide__arrow {
        width: 2.5rem;
        height: 2.5rem;
    }
    
    .celebra-modelos-carousel-wrapper .splide__arrow svg {
        width: 1rem;
        height: 1rem;
    }
    
    .preview-modal-content {
        max-height: 100vh;
        border-radius: 0;
    }
    
    .preview-modal-iframe {
        height: calc(100vh - 4rem);
    }
}

/* Esconde botão hover em mobile */
@media (max-width: 1024px) {
    .modelo-overlay {
        display: none;
    }
}

/* ========================================
   GRID DE MODELOS
   ======================================== */

.celebra-modelos-grid-wrapper {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.grid-header {
    margin-bottom: 2rem;
}

.grid-title {
    font-size: 2.25rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.75rem;
}

.grid-subtitle {
    font-size: 1.25rem;
    color: #6b7280;
}

/* Filtros */
#grid-filters.grid-filters {
    background-color: #f7f7f7;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

#grid-filters .filter-search input,
#grid-filters .filter-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

#grid-filters .filter-search input {
    cursor: text;
}

.filter-search input:focus,
.filter-select:focus {
    outline: none;
    border-color: #9333ea;
}

#grid-filters .btn-clear-filters {
    background: #6c5dd4;
    border: none;
    cursor: pointer;
    padding: 12px 16px;
    font-size: 16px;
    color: #fff;
    font-weight: 400;
    transition: all 0.2s ease;
}

#grid-filters .btn-clear-filters:hover {
    opacity: 0.9;
}

/* Contador de Resultados */
.results-count {
    margin-bottom: 1rem;
}

.results-count p {
    color: #6b7280;
    font-size: 0.875rem;
}

/* Grid de Cards */
.modelos-grid {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.modelo-card-wrapper.hidden {
    display: none;
}

/* Mensagem de Nenhum Resultado */
.no-results {
    text-align: center;
    padding: 3rem;
}

.no-results.hidden {
    display: none;
}

/* Paginação */
.pagination-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.btn-page {
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.btn-page:hover:not(:disabled) {
    background: #f9fafb;
}

.btn-page:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-page-number {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid #d1d5db;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.btn-page-number:hover {
    background: #f9fafb;
}

.btn-page-number.active {
    background: linear-gradient(to right, #9333ea, #ec4899);
    color: white;
    border-color: transparent;
}

/* ========================================
   MENSAGEM VAZIA
   ======================================== */

.celebra-modelos-empty {
    text-align: center;
    padding: 3rem;
    color: #6b7280;
    font-size: 1.125rem;
}

/* ========================================
   RESPONSIVO - GRID
   ======================================== */

@media (max-width: 768px) {
    .grid-title {
        font-size: 1.75rem;
    }
    
    .grid-subtitle {
        font-size: 1rem;
    }
    
    .filters-container {
        grid-template-columns: 1fr;
    }
    
    .modelos-grid {
        grid-template-columns: 1fr;
    }
    
    .pagination-wrapper {
        flex-wrap: wrap;
    }
    
    .btn-page {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }
}
