@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;900&display=swap');
:root {
    --background-dark: #0f172a; /* slate-900 */
    --sidebar-bg: #1e293b;      /* slate-800 */
    --card-bg: #1e293b;         /* slate-800 */
    --border-color: #334155;    /* slate-700 */
    --primary-accent: #00ff8c;
    --primary-accent-hover: #00e67e;
    --text-light: #e5e7eb;
    --text-dark: #9ca3af;
    --favorite-red: #ef4444;
}
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background-dark);
    color: var(--text-light);
}

/* --- SCROLL AREA & STICKY FOOTER FIX --- */
/* Transforma a área de rolagem em flex column para o footer respeitar o final */
#main-scroll-area {
    display: flex;
    flex-direction: column;
    min-height: 100%; /* Garante que o container tenha altura mínima */
}

#main-scroll-area::-webkit-scrollbar { width: 12px; }
#main-scroll-area::-webkit-scrollbar-track { background: var(--background-dark); }
#main-scroll-area::-webkit-scrollbar-thumb { background-color: var(--border-color); border-radius: 10px; border: 3px solid var(--background-dark); }
#main-scroll-area::-webkit-scrollbar-thumb:hover { background-color: var(--primary-accent); }

main, #main-container { transition: opacity 0.2s ease-in-out; }
#app-container.tool-view-active #main-content { padding: 0.25rem; }
#app-container.tool-view-active > #main-container { min-width: 0; }

@keyframes aurora-bg { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@keyframes subtle-glow { 0%, 100% { text-shadow: 0 0 6px var(--primary-accent); } 50% { text-shadow: 0 0 12px var(--primary-accent), 0 0 20px var(--primary-accent); } }
.main-footer { position: relative; padding: 2rem 1rem; margin-top: auto; border-top: 1px solid var(--border-color); text-align: center; overflow: hidden; background-color: var(--background-dark); }
.main-footer::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: radial-gradient(ellipse at 50% 100%, rgba(0, 255, 140, 0.15) 0%, transparent 50%), radial-gradient(ellipse at 0% 0%, rgba(0, 198, 255, 0.15) 0%, transparent 40%), radial-gradient(ellipse at 100% 0%, rgba(0, 255, 140, 0.15) 0%, transparent 40%); background-size: 250% 250%; animation: aurora-bg 25s ease-in-out infinite; z-index: 0; opacity: 0.8; }
.footer-content { position: relative; z-index: 1; }
.footer-brand { display: flex; align-items: center; justify-content: center; gap: 0.5rem; font-size: 1.125rem; font-weight: 900; color: var(--text-light); }
.footer-brand .gpl-text { color: var(--primary-accent); animation: subtle-glow 4s ease-in-out infinite; }
.footer-slogan { margin-top: 0.5rem; font-size: 0.875rem; font-weight: 500; color: var(--text-dark); font-style: italic; }

#product-seo {
    font-size: 16px;
}

/* --- Efeitos Visuais e Temas --- */
#snow-toggle-btn {
    position: absolute;
    bottom: 1.25rem;
    left: 1.25rem;
    width: 44px;
    height: 44px;
    background-color: rgba(30, 41, 59, 0.7); /* slate-800 com transparência */
    backdrop-filter: blur(5px);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2; /* Para ficar acima do conteúdo do footer */
    font-size: 1.1rem;
}

#snow-toggle-btn:hover {
    background-color: var(--border-color);
    color: #38bdf8; /* sky-400 */
    transform: scale(1.1) rotate(360deg);
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.3);
}

#snow-toggle-btn.active {
    color: #67e8f9; /* cyan-300 */
    background-color: #164e63; /* cyan-800 */
    box-shadow: 0 0 12px #67e8f9, inset 0 0 5px rgba(103, 232, 249, 0.5);
    border-color: #22d3ee; /* cyan-400 */
}

#matrix-toggle-btn {
    position: absolute;
    bottom: 1.25rem;
    left: calc(1.25rem + 44px + 0.75rem); 
    width: 44px;
    height: 44px;
    background-color: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(5px);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
}

