/* --- RESET & BASE --- */
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: 'Karla', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    transition: background-color 0.3s ease;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- HEADER --- */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--accent-gradient);
    padding: 0.9rem 1.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    color: white;
    gap: 12px;
    flex-wrap: wrap;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

header h1 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* --- BOTÃO DE TEMA E AÇÕES --- */
.btn-theme {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 700;
    color: white;
    transition: var(--transition, all 0.2s);
    backdrop-filter: blur(8px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    touch-action: manipulation;
}
.btn-theme:hover { 
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.03);
}

/* --- BOTÕES CIRCULARES DE ÍCONES (LÂMPADA E SOL/LUA) --- */
.icon-only-btn {
    position: relative;
    width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(255, 255, 255, 0.18) !important;
    border: 1.5px solid rgba(255, 255, 255, 0.35) !important;
    color: white !important;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.icon-only-btn svg {
    transition: all 0.3s ease;
}

/* EFEITO DA LÂMPADA ACESA NO HOVER (💡 GLOW BRILHANTE DOURADO) */
#tourStartBtn:hover {
    background: rgba(255, 215, 0, 0.28) !important;
    border-color: #FFD700 !important;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.65) !important;
    transform: scale(1.12) translateY(-2px) !important;
}

#tourStartBtn:hover svg {
    color: #FFD700 !important;
    fill: #FFD700 !important;
    filter: drop-shadow(0 0 8px #FFD700) drop-shadow(0 0 16px rgba(255, 215, 0, 0.9)) !important;
    transform: scale(1.1);
}

/* EFEITO DO ÍCONE DE TEMA (SOL / LUA NO HOVER) */
#themeSwitcher:hover {
    background: rgba(255, 255, 255, 0.35) !important;
    border-color: rgba(255, 255, 255, 0.8) !important;
    transform: scale(1.12) translateY(-2px) !important;
}

/* Sol Aceso em Modo Claro */
#themeSwitcher:hover svg {
    color: #FFD700 !important;
    filter: drop-shadow(0 0 8px #FFD700) !important;
    transform: rotate(25deg) scale(1.1);
}

/* Lua Acesa em Modo Escuro (Azul Escuro / Neon Sky Blue) */
body.dark-mode #themeSwitcher:hover {
    background: rgba(30, 41, 59, 0.85) !important;
    border-color: #38BDF8 !important;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.55) !important;
}

body.dark-mode #themeSwitcher:hover svg {
    color: #38BDF8 !important;
    fill: #38BDF8 !important;
    filter: drop-shadow(0 0 8px #38BDF8) drop-shadow(0 0 14px rgba(56, 189, 248, 0.8)) !important;
}

/* --- BALÃO FLUTUANTE DE TEXTO (COMO FUNCIONA / MODOS) --- */
.icon-only-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -36px;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: rgba(15, 23, 42, 0.94);
    color: #FFFFFF;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    z-index: 10000;
}

.icon-only-btn:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* --- FOOTER --- */
footer {
    margin-top: auto;
    padding: 30px 20px;
    text-align: center;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.85rem;
    background: var(--bg-secondary);
}

/* Styling for interactive markers */
.marker-dot {
    position: absolute;
    transform: translate(-50%, -50%);
}

/* --- ADAPTAÇÕES RESPONSIVAS DE HEADER (MOBILE & TABLET) --- */
@media (max-width: 768px) {
    header {
        padding: 0.6rem 1rem;
        gap: 8px;
    }

    .header-left {
        gap: 10px;
    }

    header h1 {
        font-size: 1.05rem;
    }

    .btn-theme {
        padding: 6px 12px;
        font-size: 0.75rem;
        min-height: 36px;
    }
}

@media (max-width: 480px) {
    header {
        padding: 0.5rem 0.8rem;
    }
    
    header h1 {
        font-size: 0.95rem;
    }
}

/* --- CAMPO DE TEXTO MULTILINHA FLASHCARD (IGUAL À CAIXA DO MODO ESTUDO) --- */
textarea.flashcard-input {
    box-sizing: border-box !important;
    position: absolute !important;
    z-index: 20 !important;
    background: var(--bg-card, #FFFFFF) !important;
    color: var(--text-main, #0F172A) !important;
    border: 2px solid var(--cor-dificil, #EF4444) !important;
    border-radius: 8px !important;
    font-family: 'Karla', sans-serif !important;
    font-weight: 700 !important;
    font-size: inherit;
    line-height: 1.25 !important;
    text-align: center !important;
    resize: none !important;
    overflow: hidden !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
    white-space: pre-wrap !important;
    padding: 6px 8px !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
    outline: none !important;
    transition: border-color 0.2s, box-shadow 0.2s !important;
}

textarea.flashcard-input:focus {
    border-color: var(--cor-dificil, #EF4444) !important;
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.65) !important;
}

body.dark-mode textarea.flashcard-input {
    background: #1E293B !important;
    color: #F8FAFC !important;
}
