:root {
    --primary-color: #3a0ca3;
    --secondary-color: #4361ee;
    --accent-color: #7209b7;
    --background-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-color: #1e293b;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* Dark Mode Colors */
[data-theme="dark"] {
    --primary-color: #4c6ef5;
    --secondary-color: #6d8aee;
    --accent-color: #9d4edd;
    --background-color: #1a202c;
    --card-bg: #2d3748;
    --text-color: #e2e8f0;
    --border-color: #4a5568;
}

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

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: var(--transition);
    padding-bottom: 60px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background-color: var(--primary-color);
    color: white;
    padding: 20px 0;
    box-shadow: var(--box-shadow);
    position: relative;
}

.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
}

#theme-button {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: var(--transition);
}

#theme-button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.logo {
    margin-bottom: 10px;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
}

header p {
    font-weight: 300;
    max-width: 700px;
}

.main-content {
    display: flex;
    margin-top: 30px;
    gap: 30px;
}

.sidebar {
    width: 250px;
    position: sticky;
    top: 30px;
    align-self: flex-start;
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--box-shadow);
}

.sidebar h3 {
    margin-bottom: 15px;
    font-size: 1.2rem;
    color: var(--primary-color);
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar ul {
    list-style: none;
}

.sidebar li {
    margin-bottom: 10px;
}

.sidebar a {
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
    display: block;
    padding: 8px 5px;
    border-radius: 4px;
}

.sidebar a:hover, .sidebar a.active {
    background-color: rgba(67, 97, 238, 0.1);
    color: var(--primary-color);
    padding-left: 10px;
}

.sidebar a i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

main {
    flex: 1;
}

section {
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--box-shadow);
}

section h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
}

section h2 i {
    margin-right: 10px;
}

section h3 {
    margin: 25px 0 15px;
    color: var(--accent-color);
}

.vocabulary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.vocabulary-card {
    background-color: var(--background-color);
    border-radius: 8px;
    padding: 15px;
    border: 1px solid var(--border-color);
    position: relative;
    transition: var(--transition);
    cursor: pointer;
    height: 150px;
    perspective: 1000px;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.vocabulary-card:hover .card-inner {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.card-back {
    transform: rotateY(180deg);
}

.card-front .term {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--primary-color);
    text-align: center;
}

.card-front .hint {
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--text-color);
    opacity: 0.7;
}

.card-back .definition {
    font-size: 1.1rem;
    text-align: center;
}

.card-back .example {
    margin-top: 10px;
    font-size: 0.9rem;
    font-style: italic;
    text-align: center;
}

.exercise-box {
    background-color: var(--background-color);
    border-radius: 8px;
    padding: 20px;
    margin: 25px 0;
    border: 1px solid var(--border-color);
}

.exercise-item {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.exercise-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.answer-input {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin: 0 5px;
    width: 180px;
    background-color: var(--card-bg);
    color: var(--text-color);
}

.check-btn, .show-example {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 10px;
    transition: var(--transition);
}

.check-btn:hover, .show-example:hover {
    background-color: var(--primary-color);
}

.result {
    margin-left: 10px;
    font-weight: 500;
}

.correct {
    color: var(--success-color);
}

.incorrect {
    color: var(--error-color);
}

.example-answer, .example-dialog {
    display: none;
    background-color: var(--card-bg);
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    border-left: 3px solid var(--accent-color);
}

textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--card-bg);
    color: var(--text-color);
    resize: vertical;
    min-height: 100px;
    margin-bottom: 10px;
}

