* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    background: #f5f7fa;
    min-height: 100vh;
}

.container {
    width: 100%;
    background-color: white;
    flex: 1;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

header {
    background: linear-gradient(to right, #2c3e50, #4a6491);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    height: 150px;
    align-items: center;
    border-bottom: 3px solid #3498db;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo i {
    font-size: 2.5rem;
    color: #3498db;
}

.logo-text h1 {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.logo-text p {
    font-size: 1rem;
    opacity: 0.8;
}

.search-container {
    max-width: 400px;
    position: relative;
}

#search-input {
    width: 100%;
    padding: 14px 20px 14px 50px;
    font-size: 1.1rem;
    border: none;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    transition: all 0.3s ease;
}

#search-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

#search-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.5);
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.2rem;
}

.main-content {
    display: flex;
    /* Ocupa todo o espaço disponível */
    min-height: 0;
    height: calc(100vh - 250px);
    /* Corrige o problema de overflow no Flexbox */
}

.home-button {
    background: none;
    border: none;
    color: #3498db;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.home-button:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.home-button:active {
    transform: scale(0.95);
}

.definition-home {
    max-width: 10000px;
    margin: auto;
}

.welcome-message h2 {
    color: var(--secondary-color);
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.info-box {
    background-color: #f0f7ff;
    border-left: 4px solid var(--accent-color);
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.info-box i {
    color: var(--accent-color);
    font-size: 1.5rem;
    margin-bottom: 10px;
    display: block;
}

.info-box ul {
    margin-top: 15px;
    list-style: none;
}

.info-box li {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.info-box li i {
    margin-right: 10px;
    font-size: 1rem;
    margin-bottom: 0;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.feature-card {
    background-color: #e3f2fd;
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--box-shadow);
    transition: transform 0.3s;
    border-top: 3px solid var(--accent-color);
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    width: 50px;
    height: 50px;
    background-color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.feature-card h3 {
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.feature-card p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.how-to-use {
    background-color: #fff8e1;
    padding: 20px;
    border-radius: var(--border-radius);
    margin-top: 40px;
    border-left: 4px solid #ffc107;
}

.how-to-use h3 {
    color: #ff8f00;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.how-to-use h3 i {
    margin-right: 10px;
}

.how-to-use ol {
    padding-left: 20px;
}

.how-to-use li {
    margin-bottom: 10px;
    color: var(--text-color);
}

.word-list {
    width: 300px;
    background: #f8f9fa;
    border-right: 1px solid #e0e0e0;
    overflow-y: auto;
    padding: 20px 0;
    height: calc(100vh - 200px);
    /* Ajusta a altura para ocupar toda a tela menos o header */
    display: flex;
    flex-direction: column;
    /* Faz a lista ocupar toda a altura disponível do container pai */
}

.word-item {
    padding: 16px 25px;
    font-size: 1.2rem;
    font-weight: 500;
    border-left: 5px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 15px;
}

.word-item:hover {
    background: #e9ecef;
}

.word-item.active {
    background: #e3f2fd;
    border-left: 5px solid #3498db;
    color: #2c3e50;
}

.word-item i {
    color: #3498db;
    font-size: 1.3rem;
}

.word-detail {
    flex: 1;
    padding: 30px;
    background: white;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.word-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.word-title {
    font-size: 2.5rem;
    color: #2c3e50;
    font-weight: 700;
}

.word-icon {
    font-size: 2.8rem;
    width: 80px;
    height: 80px;
    background: #e3f2fd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3498db;
}

.meanings-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    flex: 1;
    /* Permite que o conteúdo cresça */
}

.meaning-item {
    background: #f9f9f9;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.meaning-item:hover {
    transform: translateY(-5px);
}

.meaning-image {
    height: auto;
    /* Alterado de height fixo */
    background: #276099;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    opacity: 0.9;
    flex-shrink: 0;
}

.meaning-image video {
    width: 100%;
    height: auto;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.meaning-content {
    padding: 25px;
    flex: 1;
    /* Ocupa todo o espaço restante */
    display: flex;
    flex-direction: column;
}

.meaning-icon {
    font-size: 1.8rem;
    color: #3498db;
    margin: 15px;
}

.meaning-text {
    font-size: 1.2rem;
    margin-bottom: 5px;
    font-weight: 600;
    color: #2c3e50;
    flex: 1;
    margin: 15px;
    /* Permite que o texto ocupe o espaço disponível */
}

.example {
    background: #cde7fa;
    padding: 20px;
    font-size: large;
    color: #1f2b36;
    margin-top: 10px;
    border-radius: 8px;
    flex-shrink: 0;
    /* Mantém altura fixa */
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
    padding: 50px;
    flex: 1;
    /* Ocupa todo o espaço disponível */
}

.empty-state i {
    font-size: 6rem;
    color: #bdc3c7;
    margin-bottom: 30px;
}

.empty-state h2 {
    font-size: 2.2rem;
    margin-bottom: 20px;
    color: #7f8c8d;
}

.empty-state p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
    color: #95a5a6;
}

@media (max-width: 1100px) {
    .meanings-container {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    }
}

@media (max-width: 900px) {
    .main-content {
        flex-direction: column;
    }

    .word-list {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
        max-height: 300px;
    }

    header {
        flex-direction: column;
        text-align: left;
        gap: 10px;
        height: 200px;
    }

    .search-container {
        max-width: 100%;
    }
}

@media (max-width: 800px) {
    .meanings-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 500px) {
    .word-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .word-title {
        font-size: 2rem;
    }

    .meaning-image {
        height: 150px;
        font-size: 4rem;
    }
}

footer {
    text-align: center;
    padding: 10px;
    background: #2c3e50;
    color: white;
    font-size: 1.1rem;
    height: 50px;
    margin-top: auto;
}

/* Classe de foco com alto contraste para acessibilidade */
/* Alto contraste para foco visível em todos os elementos navegáveis */
.focus-visible,
:focus-visible,
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible,
.word-item:focus-visible,
.home-button:focus-visible,
.meaning-item:focus-visible,
.feature-card:focus-visible {
    outline: 3px solid #000 !important;
    outline-offset: 2px !important;
    background-color: #3498db !important;
    color: #000 !important;
    /* Ajuste conforme necessário para contraste */
}