/* --- VISUAL C87 (PAINEL TRIPLO + TUDO ANTERIOR) --- */
:root { 
    --primary: #2c3e50; 
    --secondary: #34495e; 
    --accent: #27ae60; 
    --exam: #8e44ad; 
    --spiral: #16a085;
    --error: #e74c3c; 
    --bg: #f4f6f8; 
    --card: #ffffff; 
    --text: #333333;
    --text-light: #666666;
    --border: #dddddd;
    --input-bg: #ffffff;
}

body.dark-mode {
    --primary: #ecf0f1; 
    --secondary: #bdc3c7; 
    --accent: #2ecc71; 
    --exam: #9b59b6;
    --spiral: #1abc9c;
    --bg: #121212; 
    --card: #1e1e1e; 
    --text: #e0e0e0;
    --text-light: #aaaaaa;
    --border: #333333;
    --input-bg: #2c2c2c;
}

body { font-family: 'Segoe UI', sans-serif; background-color: var(--bg); margin: 0; color: var(--text); overflow-x: hidden; transition: background 0.3s, color 0.3s; }

/* Modal Editor de Material - layout com barra fixa */
.study-material-editor-modal-layout {
    max-width: 800px !important;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.editor-modal-header {
    flex-shrink: 0;
    padding-bottom: 0;
}
.editor-modal-body {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.editor-modal-body #editor-material-content {
    flex: 1;
    min-height: 200px;
    overflow-y: auto;
    width: 100%;
    font-family: 'Segoe UI', sans-serif;
    font-size: 1rem;
    line-height: 1.8;
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 0 0 8px 8px;
    background: var(--card);
    color: var(--text);
    outline: none;
}
.editor-modal-footer {
    flex-shrink: 0;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}
/* Barra de formatação fixa - sempre visível acima da área de texto */
.editor-toolbar-sticky {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    align-items: center;
    padding: 10px;
    background: var(--border);
    border-radius: 8px 8px 0 0;
    border: 1px solid var(--border);
    border-bottom: none;
    margin-bottom: 0;
    position: sticky;
    top: 0;
    z-index: 10;
}
.format-divider {
    width: 1px;
    height: 20px;
    background: var(--text-light);
    margin: 0 3px;
}
.format-select {
    padding: 5px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--card);
    color: var(--text);
    font-size: 0.85rem;
    cursor: pointer;
}
.format-select:hover {
    border-color: var(--accent);
}

/* Botões de Formatação do Editor */
.format-btn {
    background: var(--card);
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text);
    transition: all 0.2s;
    font-weight: 600;
}
.format-btn:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    transform: translateY(-1px);
}
.format-btn:active {
    transform: translateY(0);
}

/* Estilos para conteúdo HTML renderizado do material teórico */
#study-material-view-body h3 {
    color: var(--accent);
    font-size: 1.4rem;
    margin: 20px 0 10px 0;
    border-bottom: 2px solid var(--border);
    padding-bottom: 8px;
}
#study-material-view-body strong {
    font-weight: 700;
    color: var(--text);
}
#study-material-view-body em {
    font-style: italic;
}
#study-material-view-body u {
    text-decoration: underline;
}
#study-material-view-body ul, #study-material-view-body ol {
    margin: 15px 0;
    padding-left: 30px;
}
#study-material-view-body li {
    margin: 8px 0;
    line-height: 1.6;
}
#study-material-view-body br {
    line-height: 1.8;
}
#study-material-view-body div[style*="text-align"] {
    margin: 10px 0;
    padding: 5px 0;
}
#study-material-view-body div[style*="text-align: left"] {
    text-align: left;
}
#study-material-view-body div[style*="text-align: center"] {
    text-align: center;
}
#study-material-view-body div[style*="text-align: right"] {
    text-align: right;
}
#study-material-view-body div[style*="text-align: justify"] {
    text-align: justify;
}
#study-material-view-body p {
    margin: 12px 0;
    line-height: 1.8;
}
#study-material-view-body p:first-child {
    margin-top: 0;
}
#study-material-view-body p:last-child {
    margin-bottom: 0;
}

/* Estilos para o editor visual (contenteditable) */
#editor-material-content:empty:before {
    content: attr(data-placeholder);
    color: var(--text-light);
    pointer-events: none;
}
#editor-material-content:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(39, 174, 96, 0.1);
}
#editor-material-content p {
    margin: 8px 0;
    min-height: 1.5em;
}
#editor-material-content p:first-child {
    margin-top: 0;
}
#editor-material-content p:last-child {
    margin-bottom: 0;
}
#editor-material-content h3 {
    color: var(--accent);
    font-size: 1.3rem;
    margin: 15px 0 8px 0;
    font-weight: 700;
}
#editor-material-content ul, #editor-material-content ol {
    margin: 10px 0;
    padding-left: 30px;
}
#editor-material-content li {
    margin: 5px 0;
}
#editor-material-content div[style*="text-align"] {
    margin: 8px 0;
    padding: 5px 0;
}
.container { max-width: 1100px; margin: 0 auto; padding: 20px; min-height: 100vh; display: flex; flex-direction: column; }
button { cursor: pointer; font-family: inherit; transition: all 0.2s; }
button:active { transform: scale(0.98); }

