/* Reset e base */
html, body {
    margin: 0;
    padding: 0;
    background-color: #121212; /* fundo escuro estilo anime */
    color: #eee;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    height: 100%;
    overflow-y: auto;
}

/* Header */
header {
    background-color: #1e1e1e;
    box-shadow: 0 2px 8px rgba(224, 62, 47, 0.6);
    border-radius: 0 0 10px 10px;
    position: sticky;
    top: 0;
    z-index: 100;
    user-select: none;
    padding: 10px 0;
}

header .header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

/* Estilo para o título de texto "Anime Story" */
.title-logo {
    flex-grow: 1;
    text-align: center;
    padding-left: 210px;
}
.welcome-message {
    font-size: 1.2rem;
    color: #ffffff;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(242, 101, 34, 0.8), 0 0 20px rgba(242, 101, 34, 0.6);
    padding-top: 5px;
    
    
}
.anime-story-title {
    font-family: 'Arial', sans-serif;
    font-size: 3rem;
    color: #f26522;
    text-shadow: 0 0 10px rgba(242, 101, 34, 0.8), 0 0 20px rgba(242, 101, 34, 0.6);
    margin: 0;
    padding: 0;
  
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

/* Contêiner para os botões do cabeçalho */
.header-buttons {
    display: flex;
    flex-shrink: 0;
    gap: 10px;
}

/* Estilo dos botões */
.btn-link, #btnLogout, #startQuizBtn {
    background-color: #e03e2f;
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(224, 62, 47, 0.8);
    transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
    user-select: none;
    text-decoration: none;
    
}

.btn-link:hover, #btnLogout:hover, #startQuizBtn:hover {
    background-color: #f26522;
    box-shadow: 0 6px 18px rgba(242, 101, 34, 0.9);
    transform: scale(1.05);
}

.btn-link:active, #btnLogout:active, #startQuizBtn:active {
    transform: scale(0.95);
    box-shadow: 0 3px 7px rgba(224, 62, 47, 0.7);
}

/* Container principal do main: 3 colunas lado a lado */
.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 15px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: flex-start;
    min-height: calc(100vh - 100px);
    box-sizing: border-box;
}

/* box-l: lista lateral */
.box-l {
    flex: 1;
    border-right: 2px solid #e03e2f;
    padding-right: 15px;
    box-sizing: border-box;
}

.anime-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.anime-item {
    padding: 10px 15px;
    margin-bottom: 8px;
    cursor: pointer;
    background-color: #e03e2f;
    color: #fff;
    border-radius: 25px;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(224, 62, 47, 0.6);
    transition: background-color 0.3s ease;
    user-select: none;
}

.anime-item:hover,
.anime-item.active {
    background-color: #f26522;
    box-shadow: 0 4px 12px rgba(242, 101, 34, 0.7);
}

/* box-m: centro com banner, descrição e personagens */
.box-m {
    flex: 3;
    padding: 0 20px;
    border-right: 2px solid #e03e2f;
    box-sizing: border-box;
}

/* Banner */
.anime-banner {
    width: 100%;
    max-height: 500px;
    border-radius: 10px;
    object-fit: cover;
    box-shadow: 0 0 10px #f26522;
    margin-bottom: 15px;
    border: 3px solid #e03e2f;
}

/* Descrição */
.anime-description {
    font-size: 1.1rem;
    font-weight: 500;
    color: #ddd;
    margin-bottom: 25px;
}

/* Miniaturas em grid 5 colunas */
.character-thumbs {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    justify-items: center;
}

.character-thumbs .thumb-container {
    text-align: center;
    cursor: pointer;
    user-select: none;
}

.character-thumbs .thumb-container img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 3px solid #e03e2f;
    object-fit: cover;
    box-shadow: 0 0 8px rgba(224, 62, 47, 0.7);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.character-thumbs .thumb-container img:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px #f26522;
}

.character-thumbs .thumb-container span {
    margin-top: 8px;
    color: #f26522;
    font-weight: 700;
    font-size: 0.95rem;
    display: block;
}


