:root {
    --primary-color: #2563eb;
    --secondary-color: #3b82f6;
    --accent-color: #60a5fa;
    --background-color: #f8fafc;
    --text-color: #1e293b;
    --highlight-color: #2563eb;
    --card-shadow: 0 4px 24px rgba(0,0,0,0.08);
    --sidebar-width: 280px;
    --border-radius: 12px;
    --font-base: 'Inter', system-ui, -apple-system, sans-serif;
    --font-code: 'Fira Code', monospace;
}

/* estilo global */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-base);
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.65;
    font-size: 1rem;
}

/* Conteúdo Principal */
main {
    flex: 1;
    width: 100%;
    padding: 20px;
    margin-left: var(--sidebar-width);
    max-width: 1200px;
    transition: margin 0.3s ease;
    box-sizing: border-box;
    margin-top: 70px;
}

.welcome{
    margin-bottom: 2rem;
    color: #2b7cff
}

h1, h3, h4 {
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1.25rem;
    color: var(--text-color);
    margin: 1rem 0;
}

h2 {
    font-size: 1.75rem;
    margin-bottom: 2rem;
    position: relative;
    padding-bottom: 1rem;
      color: var(--text-color);
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: #60a5fa;
    border-radius: 2px;
}

/* Interação com a logo */
.logo-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    cursor: pointer; 
    transition: none; 
}

.logo-link:hover {
    background-color: transparent !important; 
    transform: none;
}

/* Mobile Header específico */
.mobile-header .logo-link {
    width: auto;
    height: 100%;
}

/* SOMBRA DOS OPERADORES  */
.token.operator{
background: none !important;
border: 0 1px #878787;
}

/* SOMBRA DOS CÓDIGOS  */
.language-javascript{
    text-shadow: 0 1px #878787 !important;  
}

/* CORES DOS CÓDIGOS ABAIXO  */
.token.keyword{
    color: #70d4ff !important;
}

.token.number{
color: #ff44ac !important;
}

.token.boolean{
color:#ff6c6c !important;
}
.token.string{
    color: #05d333 !important;
}

.token.operator{
color: #ffa132 !important;
}

.token.function{
color:#bd4eff !important;
}
/* fim de cores */

/* Titulo principal das linguagens  */
.title-lang{
 text-align: center;
 background: linear-gradient(135deg,
 #2563eb,       
 #3b82f6 60%,  
 #6C95F5       
);
 border-radius: 12px;
 padding: 5px;
 color:white ;
}

/* distancia das uls das paginas  */
.code-comparison ul{
    margin-left: 20px;
}

.best-practice ul{
    margin-left: 20px;
}

.content-section ul{
       margin-left: 20px; 
}
/* fim das ul */

.language-content{
border-radius: 8px;
text-shadow:none !important;
}

.js-definition{
    font-size: 0.97rem;
}

.definicao-js{
font-size: 1.5rem;
margin-bottom: 35px;
}

/* Sidebar Desktop */
.sidebar {
    background-color: #1160d6;
    width: var(--sidebar-width);
    color: white;
    padding: 1.5rem;
    position: fixed;
    display: flex;
    flex-direction: column;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 1000;
    width: var(--sidebar-width);
    box-shadow: var(--card-shadow);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    scroll-behavior: smooth;
}

.sidebar .logo {
    display: flex;
    align-items: center;
    /* padding-bottom: 1rem;
    margin-bottom: 1rem; */
    position: relative;
}

.sidebar .logo h2 {
    color: white !important;
    font-weight: 700;
    margin-left: 10px;
}


.sidebar .logo img {
    width: 50px;
    margin-right: 10px;
}

.sidebar.active {
    transform: translateX(0);
}

.sidebar ul {
    list-style: none;
    padding: 0;
}

.sidebar li {
    margin-bottom: 0.5rem;
}

.sidebar a {
    text-decoration: none;
    color: var(--text-color);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s ease;
}

.sidebar a:hover {
    background-color: #f1f5f9;
    color: var(--primary-color);
}

.sidebar .submenu-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 1.5rem 0 0.5rem;
    padding-left: 1rem;
}

/* Menu de linguagens */
.menu-linguagens {
    list-style: none;
    padding: 1rem 0;
}

