/* Reset e Variáveis */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #f5f7fa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e9ecef;
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --border-color: #e2e8f0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.15);
    --primary-color: #3b82f6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #06b6d4;
}

body.dark-mode {
    --bg-primary: #1a202c;
    --bg-secondary: #2d3748;
    --bg-tertiary: #4a5568;
    --text-primary: #f7fafc;
    --text-secondary: #e2e8f0;
    --border-color: #4a5568;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.4);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: var(--bg-secondary);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 20px 0;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo .icon {
    font-size: 2.5rem;
}

.logo-text h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.logo-text p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.btn-icon {
    background: var(--bg-tertiary);
    border: none;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.5rem;
    transition: transform 0.2s;
}

.btn-icon:hover {
    transform: scale(1.1);
}

body:not(.dark-mode) .icon-sun {
    display: none;
}

body.dark-mode .icon-moon {
    display: none;
}

/* Navegação */
.nav-tabs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.tab-btn {
    background: var(--bg-tertiary);
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    white-space: nowrap;
    transition: all 0.3s;
    color: var(--text-primary);
}

.tab-btn:hover {
    background: var(--primary-color);
    color: white;
}

.tab-btn.active {
    background: var(--primary-color);
    color: white;
}

/* Main Content */
main {
    padding: 30px 0;
    min-height: calc(100vh - 300px);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-content h2 {
    font-size: 2rem;
    margin-bottom: 30px;
    color: var(--primary-color);
}

/* Busca */
.search-box {
    margin-bottom: 20px;
}

.search-box input {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Filtros */
.filter-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.filter-btn {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-primary);
}

.filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Blocos Grid */
.blocos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.bloco-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.3s;
    border-left: 4px solid;
}

.bloco-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.bloco-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
}

.bloco-icon {
    font-size: 3rem;
}

.btn-star {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    transition: transform 0.2s;
}

.btn-star:hover {
    transform: scale(1.2);
}

.bloco-card h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.bloco-progress {
    margin-top: 15px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.progress-bar {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--info-color));
    transition: width 0.5s;
}

.bloco-stats {
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Detalhes do Bloco */
.bloco-detalhes {
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.btn-back {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 1rem;
    cursor: pointer;
    margin-bottom: 20px;
    padding: 10px 0;
    transition: transform 0.2s;
}

.btn-back:hover {
    transform: translateX(-5px);
}

.bloco-info-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.bloco-titulo {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.bloco-titulo .bloco-icon {
    font-size: 4rem;
}

.bloco-titulo h2 {
    font-size: 2rem;
    margin: 0;
}

.dicas-box {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.dicas-box h4 {
    margin-bottom: 15px;
    color: var(--primary-color);
}

.dicas-box ul {
    list-style: none;
}

.dicas-box li {
    padding: 5px 0;
    padding-left: 20px;
    position: relative;
}

.dicas-box li::before {
    content: '💡';
    position: absolute;
    left: 0;
}

/* Tópicos */
.topicos-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.topico-item {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: start;
}

.topico-content {
    flex: 1;
}

.topico-item h4 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--primary-color);
}

.topico-item .subtitulo {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.topico-item .conteudo {
    font-size: 0.95rem;
    white-space: pre-wrap;
    line-height: 1.6;
}

.topico-actions {
    display: flex;
    gap: 10px;
    margin-left: 15px;
}

.btn-action {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    transition: transform 0.2s;
}

.btn-action:hover {
    transform: scale(1.2);
}

/* Favoritos */
.favoritos-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.favorito-empty {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 60px 20px;
    text-align: center;
}

.favorito-empty .icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.favorito-item {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.favorito-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.favorito-info .icon {
    font-size: 2.5rem;
}

.favorito-info h4 {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.favorito-info p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Progresso */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    font-size: 3rem;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.progress-details {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow);
}

.progress-details h3 {
    margin-bottom: 30px;
    color: var(--primary-color);
}

.category-progress {
    margin-bottom: 30px;
}

.category-progress h4 {
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
}

/* Quiz */
.quiz-start {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 60px 20px;
    text-align: center;
    box-shadow: var(--shadow);
}

.quiz-start p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    color: var(--text-secondary);
}

.quiz-container {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow);
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    font-weight: bold;
}

.quiz-pergunta {
    font-size: 1.3rem;
    margin-bottom: 30px;
    line-height: 1.6;
}

.quiz-opcoes {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.opcao-btn {
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    padding: 20px;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: all 0.3s;
    font-size: 1rem;
    color: var(--text-primary);
}

.opcao-btn:hover {
    border-color: var(--primary-color);
    transform: translateX(5px);
}

.opcao-btn.correta {
    background: var(--success-color);
    color: white;
    border-color: var(--success-color);
}

.opcao-btn.errada {
    background: var(--danger-color);
    color: white;
    border-color: var(--danger-color);
}

.opcao-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.quiz-explicacao {
    background: var(--bg-tertiary);
    border-left: 4px solid var(--primary-color);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.quiz-explicacao h4 {
    margin-bottom: 10px;
    color: var(--primary-color);
}

.quiz-actions {
    display: flex;
    justify-content: center;
}

.quiz-resultado {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    box-shadow: var(--shadow);
}

.quiz-resultado h3 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.resultado-pontos {
    font-size: 3rem;
    font-weight: bold;
    margin: 30px 0;
}

.resultado-mensagem {
    font-size: 1.2rem;
    margin-bottom: 30px;
    color: var(--text-secondary);
}

/* Pomodoro */
.pomodoro-container {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 40px;
    box-shadow: var(--shadow);
    text-align: center;
}

.pomodoro-timer {
    margin-bottom: 40px;
}

.timer-display {
    font-size: 5rem;
    font-weight: bold;
    color: var(--primary-color);
    font-family: 'Courier New', monospace;
}

.pomodoro-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
}

.pomodoro-info {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 30px;
    text-align: left;
}

.pomodoro-info h3 {
    margin-bottom: 20px;
    color: var(--primary-color);
}

.pomodoro-info ol {
    padding-left: 20px;
}

.pomodoro-info li {
    margin-bottom: 10px;
    line-height: 1.6;
}

/* Botões */
.btn-primary,
.btn-secondary {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--border-color);
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    padding: 30px 0;
    text-align: center;
    margin-top: 60px;
    box-shadow: var(--shadow);
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
    .header-top {
        flex-direction: column;
        gap: 15px;
    }

    .logo {
        flex-direction: column;
        text-align: center;
    }

    .nav-tabs {
        justify-content: start;
    }

    .blocos-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .timer-display {
        font-size: 3rem;
    }

    .tab-content h2 {
        font-size: 1.5rem;
    }
}

/* Animações */
@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.btn-primary:active {
    animation: pulse 0.3s;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2563eb;
}