.pronunciation-exercise {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.pronunciation-item {
    background-color: var(--card-bg);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pronunciation-phrase {
    font-weight: 500;
    color: var(--primary-color);
    flex: 1;
}

.audio-btn {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.audio-btn:hover {
    background-color: var(--primary-color);
}

.record-btn {
    background-color: var(--error-color);
    margin-left: 10px;
}

.record-btn:hover {
    background-color: #dc2626;
}

.quiz-container {
    margin-top: 20px;
}

.quiz-question {
    margin-bottom: 20px;
}

.quiz-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

.quiz-option {
    padding: 10px 15px;
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.quiz-option:hover {
    background-color: rgba(67, 97, 238, 0.1);
}

.quiz-option.selected {
    background-color: var(--primary-color);
    color: white;
}

.quiz-option.correct {
    background-color: var(--success-color);
    color: white;
}

.quiz-option.incorrect {
    background-color: var(--error-color);
    color: white;
}

.memory-game {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 20px;
}

.memory-card {
    aspect-ratio: 3/4;
    perspective: 1000px;
    cursor: pointer;
}

.memory-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.5s;
}

.memory-card.flipped .memory-card-inner {
    transform: rotateY(180deg);
}

.memory-card-front, .memory-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    text-align: center;
}

.memory-card-front {
    background-color: var(--primary-color);
    color: white;
    font-size: 1.5rem;
}

.memory-card-back {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    transform: rotateY(180deg);
    font-weight: 500;
    color: var(--text-color);
}

.listening-exercise {
    margin-top: 20px;
}

.audio-player {
    margin-bottom: 15px;
    width: 100%;
}

.listening-questions {
    margin-top: 20px;
}

.speech-practice {
    margin-top: 20px;
    padding: 20px;
    background-color: var(--background-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.speech-controls {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.speech-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition);
    font-weight: 500;
}

.record-speech-btn {
    background-color: var(--error-color);
    color: white;
}

.record-speech-btn:hover {
    background-color: #dc2626;
}

.stop-speech-btn {
    background-color: var(--warning-color);
    color: white;
}

.stop-speech-btn:hover {
    background-color: #d97706;
}

.play-speech-btn {
    background-color: var(--success-color);
    color: white;
}

.play-speech-btn:hover {
    background-color: #059669;
}

.audio-visualizer {
    width: 100%;
    height: 60px;
    background-color: var(--card-bg);
    border-radius: 4px;
    margin-top: 15px;
    position: relative;
    overflow: hidden;
}

.audio-bar {
    position: absolute;
    bottom: 0;
    width: 5px;
    background-color: var(--secondary-color);
    margin: 0 2px;
    border-radius: 5px 5px 0 0;
    transition: height 0.1s ease;
}

.tip-box {
    background-color: rgba(66, 153, 225, 0.1);
    border-left: 4px solid var(--secondary-color);
    padding: 15px;
    border-radius: 0 8px 8px 0;
    margin: 20px 0;
}

.tip-box h4 {
    display: flex;
    align-items: center;
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.tip-box h4 i {
    margin-right: 10px;
}

.tip-box p {
    color: var(--text-color);
}

.examples {
    list-style: none;
    margin: 15px 0;
}

.examples li {
    margin-bottom: 10px;
    padding-left: 25px;
    position: relative;
}

.examples li:before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--secondary-color);
}

.highlight {
    color: var(--primary-color);
    font-weight: 500;
}

.final-tips {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.tip {
    background-color: var(--background-color);
    border-radius: 8px;
    padding: 20px;
    border: 1px solid var(--border-color);
    text-align: center;
    transition: var(--transition);
}

.tip:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow);
}

.tip i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.tip h3 {
    margin: 10px 0;
    color: var(--text-color);
}

.progress-tracker {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--card-bg);
    padding: 10px 20px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background-color: var(--border-color);
    border-radius: 4px;
    margin: 0 15px;
    overflow: hidden;
}

.progress-filled {
    height: 100%;
    background-color: var(--success-color);
    width: 0%;
    transition: width 0.5s ease;
}

.progress-text {
    font-weight: 500;
    color: var(--text-color);
}

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

    .sidebar {
        width: 100%;
        position: static;
        margin-bottom: 30px;
    }

    .vocabulary-cards,
    .quiz-options,
    .memory-game {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .vocabulary-cards,
    .quiz-options,
    .memory-game {
        grid-template-columns: 1fr;
    }

    .speech-controls {
        flex-direction: column;
    }
}

/* Animações */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