/* LOGIN */
#login-screen { 
    max-width: 450px; margin: 5vh auto; padding: 50px 35px; 
    background: linear-gradient(135deg, var(--card) 0%, rgba(39, 174, 96, 0.05) 100%);
    border-radius: 20px; 
    box-shadow: 0 15px 35px rgba(0,0,0,0.12), 0 5px 15px rgba(39, 174, 96, 0.1); 
    text-align: center; animation: fadeIn 0.5s ease;
    border: 3px solid var(--accent);
    min-height: 500px; display: flex; flex-direction: column; justify-content: flex-start;
    position: relative;
    overflow: hidden;
}
#login-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #27ae60, #2ecc71, #16a085, #27ae60);
    background-size: 200% 100%;
    animation: gradientShift 3s ease infinite;
}
@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}
.login-header {
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
}
.login-main-logo { 
    max-width: 280px; 
    width: 100%; 
    height: auto; 
    margin-bottom: 20px; 
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15));
    animation: logoFloat 3s ease-in-out infinite;
}
@keyframes logoFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}
.platform-slogan { 
    font-family: 'Fredoka', sans-serif; 
    font-size: 1.4rem; 
    color: var(--accent); 
    margin-bottom: 25px; 
    line-height: 1.3; 
    letter-spacing: 0.5px; 
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
body.dark-mode .platform-slogan {
    color: #2ecc71;
}
.platform-logo { max-width: 320px; width: 100%; height: auto; margin-bottom: 15px; }

.auth-tabs { 
    display: flex; 
    justify-content: center; 
    margin-bottom: 25px; 
    border-bottom: 2px solid var(--border); 
    gap: 5px;
    position: relative;
    z-index: 1;
}
.auth-tab { 
    padding: 12px 30px; 
    cursor: pointer; 
    font-weight: 600; 
    color: var(--text-light); 
    border-bottom: 3px solid transparent; 
    font-size: 1rem; 
    transition: all 0.3s ease;
    position: relative;
}
.auth-tab:hover { 
    color: var(--accent); 
    background: rgba(39, 174, 96, 0.05);
    border-radius: 8px 8px 0 0;
}
.auth-tab.active { 
    color: var(--accent); 
    border-bottom-color: var(--accent); 
    background: rgba(39, 174, 96, 0.08); 
    border-radius: 8px 8px 0 0;
    font-weight: 700;
}

.login-box { 
    text-align: left; 
    transition: opacity 0.3s ease; 
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.5);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 10px;
}
body.dark-mode .login-box {
    background: rgba(30, 30, 30, 0.5);
}
.input-group { position: relative; margin-bottom: 18px; }
.login-label { 
    font-size: 0.9rem; 
    font-weight: 600; 
    color: var(--text); 
    display: block; 
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}
.login-input { 
    width: 100%; 
    padding: 14px 16px; 
    border: 2px solid var(--border); 
    background: var(--input-bg); 
    color: var(--text); 
    border-radius: 10px; 
    font-size: 1rem; 
    box-sizing: border-box; 
    transition: all 0.3s ease;
    font-family: 'Segoe UI', sans-serif;
}
.login-input:focus { 
    border-color: var(--accent); 
    outline: none; 
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.1);
    transform: translateY(-1px);
}
.login-input::placeholder {
    color: var(--text-light);
    opacity: 0.6;
}
.eye-icon { 
    position: absolute; 
    right: 16px; 
    top: 42px; 
    cursor: pointer; 
    opacity: 0.5; 
    font-size: 1.2rem; 
    color: var(--text);
    transition: opacity 0.2s;
}
.eye-icon:hover {
    opacity: 0.8;
}
.login-btn { 
    width: 100%; 
    padding: 16px; 
    background: linear-gradient(135deg, var(--accent) 0%, #2ecc71 100%);
    color: white; 
    border: none; 
    border-radius: 10px; 
    font-weight: bold; 
    font-size: 1.1rem; 
    margin-top: 15px; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
    position: relative;
    overflow: hidden;
}
.login-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}
.login-btn:hover::before {
    left: 100%;
}
.login-btn:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
}
.login-btn:active {
    transform: translateY(0px);
}
.pending-msg { background: #fff3cd; color: #856404; padding: 15px; border-radius: 8px; margin-top: 20px; text-align: center; display: none; }
.auth-links { 
    margin-top: 25px; 
    display: flex; 
    flex-direction: column; 
    gap: 10px; 
    align-items: center; 
    border-top: 2px solid var(--border); 
    padding-top: 20px;
    position: relative;
    z-index: 1;
}
.auth-links a { font-family: 'Segoe UI', sans-serif; font-size: 0.9rem; color: var(--text-light); text-decoration: none; font-weight: 500; cursor: pointer; }
.auth-links a:hover { color: var(--accent); text-decoration: underline; }
.auth-links .btn-action { 
    border: none; 
    border-radius: 8px; 
    font-weight: 600; 
    cursor: pointer; 
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    font-family: 'Segoe UI', sans-serif;
}
.auth-links .btn-action:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 6px 15px rgba(0,0,0,0.15);
}
@media(max-width: 480px) {
    .auth-links .btn-action { 
        font-size: 0.85rem; 
        padding: 8px 12px; 
    }
    #login-screen { 
        padding: 35px 20px; 
        max-width: 95%;
        min-height: auto;
    }
    .login-main-logo {
        max-width: 220px;
        margin-bottom: 15px;
    }
    .platform-slogan {
        font-size: 1.2rem;
    }
    .login-box {
        padding: 15px;
    }
}
.dev-credit { 
    margin-top: 30px; 
    font-size: 0.85rem; 
    color: var(--accent); 
    font-family: 'Segoe UI', sans-serif; 
    font-weight: 700; 
    border-top: 2px solid var(--border); 
    padding-top: 15px; 
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.05) 0%, rgba(46, 204, 113, 0.05) 100%);
    padding: 12px; 
    border-radius: 10px;
    position: relative;
    z-index: 1;
}
body.dark-mode .dev-credit {
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.1) 0%, rgba(46, 204, 113, 0.1) 100%);
}

/* DASHBOARD */
.screen-panel { display: none; }