#matrix-toggle-btn:hover {
    background-color: var(--border-color);
    color: #00FF00; /* Verde Matrix */
    transform: scale(1.1) rotate(-360deg);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.4);
}

#matrix-toggle-btn.active {
    color: #00FF00;
    background-color: #002b00; /* Verde escuro */
    box-shadow: 0 0 12px #00FF00, inset 0 0 5px rgba(0, 255, 0, 0.5);
    border-color: #008F00; /* Verde médio */
}

/* --- Utilitários Globais --- */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type=number] {
  -moz-appearance: textfield;
}

/* --- Floating Action Button (FAB) para Ferramenta-Uso --- */
.tool-fab-container {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    z-index: 20;
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
}

.fab-main-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--primary-accent);
    color: var(--background-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    border: none;
    box-shadow: 0 5px 15px rgba(0, 255, 140, 0.4);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, background-color 0.3s;
    z-index: 2; /* Garante que o botão principal fique sobre as opções */
}
.fab-main-button:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(0, 255, 140, 0.5);
}

.fab-options {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0; /* Adiciona margem para separar do botão principal */
    pointer-events: none; /* Desativa eventos de mouse por padrão */
}

.fab-option {
    margin-bottom: 0.75rem;
    opacity: 0;
    transform: translateY(20px) scale(0.8);
    transition: opacity 0.2s ease-out, transform 0.2s ease-out;
    position: relative;
}

/* Animação de abertura */
.tool-fab-container.open .fab-main-button {
    transform: rotate(45deg);
}

.tool-fab-container.open .fab-options {
    pointer-events: auto; /* Ativa eventos quando o menu está aberto */
}

.tool-fab-container.open .fab-option {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Efeito cascata na animação de abertura */
.tool-fab-container.open .fab-option:nth-child(1) { transition-delay: 0.2s; }
.tool-fab-container.open .fab-option:nth-child(2) { transition-delay: 0.1s; }
.tool-fab-container.open .fab-option:nth-child(3) { transition-delay: 0s; }


.fab-option-button {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--sidebar-bg);
    color: var(--text-light);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}
.fab-option-button:hover {
    background-color: var(--border-color);
    transform: scale(1.1);
}
.fab-option-button.focus-btn:hover { color: #f59e0b; }
.fab-option-button.fullscreen-btn:hover { color: #3b82f6; }
.fab-option-button.back-btn:hover { color: #a78bfa; }

.fab-option-tooltip {
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%) translateX(-10px);
    background-color: var(--background-dark);
    color: var(--text-light);
    padding: 0.35rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    border: 1px solid var(--border-color);
}
.fab-option:hover .fab-option-tooltip {
    opacity: 1;
    transform: translateY(-50%) translateX(-15px);
}

/* Estilos do contador foram removidos */

/* --- Estilos para o Modo Foco --- */
/* Quando o modo foco é ativado no container principal */
#app-container.focus-mode #sidebar,
#app-container.focus-mode #main-container > header {
    display: none;
}

/* Garante que o container do conteúdo ocupe toda a tela */
#app-container.focus-mode #main-container {
    width: 100vw; /* Largura total da viewport */
    height: 100vh; /* Altura total da viewport */
    padding: 0;
    margin: 0;
}

/* Garante que a área de rolagem e seu conteúdo direto também se expandam */
#app-container.focus-mode #main-scroll-area,
#app-container.focus-mode #main-content,
#app-container.focus-mode #tool-usage-page,
#app-container.focus-mode #tool-iframe-container {
    height: 100%;
    padding: 0;
    margin: 0;
    border-radius: 0; /* Remove bordas arredondadas para um preenchimento perfeito */
}

/* --- NOVO: Estilos do Avatar de Letra (Topbar) --- */
.header-avatar-letter {
    width: 2rem; /* 32px (w-8) */
    height: 2rem; /* 32px (h-8) */
    border-radius: 9999px; /* rounded-full */
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem; /* text-sm */
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1); /* Leve borda interna */
}