/* Variáveis de cores */
:root {
    --primary-color: #a43e1f;
    --secondary-color: #2c2c2c;
    --accent-color: #345b87;
    --background-color: #f5f7fa;
    --card-bg: #ffffff;
    --text-color: #333333;
    --border-color: #e0e0e0;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --success-color: #28a745;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    padding: 20px;
}

.glossario-app {
    max-width: 1320px; /* O segredo do Finsiders */
    width: 95%; /* Margem de segurança para telas menores que 1320px */
    margin-left: auto;
    margin-right: auto;
    padding-left: 15px; /* Evita que o conteúdo cole na borda em celulares */
    padding-right: 15px;
    padding-top: 20px;
    padding-bottom: 20px;
}

.glossario-header {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
    position: relative;
    text-align: center;
    padding: 0 15px;
}

.glossario-header h1 {
    margin: 0 auto;
    color: var(--primary-color);
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.back-button {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    transition: var(--transition);
    text-decoration: none;
    font-weight: 500;
}

.back-button:hover {
    background-color: var(--accent-color);
    transform: translateY(-50%) translateX(-2px);
}

.glossario-container {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 2px 15px var(--shadow-color);
    padding: 2rem;
    margin-top: 1rem;
}

.intro-text {
    text-align: center;
    color: #555;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.search-box {
    display: flex;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.search-box input {
    flex: 1;
    padding: 0.8rem 1rem;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    font-size: 1rem;
}

.search-box button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0 1.5rem;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-box button:hover {
    background-color: #a00624;
}

.alphabet-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.alphabet-nav a {
    display: inline-block;
    width: 36px;
    height: 36px;
    line-height: 36px;
    text-align: center;
    background-color: #f5f5f5;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: all 0.2s;
}

.alphabet-nav a:hover,
.alphabet-nav a.active {
    background-color: var(--primary-color);
    color: white;
}

.letter-section {
    margin-bottom: 2.5rem;
}

.letter-header {
    background-color: #f0f0f0;
    padding: 0.5rem 1rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--primary-color);
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}

.term {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px dashed #eee;
}

.term:last-child {
    border-bottom: none;
}

.term h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.term p {
    color: #555;
    line-height: 1.6;
    margin: 0;
}

.term .example {
    font-style: italic;
    color: #777;
    margin-top: 0.5rem;
    padding-left: 1rem;
    border-left: 2px solid #ddd;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: #777;
    font-style: italic;
}

/* Responsividade */
@media (max-width: 768px) {
    .glossario-container {
        padding: 1rem;
    }

    .alphabet-nav {
        gap: 0.3rem;
    }

    .alphabet-nav a {
        width: 30px;
        height: 30px;
        line-height: 30px;
        font-size: 0.9rem;
    }
}