.menu-linguagens .menu-title {
    font-weight: bold;
    color: antiquewhite;
    margin-bottom: 15px;
    opacity: 0.7;
}

.menu-linguagens li a {
    text-decoration: none;
    margin: 0.5rem 1rem;
    display: flex;
    align-items: center;
    padding: 15px 20px;
    font-size: 1rem;
    border-radius: 8px;
    color: #fff;
    transition: all 0.2s ease;
    font-weight: 500;
    background-color: rgba(255, 255, 255, 0.1);
}

.menu-linguagens li a:hover {
    background: white !important;
    color: var(--primary-color) !important;
    transform: translateX(4px);
}

.menu-actions {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    gap: 0.75rem;
    position: relative;
    padding-bottom: 0.1em;
}

.menu-action {
    color: white;
    text-decoration: none;
    padding: 8px;
    text-align: center;
    background-color: rgba(255, 255, 255, 0.945);
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.9rem; 
}

.menu-action:hover {
    background-color: rgba(255,255,255,0.2);
    transform: translateX(5px);
}

.close-menu {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    width: 30px;
    height: 30px;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-menu:hover {
    background-color: rgba(255,255,255,0.1);
    transform: rotate(90deg);
}

#home {
    padding: 40px;
    text-align: center;
}

.content-section {
    background:#0f172a;
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--card-shadow);
}
/* fim do menu */


/* Container das opções corretas e incorretas dos quizzes */
.error-example {
    border-radius: var(--border-radius);
    padding: 1rem;
    margin: 1.5rem 0;
}

.incorrect-code {
    background: #ff767608;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 4px solid #ef4444; 
    position: relative;
}

.correct-code {
    background: #81ffac0d;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #22c55e;
}

.error-explanation ul,
.correction-details ul {
    list-style-type: none;
    padding-left: 1.5rem;
}

.error-explanation li::before {
    content: '❌';
    margin-right: 0.5rem;
}

.correction-details li::before {
    content: '✅';
    margin-right: 0.5rem;
}

.error-correction {
    border: 2px solid #ef4444;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin: 2rem 0;
    background: #fff5f5;
}
/* fim do container */

/* Destaques e Boas Práticas */
.best-practice,
.dica {
    background: #f8fafc;
    border-left: 4px solid var(--primary-color);
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    position: relative;
}

.best-practice ol{
margin-left: 20px;
}

.best-practice::before,
.dica::before {
    content: '💡';
    position: absolute;
    left: -15px;
    top: -15px;
    background: white;
    border-radius: 50%;
    padding: 5px;
    font-size: 1.5rem;
}

.best-practice strong,
.dica strong {
    display: block;
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
}
/* fim das boas práticas */

/* Estilos para as páginas individuais */
.language-content {
    max-width: 1200px;
    margin: 30px auto;
}

.content-section, .playlist-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.playlist-section {
    margin-top: 2rem;
    padding: 2rem;
    background:white; 
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.playlist-embed {
    position: relative;
    padding-bottom: 56.25%;
    width: 90%;
    margin: 0 auto;
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    margin-top: 1.5rem;
}

.playlist-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.topic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.topic-card {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    transition: transform 0.2s ease;
}

.topic-card:hover {
    transform: translateY(-3px);
}

code.language-content {
    font-family: var(--font-code);
    background: #479cf1;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    color: #1e40af;
    font-size: 0.9em;
    display: inline-block;
    line-height: 1.4;
}
/* fim do estilo para páginas individuais */

/* Estilo para blocos de código maiores */
pre code.language-content {
    display: block;
    padding: 1.5rem !important;
    margin: 1.5rem 0;
    border-radius: var(--border-radius);
    overflow-x: auto;
    font-size: 0.9rem;
    line-height: 1.5;
    white-space: pre;
}

.feature-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 40px;
}

.feature-card {
    padding: 1.5rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    background-color: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s, box-shadow 0.2s;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.219);
}

.feature-card .feature-icon {
    font-size: 50px;
    margin-bottom: 15px;
}

.cta-section {
    background-color: var(--background-color);
    padding: 40px;
    border-radius: 10px;
}

