/* Importação das fontes diretamente no CSS */
@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@300;400;500;600;700&family=Reenie+Beanie&family=Oswald:wght@200;300;400;500;600;700&display=swap');

/* Definição das variáveis de cores */
:root {
    --imdb-yellow: #f5c518ff;
    --imdb-dark-yellow: #dba506ff;
    --imdb-black: #000000ff;
    --imdb-dark-gray: rgba(26, 26, 26, 0.867);
    --imdb-white: #ffffffff;
}

/* General Body Styles */
body {
    font-family: 'Source Sans 3', sans-serif;
    background: linear-gradient(135deg, var(--imdb-dark-gray) 0%, var(--imdb-black) 100%);
    color: var(--imdb-white);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Container Principal */
.container {
    flex: 1 0 auto;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

/* Header Styles */
header {
    background: var(--imdb-black);
    padding: 3rem 0;
    border-bottom: 1px solid rgba(245, 197, 24, 0.5);
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

header h1 {
    font-family: 'Oswald', sans-serif;
    font-size: 3rem;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    color: var(--imdb-yellow);
}

header p {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 1.1rem;
    font-weight: 300;
    color: var(--imdb-dark-gray);
}

/* Input Group Styles */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 2rem 1rem 0;
    width: 100%;
}

/* Inputs */
.input-group input {
    border: none;
    border-radius: 50px;
    padding: 12px 20px;
    width: 100%;
    max-width: 320px;
    font-size: 1rem;
    background: var(--imdb-dark-gray);
    color: var(--imdb-white);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.input-group input:focus {
    box-shadow: 0 4px 20px rgba(219, 165, 6, 0.2);
    outline: none;
    transform: scale(1.02);
}

/* Select Styles */
#ordem,
#limite-resultados,
#media-type {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    padding: 12px 15px;
    border: none;
    border-radius: 50px;
    background: var(--imdb-dark-gray);
    color: var(--imdb-white);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 120px;
    text-align: center
}

#ordem:hover,
#limite-resultados:hover,
#media-type:hover {
    box-shadow: 0 4px 20px rgba(245, 197, 24, 0.2);
    transform: translateY(-2px);
}

#ordem:focus,
#limite-resultados:focus,
#media-type:focus {
    box-shadow: 0 4px 20px rgba(245, 197, 24, 0.2);
    border: 1px solid var(--imdb-yellow);
}

/* Button Styles */
.btn {
    background: linear-gradient(90deg, var(--imdb-yellow) 0%, var(--imdb-dark-yellow) 100%);
    color: var(--imdb-black);
    border: none;
    padding: 12px 25px;
    border-radius: 50px;
    cursor: pointer;
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.btn:hover {
    background: linear-gradient(90deg, var(--imdb-dark-yellow) 0%, var(--imdb-yellow) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(245, 197, 24, 0.3);
}

/* Estilo específico para o botão de pesquisa */
#btn_pesquisa {
    width: auto; /* Largura natural */
}

/* Layout Button */
#btn_layout {
    margin: 2rem auto;
    display: block;
    background: var(--imdb-dark-yellow);
    padding: 10px 20px;
    font-size: 0.95rem;
    border-radius: 50px;
    transition: all 0.3s ease;
    color: var(--imdb-black);
}

#btn_layout:hover {
    background: var(--imdb-yellow);
    transform: translateY(-2px);
}

/* Results Section */
#resultado {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin: 1rem 1rem 0;
    padding: 0 1rem;
}