/* Cabeçalho: uma linha no desktop; no celular ajusta (ícones na frente ou embaixo do nome) */
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    gap: 10px;
    margin-bottom: 20px;
}
.header-left {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    min-width: 0;
}
.header-right {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
}
/* Ícones do cabeçalho — padrão (computador): tamanho de antes */
.btn-icon-header {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    min-width: 35px;
    min-height: 35px;
    padding: 0;
    border-radius: 50%;
    font-size: 1.2rem;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.btn-icon-header:hover {
    border-color: var(--accent);
    background: rgba(39, 174, 96, 0.08);
}
.btn-theme { color: var(--text); }
/* Cadeado só aparece para admin (JS define .style.display = 'block') */
.btn-admin {
    display: none;
    color: var(--text-light);
}
.btn-admin:hover { border-color: var(--accent); color: var(--accent); background: rgba(0,0,0,0.05); }
.btn-focus { color: var(--text-light); }
.header-right .btn-icon-header.btn-action {
    border: none;
    color: #fff;
    width: 35px;
    height: 35px;
    min-width: 35px;
    min-height: 35px;
    font-size: 1.1rem;
    padding: 0;
}
.header-right .btn-playlists { background: #9b59b6; }
.header-right .btn-favorites { background: #f39c12; }
.header-right .btn-challenges { background: #e67e22; }
.header-right .btn-messages { background: #16a085; }
.header-right .btn-icon-header.btn-action:hover { filter: brightness(1.1); }
.btn-logout {
    flex-shrink: 0;
    background: none;
    border: 1px solid #e74c3c;
    color: #e74c3c;
    padding: 8px 20px;
    height: 35px;
    line-height: 1;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.9rem;
}
.btn-logout:hover { background: #e74c3c; color: white; }
.welcome-text {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.8rem;
    color: var(--primary);
    margin: 0;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
body.dark-mode .welcome-text { color: var(--accent); }

.stats-container { display: flex; gap: 15px; margin-bottom: 10px; }
.stat-card { flex: 1; background: var(--card); padding: 20px; border-radius: 12px; box-shadow: 0 4px 10px rgba(0,0,0,0.05); text-align: center; border-bottom: 4px solid var(--border); }
.stat-val { font-size: 2rem; font-weight: bold; color: var(--text); display: block; }
.stat-label { color: var(--text-light); font-size: 0.9rem; }
.reset-stats-container { text-align: right; margin-bottom: 30px; }
.btn-reset { background: none; border: none; color: var(--text-light); font-size: 0.85rem; cursor: pointer; text-decoration: underline; }
.btn-reset:hover { color: #e74c3c; }

/* C87: PAINEL DE ESTUDO TRIPLO */
.study-plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-bottom: 30px; animation: fadeIn 1s; }
@media(max-width: 768px) { .study-plan-grid { grid-template-columns: 1fr; } }

.plan-col { background: var(--card); padding: 20px; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); border-top: 5px solid; display: flex; flex-direction: column; }
.col-crit { border-top-color: #e74c3c; }
.col-attn { border-top-color: #f1c40f; }
.col-good { border-top-color: #27ae60; }

.plan-head { font-size: 0.9rem; font-weight: bold; text-transform: uppercase; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.head-crit { color: #e74c3c; }
.head-attn { color: #f1c40f; }
.head-good { color: #27ae60; }

.plan-list { list-style: none; padding: 0; margin: 0; }
.plan-item { font-size: 0.85rem; padding: 8px 0; border-bottom: 1px solid var(--border); color: var(--text); display:flex; align-items:flex-start; gap:5px; }
.plan-item:last-child { border-bottom: none; }
.plan-dot { font-size: 0.6rem; margin-top:3px; }

/* ÍCONES GRANDES */
.modes-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); 
    gap: 12px; 
    margin-bottom: 30px; 
}
@media(max-width: 480px) { 
    .modes-grid { 
        grid-template-columns: repeat(2, 1fr); 
        gap: 10px; 
    } 
    .mode-btn { padding: 12px 8px; }
    .m-icon { font-size: 2.2rem !important; }
    .mode-btn { font-size: 0.85rem; }
}
.mode-btn { 
    background: var(--card); 
    border: 2px solid var(--border); 
    padding: 15px; 
    border-radius: 16px; 
    text-align: center; 
    box-shadow: 0 6px 15px rgba(0,0,0,0.06); 
    color: var(--text); 
    font-weight: 700; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 5px; 
    cursor:pointer; 
    transition: transform 0.2s, background 0.3s, border-color 0.3s;
    font-size: 0.9rem;
}
.mode-btn:hover { background: var(--accent); color: white; transform: translateY(-5px); border-color: var(--accent); }
.mode-btn.exam-mode:hover { background: var(--exam); border-color: var(--exam); } 
.mode-btn.spiral-mode:hover { background: var(--spiral); border-color: var(--spiral); }
.m-icon { font-size: 2.8rem; line-height: 1; margin-bottom: 5px; } 

.subject-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-top: 20px; }
.subject-card { background: var(--card); padding: 25px; border-radius: 15px; box-shadow: 0 4px 10px rgba(0,0,0,0.05); display: flex; align-items: center; gap: 20px; border-left: 6px solid var(--border); cursor: pointer; transition: transform 0.2s; }
.subject-card:hover { transform: translateY(-5px); border-left-color: var(--accent); }
.subject-card h3 { color: var(--text); margin: 0 0 5px 0; }
.subject-card p { color: var(--text-light); margin: 0; }
.subj-icon { font-size: 2.5rem; }

/* GRÁFICO E FILTROS */
.analysis-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; margin-bottom: 30px; margin-top: 30px; }
@media(max-width: 768px) { .analysis-grid { grid-template-columns: 1fr; } }
.chart-box { background: var(--card); padding: 20px; border-radius: 15px; box-shadow: 0 4px 10px rgba(0,0,0,0.05); height: 320px; position: relative; display: flex; flex-direction: column; }
.chart-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.chart-header h4 { color: var(--text); }
.chart-filter { padding: 5px; border-radius: 5px; border: 1px solid var(--border); font-size: 0.9rem; background: var(--input-bg); color: var(--text); }
.chart-canvas-container { flex: 1; position: relative; min-height: 0; }
.trophy-box { background: var(--card); padding: 20px; border-radius: 15px; box-shadow: 0 4px 10px rgba(0,0,0,0.05); text-align: center; height: 320px; box-sizing: border-box; overflow-y: auto; }
.trophy-box h4 { color: var(--text); }
.trophy-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-top: 15px; }
.trophy { opacity: 0.2; font-size: 2rem; filter: grayscale(100%); transition: all 0.3s; margin-bottom: 5px; }
.trophy.unlocked { opacity: 1; filter: grayscale(0%); transform: scale(1.1); }
.trophy-desc { font-size: 0.65rem; color: var(--text-light); display: block; font-weight: bold; }

/* RANKING CORES */
.bronze { color: #cd7f32; } .silver { color: #c0c0c0; } .gold { color: #ffd700; }
.emerald { color: #2ecc71; text-shadow: 0 0 3px #27ae60; } .sapphire { color: #3498db; text-shadow: 0 0 3px #2980b9; }
.ruby { color: #e74c3c; text-shadow: 0 0 3px #c0392b; } .amethyst { color: #9b59b6; text-shadow: 0 0 3px #8e44ad; }
.diamond { color: #b9f2ff; text-shadow: 0 0 5px #00bfff; } .mythic { color: #e056fd; text-shadow: 0 0 5px #be2edd; }
.titan { background: -webkit-linear-gradient(#f1c40f, #e67e22); -webkit-background-clip: text; -webkit-text-fill-color: transparent; font-weight:bold; }
.god { background: -webkit-linear-gradient(#00c6ff, #0072ff); -webkit-background-clip: text; -webkit-text-fill-color: transparent; font-weight:bold; text-shadow: 0 0 10px rgba(0,114,255,0.5); }

.export-area { text-align: center; margin-top: 30px; margin-bottom: 40px; }
.btn-pdf { background: linear-gradient(135deg, #e74c3c, #c0392b); color: white; border: none; padding: 15px 35px; border-radius: 30px; font-weight: bold; cursor: pointer; font-size: 1rem; box-shadow: 0 10px 20px rgba(231, 76, 60, 0.3); display: inline-flex; align-items: center; gap: 10px; transition: all 0.3s; }
.btn-pdf:hover { transform: translateY(-3px); box-shadow: 0 15px 25px rgba(231, 76, 60, 0.4); }

/* MODAL */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 2000; display: none; align-items: center; justify-content: center; animation: fadeIn 0.2s; }
.modal-content { background: var(--card); padding: 30px; border-radius: 15px; width: 90%; max-width: 400px; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,0.2); }
.modal-content h3 { color: var(--text); }
.range-wrap { margin: 20px 0; }
.range-wrap label { color: var(--text); }
.range-val { font-size: 1.5rem; font-weight: bold; color: var(--accent); display: block; margin-bottom: 10px; }
input[type=range] { width: 100%; }
.modal-actions { display: flex; gap: 10px; justify-content: center; margin-top: 20px; }
.btn-modal-cancel { background: var(--border); color: var(--text-light); padding: 10px 20px; border: none; border-radius: 8px; font-weight: bold; cursor:pointer; }
.btn-modal-start { background: var(--accent); color: white; padding: 10px 25px; border: none; border-radius: 8px; font-weight: bold; cursor:pointer; }

/* ADMIN & EXTRAS */
.config-card { background: var(--card); border-radius: 12px; box-shadow: 0 4px 10px rgba(0,0,0,0.08); overflow: hidden; display: flex; flex-direction: column; height: 100%; min-height: 320px; }
.config-header { padding: 15px 20px; font-weight: bold; color: white; display: flex; align-items: center; justify-content: space-between; }
.config-body { padding: 20px; flex: 1; display:flex; flex-direction:column; }
.settings-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
@media(max-width: 768px) { .settings-grid { grid-template-columns: 1fr; } }
.list-container { list-style: none; padding: 0; margin: 0; max-height: 200px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; flex:1; }
.list-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 10px; border-bottom: 1px solid var(--border); background: var(--card); color: var(--text); }
.user-section-title { font-size: 0.9rem; font-weight: bold; color: var(--text-light); margin-top: 10px; margin-bottom: 5px; }
.btn-action { width: 100%; padding: 12px; border: none; border-radius: 6px; font-weight: bold; color: white; cursor: pointer; margin-top:5px; }
.btn-exit-simulado { transition: transform 0.2s, box-shadow 0.2s; }
.btn-exit-simulado:hover { transform: scale(1.05); box-shadow: 0 6px 16px rgba(39,174,96,0.5) !important; filter: brightness(1.1); }
.btn-icon-small { background: none; border: none; font-size: 1.1rem; padding: 5px; cursor:pointer; opacity: 0.8; }
.header-topics { background: #e67e22; } .header-import { background: #2980b9; } .header-ranking { background: #f39c12; } .header-materials { background: #2980b9; } .header-data { background: #8e44ad; } .header-history { background: #c0392b; } .header-cloud { background: #16a085; } .header-users { background: #34495e; } .header-manual { background: #d35400; } .header-manage { background: #c0392b; } .header-test { background: #16a085; }
.tab-btn { background: var(--bg); border: none; padding: 8px 15px; border-radius: 20px; font-size: 0.85rem; margin-right: 5px; color: var(--text-light); }
.tab-btn.active { background: #e67e22; color: white; font-weight: bold; }
.back-nav { margin-bottom: 20px; } .btn-back { background: var(--border); border: none; padding: 8px 16px; border-radius: 20px; font-weight: bold; color: var(--text-light); }
.file-drop { border: 2px dashed var(--border); padding: 20px; text-align: center; border-radius: 8px; margin-bottom: 10px; color: var(--text-light); font-size: 0.9rem; }

/* MANUAL INPUTS */
.manual-group { margin-bottom: 10px; text-align: left; }
.manual-group label { display:block; font-size:0.85rem; font-weight:bold; color:var(--text); margin-bottom:3px; }
.manual-input { width:100%; padding:10px; border:1px solid var(--border); background: var(--input-bg); color: var(--text); border-radius:6px; box-sizing:border-box; font-size:0.95rem; }
.manual-input:focus { border-color: var(--accent); outline:none; }
textarea.manual-input { resize: vertical; min-height: 60px; }

/* QUIZ */
.quiz-container { background: var(--card); padding: 40px; border-radius: 20px; max-width: 800px; margin: 0 auto; box-shadow: 0 10px 30px rgba(0,0,0,0.1); }
.question-text { 
    font-size: 1.1rem; line-height: 1.6; color: var(--text); margin-bottom: 20px; 
    text-align: justify; /* C87: JUSTIFICADO */
}
.support-text-box { 
    background: rgba(0,0,0,0.03); border-left: 4px solid var(--accent); padding: 15px; margin-bottom: 15px; border-radius: 6px; 
    font-style: italic; color: var(--text-light); font-size: 0.95rem; line-height: 1.5; 
    text-align: justify; /* C87: JUSTIFICADO */
}
.option-btn { width: 100%; text-align: left; padding: 15px 20px; margin-bottom: 10px; border: 2px solid var(--border); border-radius: 10px; background: var(--card); color: var(--text); font-size: 1rem; transition: all 0.3s; position: relative; }
.option-btn:hover:not(.locked) { border-color: var(--accent); background: rgba(39, 174, 96, 0.1); transform: translateX(5px); }
.option-btn.locked { cursor: not-allowed; opacity: 0.7; }
.correct-anim { background: #d4edda !important; border-color: #28a745 !important; color: #155724 !important; animation: correctPulse 0.5s ease; }
.wrong-anim { background: #f8d7da !important; border-color: #dc3545 !important; color: #721c24 !important; animation: wrongShake 0.5s ease; }
.selected-anim { background: rgba(52, 152, 219, 0.2) !important; border-color: #3498db !important; }
@keyframes correctPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}
@keyframes wrongShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}
.selected-anim { background: #3498db !important; border-color: #2980b9 !important; color: white !important; }
.options-grid-tf { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.comment-box { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; padding: 15px; border-radius: 8px; margin-top: 20px; text-align: left; display: none; animation: fadeIn 0.5s; }
.btn-next-q { display:none; width: 100%; padding: 15px; background: var(--accent); color: white; border: none; border-radius: 8px; font-weight: bold; font-size: 1.1rem; margin-top: 20px; cursor: pointer; animation: fadeIn 0.5s; }
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }

/* GABARITO FINAL (C83) */
.result-review-item { text-align:left; border-bottom:1px solid var(--border); padding:15px; margin-bottom:10px; }
.res-q-text { font-weight:bold; margin-bottom:10px; font-size:0.95rem; }
.res-tag { display:inline-block; padding:3px 8px; border-radius:4px; font-size:0.75rem; margin-right:5px; color:white; }
.tag-correct { background:#27ae60; } .tag-wrong { background:#e74c3c; }

/* TOASTS */
.toast-container { position:fixed; top:20px; right:20px; z-index:9999; display:flex; flex-direction:column; gap:10px; pointer-events:none; }
.toast { padding:14px 22px; border-radius:10px; color:white; font-weight:600; font-size:0.95rem; box-shadow:0 4px 15px rgba(0,0,0,0.2); animation:toastIn 0.3s ease; max-width:320px; }
.toast.success { background:linear-gradient(135deg,#27ae60,#2ecc71); }
.toast.error { background:linear-gradient(135deg,#e74c3c,#c0392b); }
.toast.warning { background:linear-gradient(135deg,#f39c12,#e67e22); }
.toast.info { background:linear-gradient(135deg,#3498db,#2980b9); }
@keyframes toastIn { from{opacity:0;transform:translateX(50px);} to{opacity:1;transform:translateX(0);} }

/* LOADER */
.loader-overlay { position:fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.6); z-index:9000; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:15px; }
.loader-spinner { width:50px; height:50px; border:4px solid rgba(255,255,255,0.3); border-top-color:#27ae60; border-radius:50%; animation:spin 0.8s linear infinite; }
.loader-text { color:white; font-weight:bold; font-size:1rem; }
@keyframes spin { to{transform:rotate(360deg);} }

/* HISTÓRICO DE SIMULADOS */
.simulado-history-box { 
    background:var(--card); 
    padding:20px; 
    border-radius:16px; 
    box-shadow:0 4px 15px rgba(0,0,0,0.08); 
    margin-bottom:25px; 
}
.simulado-history-list { 
    list-style:none; 
    padding:0; 
    margin:0; 
    display:grid; 
    grid-template-columns:repeat(auto-fill, minmax(280px, 1fr)); 
    gap:15px; 
    max-height:600px; 
    overflow-y:auto; 
}
.simulado-history-card { 
    background:var(--card); 
    border-radius:12px; 
    padding:18px; 
    box-shadow:0 3px 10px rgba(0,0,0,0.1); 
    transition:all 0.3s ease;
    border-left:4px solid;
    position:relative;
    overflow:hidden;
}
.simulado-history-card::before {
    content:'';
    position:absolute;
    top:0;
    left:0;
    right:0;
    height:3px;
    background:linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    opacity:0;
    transition:opacity 0.3s;
}
.simulado-history-card:hover {
    transform:translateY(-3px);
    box-shadow:0 6px 20px rgba(0,0,0,0.15);
}
.simulado-history-card:hover::before {
    opacity:1;
}
.simulado-history-card.excellent { 
    border-left-color:#27ae60;
    background:linear-gradient(135deg, var(--card) 0%, rgba(39, 174, 96, 0.05) 100%);
}
.simulado-history-card.good { 
    border-left-color:#3498db;
    background:linear-gradient(135deg, var(--card) 0%, rgba(52, 152, 219, 0.05) 100%);
}
.simulado-history-card.average { 
    border-left-color:#f39c12;
    background:linear-gradient(135deg, var(--card) 0%, rgba(243, 156, 18, 0.05) 100%);
}
.simulado-history-card.poor { 
    border-left-color:#e74c3c;
    background:linear-gradient(135deg, var(--card) 0%, rgba(231, 76, 60, 0.05) 100%);
}
.simulado-card-header {
    display:flex;
    align-items:center;
    gap:12px;
    margin-bottom:15px;
}
.simulado-mode-icon {
    font-size:2rem;
    width:50px;
    height:50px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:rgba(0,0,0,0.05);
    border-radius:10px;
    flex-shrink:0;
}
.simulado-card-info {
    flex:1;
    min-width:0;
}
.simulado-mode-name {
    font-weight:700;
    font-size:1rem;
    color:var(--text);
    margin-bottom:4px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}
.simulado-date {
    font-size:0.85rem;
    color:var(--text-light);
}
.simulado-card-stats {
    display:flex;
    flex-direction:column;
    gap:12px;
}
.simulado-score {
    text-align:center;
    padding:12px;
    background:rgba(0,0,0,0.03);
    border-radius:8px;
}
.score-value {
    display:block;
    font-size:2rem;
    font-weight:bold;
    line-height:1;
    margin-bottom:4px;
}
.simulado-history-card.excellent .score-value { color:#27ae60; }
.simulado-history-card.good .score-value { color:#3498db; }
.simulado-history-card.average .score-value { color:#f39c12; }
.simulado-history-card.poor .score-value { color:#e74c3c; }
.score-label {
    font-size:0.75rem;
    color:var(--text-light);
    text-transform:uppercase;
    letter-spacing:0.5px;
}
.simulado-details {
    display:flex;
    justify-content:space-around;
    gap:8px;
}
.detail-item {
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:4px;
    flex:1;
}
.detail-icon {
    font-size:1.2rem;
}
.detail-value {
    font-weight:700;
    font-size:1.1rem;
    color:var(--text);
}
.detail-label {
    font-size:0.7rem;
    color:var(--text-light);
    text-transform:uppercase;
}
.simulado-progress-bar {
    margin-top:12px;
    height:6px;
    background:rgba(0,0,0,0.1);
    border-radius:3px;
    overflow:hidden;
}
.simulado-progress-fill {
    height:100%;
    border-radius:3px;
    transition:width 0.5s ease;
}
.simulado-history-card.excellent .simulado-progress-fill { background:linear-gradient(90deg, #27ae60, #2ecc71); }
.simulado-history-card.good .simulado-progress-fill { background:linear-gradient(90deg, #3498db, #5dade2); }
.simulado-history-card.average .simulado-progress-fill { background:linear-gradient(90deg, #f39c12, #f4d03f); }
.simulado-history-card.poor .simulado-progress-fill { background:linear-gradient(90deg, #e74c3c, #ec7063); }
.simulado-history-empty { 
    grid-column:1/-1;
    color:var(--text-light); 
    padding:40px 20px; 
    text-align:center; 
    background:rgba(0,0,0,0.02);
    border-radius:12px;
    border:2px dashed var(--border);
}
.empty-icon {
    font-size:4rem;
    margin-bottom:15px;
    opacity:0.5;
}
.simulado-history-empty p {
    margin:8px 0;
    font-size:1rem;
}
.empty-subtitle {
    font-size:0.85rem !important;
    color:var(--text-light) !important;
    opacity:0.7;
}
@media(max-width: 768px) {
    .simulado-history-list {
        grid-template-columns:1fr;
    }
}

/* RANKING */
.ranking-box { background:var(--card); padding:15px; border-radius:12px; box-shadow:0 4px 10px rgba(0,0,0,0.05); margin-bottom:25px; }
.ranking-list { list-style:none; padding:0; margin:0; }
.ranking-list li { display:flex; align-items:center; gap:12px; padding:10px 12px; border-bottom:1px solid var(--border); font-size:0.95rem; color:var(--text); }
.ranking-list li:last-child { border-bottom:none; }
.ranking-list .rank-pos { font-weight:bold; min-width:28px; height:28px; display:flex; align-items:center; justify-content:center; border-radius:50%; background:var(--bg); color:var(--text); font-size:0.85rem; }
.ranking-list li:nth-child(1) .rank-pos { background:linear-gradient(135deg,#ffd700,#ffb347); color:#333; }
.ranking-list li:nth-child(2) .rank-pos { background:linear-gradient(135deg,#c0c0c0,#a8a8a8); color:#333; }
.ranking-list li:nth-child(3) .rank-pos { background:linear-gradient(135deg,#cd7f32,#b87333); color:#fff; }
.ranking-list .rank-name { flex:1; }
.ranking-list .rank-score { font-weight:bold; color:var(--accent); }

/* TRANSIÇÕES DE TELA */
.screen-panel { animation:screenFadeIn 0.4s ease; }
@keyframes screenFadeIn { from{opacity:0;} to{opacity:1;} }
.mode-btn.study-mode-btn:hover { background:#3498db; }

/* MATERIAL DE ESTUDO */
.materials-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(200px, 1fr)); gap:15px; }
.material-card { background:var(--card); border:2px solid var(--border); border-radius:12px; padding:20px; cursor:pointer; transition:all 0.2s; display:flex; flex-direction:column; align-items:center; gap:10px; }
.material-card:hover { border-color:var(--accent); transform:translateY(-3px); }
.material-card .mat-icon { font-size:2.5rem; }
.material-card .mat-name { font-weight:bold; color:var(--text); text-align:center; font-size:0.9rem; }
.material-card .mat-type { font-size:0.75rem; color:var(--text-light); }

/* ========== NOVAS FUNCIONALIDADES ========== */

/* Indicador Offline */
.offline-indicator {
    position:fixed;
    top:0;
    left:0;
    right:0;
    background:#f39c12;
    color:white;
    padding:10px;
    text-align:center;
    z-index:9999;
    box-shadow:0 2px 10px rgba(0,0,0,0.2);
    animation:slideDown 0.3s ease;
}
@keyframes slideDown {
    from { transform:translateY(-100%); }
    to { transform:translateY(0); }
}

/* Modo Foco */
.focus-mode-overlay {
    position:fixed;
    top:0;
    left:0;
    right:0;
    bottom:0;
    background:rgba(0,0,0,0.95);
    z-index:10000;
    display:flex;
    align-items:center;
    justify-content:center;
    backdrop-filter:blur(10px);
}
.focus-mode-content {
    text-align:center;
    color:white;
}
.pomodoro-timer {
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:30px;
}
.pomodoro-circle {
    position:relative;
    width:300px;
    height:300px;
}
.pomodoro-svg {
    width:100%;
    height:100%;
    transform:rotate(-90deg);
}
.pomodoro-bg {
    fill:none;
    stroke:rgba(255,255,255,0.1);
    stroke-width:8;
}
.pomodoro-progress {
    fill:none;
    stroke:#27ae60;
    stroke-width:8;
    stroke-dasharray:283;
    stroke-dashoffset:0;
    transition:stroke-dashoffset 1s linear;
    stroke-linecap:round;
}
.pomodoro-time {
    position:absolute;
    top:50%;
    left:50%;
    transform:translate(-50%, -50%);
    font-size:3rem;
    font-weight:bold;
    color:white;
}
.pomodoro-controls {
    display:flex;
    gap:15px;
    flex-wrap:wrap;
    justify-content:center;
}
.pomodoro-controls button {
    padding:12px 24px;
    border:none;
    border-radius:8px;
    font-size:1rem;
    font-weight:bold;
    cursor:pointer;
    transition:all 0.3s;
}
.pomodoro-controls button:hover {
    transform:scale(1.05);
}

/* Anotações */
#notes-textarea {
    font-family:inherit;
    font-size:1rem;
    line-height:1.6;
}

/* Flash Cards */
.flashcard {
    width:100%;
    height:400px;
    position:relative;
    transform-style:preserve-3d;
    transition:transform 0.6s;
    cursor:pointer;
}
.flashcard.flipped {
    transform:rotateY(180deg);
}
.flashcard-front, .flashcard-back {
    position:absolute;
    width:100%;
    height:100%;
    backface-visibility:hidden;
    border-radius:12px;
    padding:30px;
    display:flex;
    align-items:center;
    justify-content:center;
    box-shadow:0 10px 30px rgba(0,0,0,0.2);
    background:var(--card);
    border:2px solid var(--border);
}
.flashcard-back {
    transform:rotateY(180deg);
    background:linear-gradient(135deg, var(--accent), #2ecc71);
    color:white;
    border-color:var(--accent);
}

/* Conquistas */
.trophy-grid {
    display:grid;
    grid-template-columns:repeat(auto-fill, minmax(100px, 1fr));
    gap:15px;
    margin-top:15px;
}
.achievement-badge {
    background:var(--card);
    border:2px solid var(--border);
    border-radius:12px;
    padding:20px 15px;
    text-align:center;
    transition:all 0.3s;
    cursor:pointer;
    position:relative;
    overflow:hidden;
    min-height:140px;
    display:flex;
    flex-direction:column;
    justify-content:space-between;
}
.achievement-badge:hover {
    transform:translateY(-5px);
    box-shadow:0 8px 20px rgba(0,0,0,0.15);
    border-color:var(--accent);
}
.achievement-badge.locked {
    opacity:0.5;
    filter:grayscale(100%);
}
.achievement-icon {
    font-size:4rem;
    margin-bottom:10px;
    display:block;
    line-height:1;
}
.achievement-name {
    font-size:0.9rem;
    font-weight:bold;
    color:var(--text);
    margin-bottom:4px;
}
.achievement-desc {
    font-size:0.75rem;
    color:var(--text-light);
    line-height:1.2;
}
.achievement-points {
    position:absolute;
    top:5px;
    right:5px;
    background:var(--accent);
    color:white;
    font-size:0.7rem;
    padding:2px 6px;
    border-radius:10px;
    font-weight:bold;
}

/* Playlists */
.playlist-card {
    background:var(--card);
    border:2px solid var(--border);
    border-radius:12px;
    padding:20px;
    cursor:pointer;
    transition:all 0.3s;
    position:relative;
}
.playlist-card:hover {
    transform:translateY(-3px);
    box-shadow:0 6px 20px rgba(0,0,0,0.1);
    border-color:var(--accent);
}
.playlist-icon {
    font-size:2.5rem;
    margin-bottom:10px;
}
.playlist-name {
    font-weight:bold;
    font-size:1.1rem;
    color:var(--text);
    margin-bottom:5px;
}
.playlist-count {
    font-size:0.85rem;
    color:var(--text-light);
}

/* Desafios Semanais - Visual Melhorado */
.challenge-card {
    background:var(--card);
    border:2px solid var(--border);
    border-left:5px solid var(--accent);
    border-radius:15px;
    padding:22px;
    position:relative;
    overflow:hidden;
    transition:all 0.3s ease;
    box-shadow:0 2px 8px rgba(0,0,0,0.05);
    min-height:180px;
    display:flex;
    flex-direction:column;
}
.challenge-card:hover {
    transform:translateY(-3px);
    box-shadow:0 6px 20px rgba(0,0,0,0.12);
    border-color:var(--accent);
}
.challenge-card.completed {
    background:linear-gradient(135deg, var(--card) 0%, rgba(39,174,96,0.05) 100%);
    border-left-color:#27ae60;
    box-shadow:0 4px 15px rgba(39,174,96,0.2);
}
.challenge-header {
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    margin-bottom:12px;
    gap:15px;
}
.challenge-icon {
    flex-shrink:0;
    animation:float 3s ease-in-out infinite;
}
@keyframes float {
    0%, 100% { transform:translateY(0px); }
    50% { transform:translateY(-5px); }
}
.challenge-title {
    font-weight:bold;
    font-size:1.15rem;
    color:var(--text);
    line-height:1.3;
}
.challenge-desc {
    font-size:0.9rem;
    color:var(--text-light);
    margin-top:6px;
    line-height:1.4;
}
.challenge-reward {
    background:var(--accent);
    color:white;
    padding:8px 16px;
    border-radius:20px;
    font-size:0.9rem;
    font-weight:bold;
    white-space:nowrap;
    box-shadow:0 2px 8px rgba(0,0,0,0.15);
}
.challenge-progress {
    margin-top:auto;
    padding-top:16px;
}
.challenge-progress-bar {
    height:10px;
    background:rgba(0,0,0,0.08);
    border-radius:10px;
    overflow:hidden;
    margin-top:10px;
    position:relative;
}
.challenge-progress-fill {
    height:100%;
    background:var(--accent);
    transition:width 0.5s ease;
    border-radius:10px;
    position:relative;
}
.challenge-progress-fill::after {
    content:'';
    position:absolute;
    top:0;
    left:0;
    right:0;
    bottom:0;
    background:linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation:shimmer 2s infinite;
}
@keyframes shimmer {
    0% { transform:translateX(-100%); }
    100% { transform:translateX(100%); }
}

/* Mensagens */
.messages-modal-content {
    max-width: 700px;
    width: 90vw;
    min-width: 280px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}
.messages-list-box {
    max-height: 280px;
    min-height: 100px;
    overflow-y: auto;
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(0,0,0,0.02);
    border-radius: 8px;
    flex-shrink: 0;
}
.messages-write-area {
    flex-shrink: 0;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.messages-write-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text);
    margin-bottom: 0;
}
.messages-input {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.4;
    display: block;
}
.messages-send-btn {
    background: #27ae60;
    padding: 12px 24px;
    align-self: flex-end;
}
.message-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
}
.message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}
.message-author {
    font-weight: bold;
    color: var(--text);
}
.message-time {
    font-size: 0.75rem;
    color: var(--text-light);
}
.message-content {
    color: var(--text);
    line-height: 1.5;
}

/* Loading Skeleton */
.skeleton {
    background:linear-gradient(90deg, rgba(0,0,0,0.05) 25%, rgba(0,0,0,0.1) 50%, rgba(0,0,0,0.05) 75%);
    background-size:200% 100%;
    animation:loading 1.5s infinite;
    border-radius:4px;
}
@keyframes loading {
    0% { background-position:200% 0; }
    100% { background-position:-200% 0; }
}

/* Tooltips */
.tooltip {
    position:relative;
    cursor:help;
}
.tooltip::after {
    content:attr(data-tooltip);
    position:absolute;
    bottom:100%;
    left:50%;
    transform:translateX(-50%);
    background:#333;
    color:white;
    padding:8px 12px;
    border-radius:6px;
    font-size:0.85rem;
    white-space:nowrap;
    opacity:0;
    pointer-events:none;
    transition:opacity 0.3s;
    margin-bottom:5px;
    z-index:1000;
}
.tooltip:hover::after {
    opacity:1;
}

/* Gestos Móveis */
.swipeable {
    touch-action:pan-y;
}
.swipe-indicator {
    position:absolute;
    top:50%;
    transform:translateY(-50%);
    font-size:2rem;
    opacity:0.3;
    pointer-events:none;
    transition:opacity 0.3s;
}
.swipe-indicator.left {
    left:20px;
}
.swipe-indicator.right {
    right:20px;
}

/* Acessibilidade */
.sr-only {
    position:absolute;
    width:1px;
    height:1px;
    padding:0;
    margin:-1px;
    overflow:hidden;
    clip:rect(0,0,0,0);
    white-space:nowrap;
    border-width:0;
}
.skip-link {
    position:absolute;
    top:-40px;
    left:0;
    background:#000;
    color:#fff;
    padding:8px;
    text-decoration:none;
    z-index:100;
}
.skip-link:focus {
    top:0;
}

/* Responsividade Melhorada */
@media(max-width: 768px) {
    /* Celular: permite quebra; se não couber, ícones da direita vão para baixo do nome */
    .header-top {
        flex-wrap: wrap;
        gap: 10px;
        margin-bottom: 16px;
    }
    .header-left {
        flex: 1 1 auto;
        min-width: 0;
        order: 1;
    }
    .header-right {
        flex: 1 1 100%;
        justify-content: flex-end;
        order: 2;
    }
    .welcome-text {
        font-size: 1.4rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }
    /* Área de toque confortável no celular */
    .btn-icon-header {
        width: 42px;
        height: 42px;
        min-width: 42px;
        min-height: 42px;
        font-size: 1.2rem;
    }
    .header-right .btn-icon-header.btn-action {
        width: 42px;
        height: 42px;
        min-width: 42px;
        min-height: 42px;
        font-size: 1.15rem;
    }
    .btn-logout {
        height: 42px;
        padding: 10px 18px;
        font-size: 0.9rem;
    }
    .pomodoro-circle {
        width:250px;
        height:250px;
    }
    .pomodoro-time {
        font-size:2.5rem;
    }
    .flashcard {
        height:300px;
    }
    .trophy-grid {
        grid-template-columns:repeat(auto-fill, minmax(80px, 1fr));
    }
}

/* Celular bem pequeno: nome um pouco menor */
@media(max-width: 400px) {
    .welcome-text { font-size: 1.2rem; }
    #challenges-list {
        grid-template-columns: 1fr !important;
    }
    .challenge-card {
        min-height: auto;
    }
    .challenge-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .challenge-reward {
        margin-top: 10px;
    }
}

/* PWA: quando instalado como app (sem barra do navegador) */
@media (display-mode: standalone), (display-mode: minimal-ui) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
    .container {
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
    }
}

/* Animações de Transição */
.fade-in {
    animation:fadeIn 0.3s ease;
}
@keyframes fadeIn {
    from { opacity:0; transform:translateY(10px); }
    to { opacity:1; transform:translateY(0); }
}

.slide-in-right {
    animation:slideInRight 0.3s ease;
}
@keyframes slideInRight {
    from { opacity:0; transform:translateX(50px); }
    to { opacity:1; transform:translateX(0); }
}

/* Melhorias de Contraste para Acessibilidade */
@media(prefers-contrast: high) {
    :root {
        --border:#000;
    }
    body.dark-mode {
        --border:#fff;
    }
}

/* Redução de Movimento para Acessibilidade */
@media(prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration:0.01ms !important;
        animation-iteration-count:1 !important;
        transition-duration:0.01ms !important;
    }
}

/* ========== BANCO DE QUESTÕES MELHORADO ========== */
.advanced-question-card {
    transition:all 0.2s ease;
}
.advanced-question-card:hover {
    box-shadow:0 4px 12px rgba(0,0,0,0.1);
    transform:translateY(-2px);
}
.question-checkbox {
    width:18px;
    height:18px;
    cursor:pointer;
}
.question-checkbox:checked {
    accent-color:var(--accent);
}
.btn-icon-small {
    background:none;
    border:none;
    font-size:1.2rem;
    cursor:pointer;
    padding:5px;
    border-radius:4px;
    transition:all 0.2s;
}
.btn-icon-small:hover {
    background:rgba(0,0,0,0.05);
    transform:scale(1.1);
}