.language-quick-access {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.lang-btn {
    text-decoration: none;
    color: white;
    background-color: var(--primary-color);
    padding: 14px 30px; 
    border-radius: 8px; 
    transition: all 0.3s ease; 
    font-size: 1rem; 
    white-space: nowrap; /* Impede que o texto quebre linha */
    min-width: 100px; 
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid transparent;
}

.lang-btn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px); /* Efeito de levitação */
    box-shadow: 0 4px 12px rgba(0,0,0,0.15); 
    border-color: rgba(255,255,255,0.2); 
}

/* Animações */
@keyframes slideLeft {
    from { opacity: 0; transform: translateX(-50px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideRight {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(50px); }
    to { opacity: 1; transform: translateY(0); }
}

[data-animation="slide-left"] { animation: slideLeft 1s ease; }
[data-animation="slide-right"] { animation: slideRight 1s ease; }
[data-animation="slide-up"] { animation: slideUp 1s ease; }
/* fim das animações */

/* Tabelas responsivas */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1rem 0;
    border-radius: var(--border-radius);
    box-shadow: 0 0 0 1px rgba(0,0,0,0.1);
    position: relative;
}

.table-responsive:after {
    content: "";
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 20px;
    background: linear-gradient(to right, transparent, rgba(0,0,0,0.1));
    pointer-events: none;
}

.attributes-table {
    min-width: 600px; 
}
/* fim das tabelas responsivas */

/* Vídeos das playlists responsivos */
.video-container {
    position: relative;
    border-radius: 12px;
    padding-bottom: 56.25%; 
    height: 0;
    width: 100%;
    margin: 1.5rem 0;
    margin-top: 1.5rem;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.video-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: var(--border-radius);
    transform: scale(1.02);
    display: none;
}

.video-cover {
    width: 100%;
    height: auto;
    display: block;
}

.video-container.loaded iframe {
    display: block !important;
    z-index: 2;
}

.video-container.loaded .video-cover,
.video-container.loaded .play-button {
    display: none;
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    clip-path: polygon(35% 25%, 35% 75%, 75% 50%);
}

/* Créditos das Playlists */
.playlist-credits {
    margin-top: 1.5rem;
    padding: 1rem;
    background:#f8fafc; 
    border-radius: 8px;
    text-align: center;
    border-left: 3px solid var(--primary-color);
}

.playlist-credits strong {
    display: block;
    font-size: 1.05rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.playlist-credits small {
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.4;
}

.playlist-credits a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.playlist-credits a:hover {
    text-decoration: underline;
}
/* fim dos videos responsivos */

/* Quizzes */
.quizes{
    margin: 2rem auto 0 10px;
}
.quizzes-section {
    max-width: 1200px;
    margin: 0 auto;
}
.quizzes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 4rem;
    width: 100%;
}
.quiz-card {
    background: white;
    border-radius: 12px;
    text-align: center;
    padding: 1.5rem;
    cursor: pointer;
   box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.08),
        0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.quiz-card:hover {
   transform: translateY(-3px);
    box-shadow: 
        0 6px 8px rgba(0, 0, 0, 0.1),
        0 8px 16px rgba(0, 0, 0, 0.08);
}
.quiz-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}
.quiz-container {
    margin-top: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
}
.quiz-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem; 
    position: relative; 
}
.quizzes-title {
    text-align: center;
    margin: 2rem auto;
    width: 100%;
    color: #3b82f6;
}
.score-box {
    background: var(--background-color);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    order: 2; /* Coloca a pontuação abaixo do título */
    margin-top: 1rem;
}
.question-card {
    background: var(--background-color);
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}
.quiz-result {
    text-align: center;
    padding: 2rem;
}
.quiz-active, .quiz-result {
    display: block !important;
    padding: 2rem;
    opacity: 1;
    transition: opacity 0.3s ease;
}
.quiz-result .result-content {
    margin-top: 10px;
    background: white;
    border-radius: 12px;
}
.result-subtitle {
    color: #64748b;
    margin-bottom: 1.5rem;
    font-size: 0.9em;
    text-align: center;
}
.result-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}
.result-actions button {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease;
}
.result-actions button:first-child {
    background: #2563eb;
    color: white;
}
.result-actions button:last-child {
    background: #94a3b8;
    color: white;
}
.result-actions button:hover {
    transform: translateY(-2px);
}
#optionsContainer {
    display: grid;
    gap: 1rem;
    margin-top: 1.5rem;
}
.option {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid #e2e8f0;
}
.option:hover:not(.disabled) {
    border-color: var(--primary-color);
    transform: translateX(5px);
}