section {
    animation: fadeIn 0.5s ease forwards;
}

section:nth-child(2) {
    animation-delay: 0.1s;
}

section:nth-child(3) {
    animation-delay: 0.2s;
}

section:nth-child(4) {
    animation-delay: 0.3s;
}

section:nth-child(5) {
    animation-delay: 0.4s;
}

/* Estilos para listas, excluindo as da sidebar */
main ul {
    padding-left: 20px;
    margin: 15px 0;
    list-style-type: none;
}

main ul li {
    position: relative;
    padding: 8px 0 8px 28px;
    margin-bottom: 8px;
    line-height: 1.5;
}

main ul li:before {
    content: '';
    position: absolute;
    left: 0;
    top: 14px;
    width: 8px;
    height: 8px;
    background-color: var(--primary-color);
    border-radius: 50%;
}

/* Restaurar estilo original para as listas da sidebar */
.sidebar ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.sidebar li {
    margin-bottom: 10px;
    padding: 0;
}

.sidebar li:before {
    display: none; /* Remove o marcador personalizado */
}

/* Estilos específicos para listas dentro de tip-box */
.tip-box ul {
    margin: 10px 0 5px;
}

.tip-box ul li {
    padding: 5px 0 5px 25px;
    margin-bottom: 5px;
}

.tip-box ul li:before {
    background-color: var(--secondary-color);
    width: 6px;
    height: 6px;
    top: 12px;
}

/* Estilos para listas numeradas */
ol {
    padding-left: 20px;
    margin: 15px 0;
}

ol li {
    padding: 8px 0 8px 8px;
    margin-bottom: 10px;
    line-height: 1.5;
}

/* Estilos para o botão de leitura */
.read-aloud-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: 10px;
    transition: background-color 0.3s, transform 0.2s;
}

.read-aloud-btn:hover {
    background-color: var(--accent-color);
    transform: scale(1.1);
}

.read-aloud-btn:active {
    transform: scale(0.95);
}

.read-aloud-btn.reading {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

/* Destacar texto sendo lido */
.highlight-text {
    background-color: rgba(var(--primary-color-rgb), 0.2);
    transition: background-color 0.3s;
}

/* Container para título e botão */
.section-title-container {
    display: flex;
    align-items: center;
}

/* Estilo para os botões de mostrar/ocultar transcrição */
.toggle-transcript-btn {
    background-color: var(--secondary-color, #7209b7);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 0.85rem;
    cursor: pointer;
    margin: 5px 0;
    display: inline-flex;
    align-items: center;
    transition: background-color 0.3s;
}

.toggle-transcript-btn:hover {
    background-color: var(--accent-color, #3a0ca3);
}

.toggle-transcript-btn i {
    margin-right: 5px;
}

/* Estilo para a transcrição (inicialmente oculta) */
.transcript-text {
    background-color: rgba(var(--primary-color-rgb, 67, 97, 238), 0.05);
    border-left: 3px solid var(--primary-color, #4361ee);
    padding: 10px;
    margin: 10px 0;
    border-radius: 0 4px 4px 0;
    font-style: italic;
    display: none; /* Inicialmente oculto */
/* Estilo para os botões de mostrar/ocultar transcrição */
.toggle-transcript-btn {
    background-color: var(--secondary-color, #7209b7);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 0.85rem;
    cursor: pointer;
    margin: 5px 0;
    display: inline-flex;
    align-items: center;
    transition: background-color 0.3s;
}

.toggle-transcript-btn:hover {
    background-color: var(--accent-color, #3a0ca3);
}

.toggle-transcript-btn i {
    margin-right: 5px;
}

/* Estilo para a transcrição (inicialmente oculta) */
.transcript-text {
    background-color: rgba(var(--primary-color-rgb, 67, 97, 238), 0.05);
    border-left: 3px solid var(--primary-color, #4361ee);
    padding: 10px;
    margin: 10px 0;
    border-radius: 0 4px 4px 0;
    font-style: italic;
    display: none; /* Inicialmente oculto */
}