/* Card Styles (Grid Mode) */
.movie-item {
    background: var(--imdb-dark-gray);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.movie-item img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.movie-item .movie-footer {
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.movie-item .movie-footer a {
    flex-shrink: 0;
}

.movie-item .movie-footer span {
    text-align: right;
}

.movie-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.movie-item img {
    padding: 5px;
    width: 100%;
    height: auto;
    max-height: 320px;
    object-fit: contain;
    display: block;
    transition: transform 0.3s ease;
}

.movie-item h3 {
    font-family: 'Oswald', sans-serif;
    font-size: 1.25rem;
    font-weight: 500;
    margin: 12px 0;
    padding: 0 12px;
    color: var(--imdb-yellow);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.movie-item p {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.95rem;
    font-weight: 300;
    padding: 0 12px 12px;
    color: var(--imdb-white);
}

/* Footer Styles */
.footer {
    background: var(--imdb-white);
    color: var(--imdb-black);
    padding: 0.8rem 0;
    text-align: center;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.9rem;
    font-weight: 200;
    flex-shrink: 0;
    width: 100%;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.footer p {
    margin: 0;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.footer::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 4px;
    background: var(--imdb-dark-yellow);
    border-radius: 2px;
}

/* Container das categorias */
.categories {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: center;
}

/* Estilo base para ambas as categorias */
.category-card, .category-card_serie {
    background-color: var(--imdb-dark-gray);
    padding: 15px 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    width: 160px;
    color: var(--imdb-white);
    display: none; /* Esconder por padrão */
    text-align: center; /* Garantir alinhamento horizontal do texto */
}

/* Hover para ambas as categorias */
.category-card:hover, .category-card_serie:hover {
    background-color: var(--imdb-yellow);
    color: var(--imdb-black);
    transform: scale(1.05);
}

/* Estado selecionado para ambas as categorias */
.category-card.selected, .category-card_serie.selected {
    background-color: var(--imdb-dark-yellow);
    color: var(--imdb-black);
    transform: scale(1.0);
}

/* Classe para mostrar os cartões e centralizar o conteúdo */
.visible {
    display: flex;
    justify-content: center; /* Centralizar horizontalmente */
    align-items: center; /* Centralizar verticalmente */
}

/* Responsive Design */
@media (max-width: 767px) {
    header h1 {
        font-size: 2.25rem;
    }

    .d-flex {
        flex-direction: column;
        align-items: center; /* Centralizar os itens em telas pequenas */
        gap: 8px;
        margin-top: 1rem;
    }

    .d-flex input#titulo {
        margin-top: 1rem;
        text-align: center;
    }

    .d-flex input#titulo,
    .d-flex input#ano {
        padding: 8px 15px;
        font-size: 0.9rem;
        max-width: 220px;;
    }

    #ordem,
    #limite-resultados,
    #media-type {
        padding: 8px 12px;
        font-size: 0.9rem;
        max-width: 90px;
        margin-right: 8px;
    }

    #btn_pesquisa.btn {
        padding: 8px 20px;
        font-size: 0.9rem;
    }

    #resultado {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        margin-top: 0.5rem;
    }

    .footer {
        padding: 1rem 0;
        font-size: 0.85rem;
    }
}

@media (min-width: 768px) {
    .d-flex {
        flex-direction: row;
        align-items: center;
        gap: 15px;
        margin-top: 2rem;
        text-align: center;
    }

    .d-flex input {
        width: 220px;
        flex: 1;
        max-width: none;
    }

    #ordem,
    #limite-resultados,
    #media-type {
        width: auto;
        flex: 0 0 120px;
        max-width: none;
    }

    #btn_pesquisa.btn {
        width: auto;
    }
}

/* Animações sutis para carregamento */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

#resultado, .list {
    animation: fadeIn 0.5s ease-in;
}

/* Placeholder Styles */
#titulo::placeholder,
#ano::placeholder {
    font-size: 1rem;
    color: var(--imdb-black);
}

.modal {
    display: none; /* Escondido por padrão */
    position: fixed; /* Fixo na tela */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Fundo escurecido */
    z-index: 10000; /* Aumentado para ficar acima de tudo */
}

.modal[style*="display: block"] .modal-content {
    background: var(--imdb-dark-gray);
    color: var(--imdb-white);
    margin: 15% auto;
    padding: 20px;
    border: 1px solid rgba(245, 197, 24, 0.3);
    border-radius: 8px;
    width: 50%;
    position: relative;
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    text-align: center;
    transition: all 0.3s ease;
    z-index: 10001; /* Acima do fundo do modal */
}

.modal[style*="display: block"] .modal-content:hover {
    border-color: rgba(245, 197, 24, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.modal[style*="display: block"] .close {
    color: var(--imdb-white);
    float: right;
    font-size: 28px;
    cursor: pointer;
    font-weight: 400;
    transition: all 0.3s ease;
    z-index: 10002; /* Acima do conteúdo do modal */
}

.modal[style*="display: block"] .close:hover {
    color: var(--imdb-yellow);
}