/* Resultado final do quiz */
.result-summary {
    margin: 2rem 0;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
}

.question-result {
    padding: 1.5rem;
    margin: 1rem 0;
    border-radius: 8px;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.question-result.correct {
    border-left: 4px solid #22c55e;
}

.question-result.incorrect {
    border-left: 4px solid #ef4444;
}

.user-answer {
    color: #ef4444;
    font-weight: 500;
}

.correct-answer {
    color: #22c55e;
    font-weight: 500;
}

.explanation {
    margin-top: 0.5rem;
    font-size: 0.9em;
    color: #64748b;
    border-top: 1px solid #e2e8f0;
    padding-top: 0.5rem;
}
/* fim da sessão para os quizzes */

/* Efeitos de Feedback */
.confetti-effect {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
}
.sad-effect {
    font-size: 1.5rem;
    animation: drip 1s ease-out;
}

@keyframes drip {
    0% { transform: translateY(-20px); opacity: 0; }
    50% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(20px); opacity: 0; }
}

.feedback-content {
    position: relative;
    padding: 1rem;
}

.option.correct {
    background: #dcfce7;
    border-color: #22c55e;
}

.option.incorrect {
    background: #fee2e2;
    border-color: #ef4444;
}

#feedback {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 8px;
}

#feedback.correct {
    background: #dcfce7;
    border-left: 4px solid #22c55e;
}

#feedback.incorrect {
    background: #fee2e2;
    border-left: 4px solid #ef4444;
}
/* fim dos feedbacks */

/* Botões de voltar e proximo para os quizzes */
.back-button {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background: var(--primary-color);
    color: white !important;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    text-decoration: none;
    position: absolute;
    left: 1rem;
    top: 60%;
    transform: translateY(-50%);
    z-index: 1;
}

.back-button:hover {
    background: var(--secondary-color);
    transform: translateY(-50%) scale(1.05);
}

/* Botão de proxima questão */
#nextQuestion {
    display: block;
    margin: 1.5rem auto 0;
    padding: 0.8rem 2rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#nextQuestion:hover {
    background: var(--secondary-color);
    transform: scale(1.05);
}
.hidden {
    display: none !important;
    opacity: 0;
}

/* Notificações */
.notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    background: #3b82f6;
    color: white;
    animation: slideIn 0.3s ease;
}

.notification-success { background: #22c55e; }
.notification-error { background: #ef4444; }
.notification-warning { background: #f59e0b; }

@keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}
/* fim das notificações */

/* Estilos para os novos botões */
#restartButton {
    background: #2563eb;
    color: white;
}

#returnButton {
    background: #64748b;
}

#restartButton:hover, #returnButton:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

/* Cards de Códigod (explicação) */
code {
    font-family: var(--font-code);
    background: #f1f5f9;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    color: #1e40af;
    font-size: 0.9em;
}

pre code {
    display: block;
    padding: 1.5rem !important;
    margin: 1.5rem 0;
    border-radius: var(--border-radius);
    background: #1e293b !important;
    color: #f8fafc !important;
    overflow-x: auto;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Grid de Tags Responsivo */
.tags-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.tag-item {
    border: 1px solid #3b82f6;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    transition: transform 0.2s ease;
}

.tag-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--card-shadow);
}

/* Tabelas Responsivas */
.attributes-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: #0f172a;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.attributes-table td { 
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    color: #e2e8f0;
}

.attributes-table th {
    background: #2564eb57;
    font-weight: 600;
    color:#f9fcff;
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

:not(pre) > code[class*="language-"],
pre[class*="language-"] {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
}

/* Para navegadores WebKit (Chrome, Safari) */
.table-responsive::-webkit-scrollbar {
    height: 8px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

/* Sessão para o botão Scroll to Top */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.scroll-to-top.active {
    opacity: 1;
    visibility: visible;
    bottom: 30px;
    animation: bounce 2s infinite;
    transform: translateY(0);
}

.scroll-to-top:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

.scroll-to-top:active {
    transform: scale(0.95);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* Botão Scroll to Top no resultado */
.quiz-result .scroll-to-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--primary-color);
    color: white;
    padding: 12px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
}

.quiz-result .scroll-to-top-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(114, 114, 114, 0.2);
}

