/* Resetando o estilo padrão */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    padding-top: 140px;
    font-family: Arial, sans-serif;
    background-size: cover; /* Faz o GIF cobrir toda a tela sem repetir */
    background-attachment: fixed;
    color: white;
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Garante que a altura seja 100% da tela */
    position: relative; /* Necessário para o carrossel */
}

/* Cabeçalho fixo no topo */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: #1c1c1c;
    z-index: 1000;
    flex-wrap: wrap;
    gap: 10px;
}

header .logo {
    flex: 0 1 auto;
}

header .logo img {
    max-width: 70px;
    height: auto;
}

header .search-bar {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

header .search-bar input {
    padding: 10px;
    font-size: 16px;
    border: none;
    border-radius: 5px;
    width: 100%;
    max-width: 400px;
}

header .search-bar button {
    padding: 10px 20px;
    background-color: #007BFF;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

header .search-bar button:hover {
    background-color: #0ab959;
}

/* Corpo */
.body-content {
    margin-top: 10px;
    padding: 20px;
    flex-grow: 1;
}

/* Centralizando o conteúdo de resultados */
#results {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

#results .character {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    min-height: 500px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Cada card de personagem */
.character {
    margin: 10px;
    padding: 20px;
    font-family:cursive;
    color: whitesmoke;
    background-color:rgba(0, 0, 0, 0.7);
    border: 2px solid #3adfbb;
    border-radius: 5px;
    width: 100%;
    max-width: 350px;
    gap: 20px;
    text-align: center;
    word-wrap: break-word;
}

/* Imagem do personagem */
.character-img {
    width: 100%;
    height: 300px;
    border-radius: 10px;
    transition: .6s;
}

.character-img:hover{

    scale: 1.1;
    transition: .6s;
    box-shadow: 0 10px 10px goldenrod;
}

/* Rodapé */
footer {
    background-color: #1c1c1c;
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: auto;
}

/* Estilo do carrossel */
.carousel {
    position: fixed; /* Fixando o carrossel no fundo */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1; /* Garante que o carrossel fique atrás do conteúdo */
}

.carousel-item {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

/* Quando o carrossel estiver ativo para mostrar um GIF */
.carousel-item.active {
    opacity: 1;
}

/* Contêiner do Flip Card */
.flip-card {
    perspective: 1000px; /* Define a perspectiva para o efeito 3D */
    width: 100%;
    height: 300px;
    margin: auto;
}

/* Elemento interno do Flip Card */
.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.6s; /* Tempo da animação */
}

/* Quando o card é hoverado */
.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg); /* Faz o flip horizontal */
}

/* Faces do card */
.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden; /* Oculta a face não visível */
    border-radius: 10px;
    overflow: hidden;
}

/* Frente do card */
.flip-card-front {
    background-color: #333; /* Cor de fundo caso a imagem não carregue */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Verso do card */
.flip-card-back {
    background-color: #444; /* Cor de fundo para o verso */
    transform: rotateY(180deg); /* Inverte a face traseira */
    display: flex;
    align-items: center;
    justify-content: center;
}



/* Responsividade */
@media (max-width: 700px) {
    header {
        justify-content: center; /* Centraliza elementos em telas menores */
    }

    header .logo {
        display: none; /* Esconde os logos para dispositivos menores */
    }

    header .search-bar {
        width: 100%; /* Barra de pesquisa ocupa toda a largura */
    }

    header .search-bar input {
        max-width: 100%; /* Remove limite em telas menores */
    }

    #results .character {
        min-height: 450px;
    }

    main {
        margin-top: 140px; /* Ajusta para telas menores */
    }

    section {
        margin-top: 15px; /* Menos margem nas seções para telas menores */
    }
}

@media (max-width: 480px) {
    header {
        flex-direction: column;
        align-items: center;
    }

    header .search-bar input, 
    header .search-bar button {
        width: 100%;
    }

    #results .character {
        width: 100%;
    }

    main {
        margin-top: 120px; /* Ajuste adicional para telas muito pequenas */
    }
}