/* box-r: card do personagem com recuo */
.box-r {
    flex: 2.5;
    padding-left: 10px;
    box-sizing: border-box;
}

.character-card {
    background-color: #1e1e1e;
    color: #f2f2f2;
    border-radius: 12px;
    padding: 25px 30px;
    box-shadow: 0 0 20px #e03e2f;
    max-width: 420px;
    margin: 0 auto;
    user-select: text;
}

.character-card.hidden {
    display: none;
}

footer {
    margin-top: 100px;
    background-color: #1e1e1e;
    padding: 10px;
    text-align: center;
    border-radius: 10px 10px 0 0;
    box-shadow: 0 -2px 8px rgba(224, 62, 47, 0.6);
}

#charImage {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: 4px solid #e03e2f;
    object-fit: cover;
    margin-bottom: 18px;
    box-shadow: 0 0 20px #f26522;
}

#charName {
    font-size: 1.9rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #f26522;
}

#charDesc {
    font-size: 1.1rem;
    font-weight: 500;
    color: #ccc;
    padding: 0 15px;
}

/* Estilos do Quiz Overlay */
.quiz-container {
    position: fixed; /* Posição fixa para sobrepor todo o conteúdo */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9); /* Fundo semi-transparente */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999; /* Garante que fique acima de outros elementos */
}

.quiz-container.hidden {
    display: none;
}

.quiz-content {
    position: relative;
    width: 90%;
    max-width: 600px;
    background-color: #1e1e1e;
    border-radius: 12px;
    padding: 40px 30px;
    box-shadow: 0 0 20px rgba(224, 62, 47, 0.6);
    text-align: center;
    margin-top: -50px; /* Eleva a caixa para que ela fique mais centralizada verticalmente */
}

.quiz-content h2 {
    font-size: 2rem;
    color: #f26522;
    margin-bottom: 20px;
    text-shadow: 0 0 5px rgba(242, 101, 34, 0.8);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    color: #e03e2f;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: #f26522;
}

.quiz-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.btn-quiz {
    padding: 10px 20px;
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    background-color: #e03e2f;
    border: 2px solid #e03e2f;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-quiz:hover {
    background-color: #f26522;
}

#quiz-feedback {
    margin-top: 20px;
    font-size: 1.2rem;
    font-weight: bold;
    text-align: center;
}

/* Layout das opções do quiz */
.options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 15px;
}

/* Estilos para as opções do quiz */
.quiz-option {
    background-color: #333;
    color: #eee;
    border: 2px solid #e03e2f;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    width: 100%;
    text-align: left;
}

.quiz-option:hover {
    background-color: #e03e2f;
    border-color: #f26522;
}

/* Feedback de resposta */
.quiz-option.correct {
    background-color: #28a745;
    border-color: #28a745;
}

.quiz-option.incorrect {
    background-color: #dc3545;
    border-color: #dc3545;
}

/* Responsivo: menos colunas na grid e ajuste das boxes */
@media (max-width: 1000px) {
    .container {
        flex-direction: column;
    }
    .box-l, .box-m, .box-r {
        max-height: none;
        padding: 10px 0;
        border: none;
    }
    .character-thumbs {
        grid-template-columns: repeat(3, 1fr);
    }
    .character-card {
        max-width: 90vw;
        margin: 20px auto;
    }
    .quiz-container {
        padding: 20px;
    }
}

@media (max-width: 600px) {
    header .header-container {
        flex-direction: column;
        align-items: center;
    }
    .title-logo {
        width: 100%;
        text-align: center;
    }
    .anime-story-title {
        font-size: 2.5rem;
    }
    .header-buttons {
        width: 100%;
        justify-content: center;
    }
    #btnLogout, #startQuizBtn {
        flex-grow: 1;
    }
    .character-thumbs {
        grid-template-columns: repeat(2, 1fr);
    }
    .character-card {
        padding: 20px;
    }
    .quiz-container {
        max-width: 90vw;
        padding: 15px;
    }
}