/* Mostrar botão apenas quando necessário */
.scroll-to-top-btn {
    display: none;
}

.scroll-to-top-btn.active {
    display: flex;
}
/* fim da sessão para o botão scroll to top */

/* Sessão de adicionar header no mobile */
.mobile-header {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: #1160d6;
    z-index: 1100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    align-items: center;
    padding: 0 15px;
}
.mobile-header-content {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
}
.mobile-header .theme-toggle {
   position: static;
    transform: none;
    margin-left: 80px;
    margin-right: 0;
    background: rgba(255, 255, 255, 0.1);
}
.mobile-header .logo {
    display: flex;
    align-items: center;
    justify-content: flex-start; 
    width: auto; 
    gap: 5px; 
    margin-right: auto; 
    flex-grow: 1;
}
.mobile-header .logo img {
    width: 40px;
    height: 40px;
    margin-right: 10px;
}
.mobile-header .logo-content {
    display: flex;
    align-items: center;
    gap: 10px;
}
.mobile-header img {
    width: 40px;
    height: 40px;
}
.mobile-header h2 {
    color: white;
    font-size: 1.25rem;
    margin: 0; 
    padding: 0; 
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}
/* fim da sessão de adicionar header no mobile */

/* Menu mobile */
.mobile-menu {
    position: fixed;
    top: 70px; /* Altura do header */
    left: 0;
    right: 0;
    bottom: 0;
    background: #1160d6;
    max-height: 0;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 1099;
    width: 100% !important; /* Forçar largura total */
}
.mobile-menu.active {
    transform: translateX(0);
    max-height: calc(100vh - 70px);
    display: flex !important; /* Exibir como flex */
    flex-direction: column; /* Manter organização do sidebar */
}
.mobile-menu-content {
    padding: 1rem;
    display: flex !important;
    flex-direction: column;
    flex-grow: 1;
}
.mobile-menu-overlay {
    position: fixed;
    top: 70px; /* Começa abaixo do header */
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1099;
}
.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Mostrar elementos do sidebar no mobile */
.mobile-menu.active .menu-linguagens,
.mobile-menu.active .menu-actions {
    display: flex !important;
    opacity: 1;
    width: 100%;
    flex-direction: column;
}

/* Ajustar links */
.mobile-menu .menu-linguagens li a {
    margin: 0.5rem 0;
    padding: 1rem;
    color: white !important;
    background-color: rgba(255, 255, 255, 0.1);
}

.mobile-menu .menu-linguagens li a:hover {
background: white !important;
color: var(--primary-color) !important;
}

/* menu hamburguer no mobile */
.hamburger {
    width: 25px; 
    height: 20px; 
    padding: 8px; 
}

.hamburger span {
    height: 1.5px; 
    margin: 3px 0;
}

/* Ajuste para estado ativo */
.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(3px, 3px); 
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(3px, -3px);
}

/* Posicionamento do copyright mobile */
.mobile-copyright {
    position: relative !important;
    bottom: auto;
    background: transparent;
    color: rgba(255,255,255,0.7) !important;
    padding: 1rem 0 !important;
}

/* Footer Copyright */
.footer-copyright {
    margin-top: auto;
    padding: 1rem;
    text-align: center;
    color: #eeeeeea4;
    font-size: 0.8rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 0.1rem;
}

.footer-copyright p {
    line-height: 1.4;
    margin: 0;
}

[data-lang].active {
    background: var(--primary-color);
    color: white !important;
}

/* Estilos específicos para Página lógica de programação */
.definition-box {
    background: #f8fafc; 
    border-radius: 8px;
    padding: 2rem;
    margin: 1.5rem 0;
    border-left: 4px solid #2563eb;
}

.logic-concept {
    background:white; 
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin: 1rem;
}

.interactive-example {
    background: white; /*#0f172a;*/
    border: 2px dashed #1e51f775;
    padding: 1.5rem;
    border-radius: 8px;
    position: relative;
}

.interactive-example::before {
    content: "🖥️ Experimente!";
    position: absolute;
    top: -12px;
    left: 20px;
    background: #60a5fa;
    padding: 0 8px;
    color: #0f172a;
    font-size: 0.9em;
}

                        /* >>>>>>>>>>>>>>>>>>RESPONSIVIDADE PARA TODOS OS TIPOS DE TELAS <<<<<<<<<<<<<<<<<<<<<< */

/* Telas extra grandes (acima de 1024px) */
@media (min-width: 1025px) {
    .mobile-header {
        height: 90px;
    }
    
    .mobile-header h2 {
        font-size: 1.6rem;
        max-width: 400px;
    }
    
    .hamburger {
        width: 40px;
        height: 32px;
    }
}

/* Telas grandes (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .mobile-header {
        height: 80px;
    }
    
    .mobile-header h2 {
        font-size: 1.4rem;
        max-width: 300px;
    }
    
    .hamburger {
        width: 35px;
        height: 28px;
    }
}

/* Mantém o layout original para desktop */
@media (min-width: 769px) {
     .theme-toggle-container {
        display: block;
    }
    
    main {
        padding-right: 60px;
        margin-top: 90px;
        padding: 30px;
    }

    .quizzes-grid {
        max-width: 900px; /* Largura máxima para o grid */
        margin-left: auto;
        margin-right: auto;
    }

    .mobile-copyright {
        display: none;
      }

      .mobile-header {
        display: none;
    }
    
    .sidebar {
        height: 100vh;
        overflow-y: auto;
        overflow-x: hidden;
        display: flex;
        scrollbar-gutter: stable;
    }

    .sidebar .logo {
        flex-shrink: 0;
    }

    /* Personaliza a barra de rolagem para navegadores WebKit (Chrome, Edge, Safari) */
    ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
   }

    ::-webkit-scrollbar-track {
    background: rgba(59, 131, 246, 0.452); 
    border-radius: 5px;
   }

   ::-webkit-scrollbar-thumb {
    background: #3b82f6; 
    border-radius: 5px;
    border: 2px solid transparent;
    background-clip: content-box;
   }

  ::-webkit-scrollbar-thumb:hover {
    background: #60a5fa; 
    background-clip: content-box;
  }
   
/* Scrollbar do menu de linguagens (sidebar) */
    .sidebar::-webkit-scrollbar {
        width: 8px;
    }

    .sidebar::-webkit-scrollbar-thumb {
        background: #3b82f6;
        border-radius: 4px;
    }
    
    .sidebar::-webkit-scrollbar-thumb:hover {
    background: #60a5fa;
   }

    .sidebar::-webkit-scrollbar-track {
        background: rgba(51, 129, 255, 0.795);
    }

    /* Scrollbar no dark mode */
   [data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #3b82f6; 
  }

  [data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #93c5fd; 
  }

  [data-theme="dark"] ::-webkit-scrollbar-track {
    background: rgba(59, 130, 246, 0.05); /* Track mais suave no dark */
 }

    .menu-linguagens {
        flex-grow: 1;
        overflow-y: auto;
        padding-bottom: 1rem;
        padding-right: 8px; /* Previne corte de conteúdo */
    }
     .menu-linguagens li a {
        padding: 20px 30px;
        font-size: 1.2rem;
    }

    .menu-actions {
        flex-shrink: 0;
        padding-top: 1rem;
        position: relative;
        /* background: linear-gradient(to top, #1160d6 85%, transparent); */
    }

     [data-theme="dark"] .menu-actions {
        padding-bottom: 0.1em;
        gap: 1.25rem; /* espaçamento entre os botões */
    }
    
    .footer-copyright {
        position: sticky;
        bottom: 0;
        background: #1160d6;
        z-index: 1;
        margin-top: 15px;
    }
     .mobile-menu {
        top: 90px;
    }
}

@media (max-width: 768px) {
    .mobile-header {
        display: block;
    }
  .mobile-header-content {
        gap: 10px;
    }
 .mobile-header .theme-toggle {
        order: 2; /* Coloca o botão depois da logo */
        margin-left: auto;
    }
    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        transform: none;
        padding: 0;
        box-shadow: none;
        display: none;
    }
    
    .sidebar.active {
        display: block;
        animation: slideDown 0.3s ease;
    }
    
    .mobile-menu {
        position: fixed;
        top: 70px; 
        left: 0;
        right: 0;
        background: #1160d6;
        max-height: 0;
        overflow-y: auto;
        transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1100; /* Garante que fique acima do conteúdo */
      }

   .mobile-menu .menu-linguagens,
    .mobile-menu .menu-actions {
        display: flex !important;
        opacity: 1 !important;
    }
    
    .mobile-menu .menu-actions {
        margin-top: 40px;
        padding-bottom: 70px; 
    }
    
    .mobile-menu .footer-copyright {
        display: block !important;
        padding: 1rem;
    }
    #home{
        padding: 0;
    }
    .welcome{
        padding: 10px;
        margin: 1.5rem 0 1.2rem;
    }
      .mobile-menu.active {
        max-height: calc(100vh - 70px); /* Altura total menos o header */
      }
    
      .mobile-menu-content {
        padding: 1rem;
      }
    
    .close-menu {
        display: none; 
    }

    /* Conteúdo do menu original */
    .menu-linguagens,
    .menu-actions {
     display: none;
     width: 100%;
     padding: 1rem;
     opacity: 0;
     transition: opacity 0.3s ease;
   }

    .container {
        position: relative;
        min-height: 100vh;
        overflow-x: hidden;
    }

    .language-grid, .quiz-selection {
        grid-template-columns: 1fr;
    }
    
    .feature-cards {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .hidden {
        display: none;
    }

    .content-section {
        padding: 1.5rem 1rem;
        border-radius: 0;
        margin: 1rem -1rem;
        width: calc(100% + 2rem);
    }

    h2 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    h2::after {
        width: 100%;
        height: 2px;
    }

    .tags-grid {
        grid-template-columns: 1fr;
    }

    .menu-actions {
        width: 100%;
        margin: 5px 0;
        padding: 12px;
    }

    .menu-action {
        flex: 1 1 45%;
        margin: 0.25rem;
    }

     /* Ajustes de tabelas */
     .attributes-table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

     .table-responsive {
        border-radius: 0;
        margin-left: -1rem;
        margin-right: -1rem;
        width: calc(100% + 2rem);
    }
      .content-section .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch; /* Suave no iOS */
        margin: 1rem 0;
        border-radius: var(--border-radius);
    }

    .content-section table {
        width: auto; 
        min-width: 100%; 
        white-space: nowrap; /* Impede quebra de linha */
    }

    .content-section table th,
    .content-section table td {
        white-space: nowrap; 
        padding: 0.75rem; 
    }

    /* Vídeos responsivos */
    .playlist-embed {
        margin: 0 auto;
        width: 100%;
        position: relative;
    }

    /* Blocos de código */
    pre code {
        font-size: 0.8rem;
        padding: 1rem !important;
        white-space: pre-wrap;
        word-wrap: break-word;
    }

    /* Cards e grids */
    .topic-grid,
    .feature-cards {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

     /* Botões */
     .lang-btn {
        display: block;
        width: 100%;
        margin: 5px 0;
    }

    /* Texto e elementos inline */
    code {
        font-size: 0.75rem;
        padding: 0.2rem 0.4rem;
    }

    /* Ajustes finos de elementos */
    .menu-linguagens li a {
        margin: 0.5rem 0;
    }

    .best-practice,
    .dica {
        margin-left: 0;
        margin-right: 0;
        padding: 1rem;
    }

    .best-practice ul{
     margin-left: 20px;
    }

    .content-section ul{
        margin-left: 20px; 
    }

    /* Garantir que imagens não ultrapassem */
    img {
        max-width: 100%;
        height: auto;
    }

    /* Ajuste final para vídeos incorporados */
    iframe {
        max-width: 100%;
    }
    .quiz-options button {
        padding: 12px;
        font-size: 0.9rem;
    }

    .scroll-to-top {
        width: 40px;
        height: 40px;
        right: 15px;
        bottom: -40px;
    }

    .scroll-to-top svg {
        width: 20px;
        height: 20px;
    }

    .quiz-result .scroll-to-top-btn {
        bottom: 80px;
        right: 20px;
        width: 45px;
        height: 45px;
    }

    .footer-copyright {
        display: none; 
      }
    
    .menu-action {
        padding: 6px;
        font-size: 0.8rem;
    }

    .mobile-copyright {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 70px;
        background: #1160d6;
        padding: 1rem;
        text-align: center;
        color: rgba(255, 255, 255, 0.548);
        font-size: 0.8rem;
        z-index: 990;
        margin: 0;
      }

    /* menu hamburguer mobile */
    .hamburger {
    display: flex !important;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 24px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1101;
    margin-left: 15px;
    position: static;
    top: 15px;
    right: 20px;
    transform: none;
   order: 3; /* Coloca o hamburger depois do botão de tema */
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: white;
    transition: all 0.3s ease;
    margin: 3px 0; 
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.hamburger.active span:nth-child(2) {
    opacity: 0;
}
.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.sidebar {
    width: 100%;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.active {
    transform: translateX(0);
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

main {
    margin-top: 70px; 
    margin-left: 0 !important;
    padding: 1rem;
   }

   @keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
  }

.back-button {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        margin: 0 auto 1.5rem;
        width: max-content;
        display: block;
    }

   .quiz-header {
        padding-top: 3rem; /* Espaço para o botão */
        position: relative;
    }

    .quiz-container {
        margin-top: 1rem;
        /* padding: 1rem; */
    }

    .quizzes-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-top: 2rem;
        padding: 0 1rem; 
    }

    .quiz-card {
        padding: 1.5rem;
    }

    .quiz-card:hover {
        transform: none; 
    }

    .result-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    .option {
        padding: 0.75rem;
    }

    .option:hover:not(.disabled) {
        transform: none; 
        border-color: var(--primary-color);
    }
}

/* Telas médias (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    .mobile-header {
        height: 70px;
    }
    
    .mobile-header h2 {
        font-size: 1.2rem;
        max-width: 250px;
    }
}

@media (min-width: 481px) {
    main {
        margin-top: 80px;
        padding: 25px;
    }
      .mobile-menu {
        top: 80px;
    }
    .menu-linguagens li a {
        padding: 18px 25px;
        font-size: 1.1rem;
    }
}

/* Ajustes para telas muito pequenas */
@media (max-width: 480px) {
    body {
        font-size: 16px;
    }

    h2 {
        font-size: 1.3rem;
    }

    .content-section {
        padding: 1rem;
    }

    .menu-action {
        font-size: 0.9rem;
        color:#1e293b;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .tags-grid {
        grid-template-columns: 1fr;
    }

    .quiz-options button {
        font-size: 0.9rem;
        padding: 0.8rem;
    }

    .feature-card .feature-icon {
        font-size: 40px;
    }

    .feature-card {
        padding: 1rem;
        min-height: auto;
    }

    .lang-btn {
        padding: 12px 20px;
        font-size: 0.9rem;
        min-width: 90px;
        width: 100%; 
    }

    /* Menu mobile */
    .sidebar {
        width: 100%;
        padding: 1rem;
    }

    .sidebar .logo img {
        width: 40px;
        margin-right: 10px;
    }

    .sidebar .logo h2 {
        font-size: 1.25rem;
        margin: 0;
        flex-grow: 1;
      }

    .menu-linguagens li a {
        padding: 0.75rem;
        margin: 0.25rem 0;
    }

    /* Elementos interativos */
    .quiz-navigation {
        flex-direction: column;
    }

    .language-quick-access {
        gap: 10px;
    }

    .back-button {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .question-card {
        padding: 1rem;
    }

     .result-actions button {
        width: 100%;
        padding: 0.75rem;
    }

    .js-definition{
        font-size: 0.9rem;
    }

    .definicao-js{
        font-size: 1.1rem;
        margin-bottom: 25px;
        }

        .mobile-header {
        height: 68px;
        padding: 0 10px;
    }
    
    .mobile-header h2 {
        font-size: 1rem;
        max-width: 150px;
    }
    
    .hamburger {
        width: 25px;
        height: 20px;
    }
}

/* Melhorias de toque para mobile */
@media (hover: none) {
    .feature-card:hover,
    .topic-card:hover,
    .menu-linguagens li a:hover {
        transform: none;
    }
    
    button, a {
       min-height: 28px;
       min-width: 30px;
    }
}

/* Prevenir overflow horizontal */
img, video, iframe {
    max-width: 100%;
    height: auto;
}

/* Correção específica para iOS */
@supports (-webkit-touch-callout: none) {
    .sidebar {
        height: -webkit-fill-available;
    }
}
@media (prefers-reduced-motion: reduce) {
    .scroll-to-top {
        transition: none;
    }
}