/* ConfiguraÃ§Ãµes Guiadas - UI Fake Styles */

body.editor-mode {
    min-height: 120vh !important;
}

#configuracoes-guiadas-wrapper {
    width: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    position: relative;
    min-height: 120vh;
}

#configuracoes-guiadas-wrapper * {
    box-sizing: border-box;
}

/* BotÃ£o toggle para mobile - escondido por padrÃ£o */
.toggle-config-menu-btn {
    display: none;
}

@media (max-width: 768px) {
    .toggle-config-menu-btn {
        position: absolute;
        top: 10px;
        left: 10px;
        z-index: 100005;
        background: rgba(59, 130, 246, 0.9);
        backdrop-filter: blur(10px);
        border: 1px solid rgba(59, 130, 246, 0.5);
        border-radius: 50%;
        width: 26px !important;
        height: 26px !important;
        min-width: 26px !important;
        min-height: 26px !important;
        max-width: 26px !important;
        max-height: 26px !important;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.3s ease;
        box-shadow: 0 2px 6px rgba(59, 130, 246, 0.4);
    }

    .toggle-config-menu-btn:hover {
        background: rgba(59, 130, 246, 1);
        transform: scale(1.1);
        box-shadow: 0 6px 16px rgba(59, 130, 246, 0.6);
    }

    .toggle-config-menu-btn #toggle-config-menu-icon {
        color: #ffffff;
        font-size: 14px !important;
        transition: transform 0.3s ease;
    }
}

/* Container principal - layout lado a lado */
.configuracoes-guiadas-container {
    display: flex;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    gap: 20px;
    align-items: stretch;
    justify-content: center;
}

/* Container da UI fake (lado esquerdo) */
.ui-fake-container {
    flex: 0 0 auto;
    width: 360px;
    display: flex;
    justify-content: center;
    align-items: center;
    align-self: stretch;
    position: relative;
    z-index: 100004;
}

/* Menu lateral (lado direito) - altura fixa igual Ã  UI fake */
.config-menu {
    flex: 0 0 auto;
    width: 320px;
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.95) 0%, rgba(59, 130, 246, 0.95) 30%, rgba(37, 99, 235, 0.95) 60%, rgba(29, 78, 216, 0.95) 100%);
    border-radius: 16px;
    padding: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 3px solid rgba(59, 130, 246, 0.6);
    position: relative;
    display: flex;
    flex-direction: column;
    height: calc(324px * 19.5 / 9);
    max-height: calc(324px * 19.5 / 9);
}

.config-menu #topicsContainer {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
}

/* Barra de rolagem customizada para o menu de configuraÃ§Ãµes - mais fina */
.config-menu #topicsContainer::-webkit-scrollbar {
    width: 4px;
}

.config-menu #topicsContainer::-webkit-scrollbar-track {
    background: rgba(29, 78, 216, 0.2);
    border-radius: 2px;
    margin: 4px 0;
}

.config-menu #topicsContainer::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0.4) 100%);
    border-radius: 2px;
    border: none;
    transition: all 0.3s ease;
}

.config-menu #topicsContainer::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.6) 100%);
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.3);
}

.config-menu #topicsContainer::-webkit-scrollbar-corner {
    background: transparent;
}

/* Para Firefox - barra mais fina */
.config-menu #topicsContainer {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.5) rgba(29, 78, 216, 0.2);
}

/* RodapÃ© do menu */
.config-menu-footer {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid rgba(96, 165, 250, 0.5);
    flex-shrink: 0;
    display: flex;
    gap: 10px;
}

/* BotÃ£o Modo Livre */
.btn-free-mode {
    flex: 1;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.9) 0%, rgba(22, 163, 74, 0.9) 100%);
    color: #ffffff;
    border: 2px solid rgba(34, 197, 94, 0.8);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

/* Botão Como Usar */
.btn-como-usar {
    flex: 1;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.9) 0%, rgba(217, 119, 6, 0.9) 100%);
    color: #ffffff;
    border: 2px solid rgba(245, 158, 11, 0.8);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-como-usar:hover {
    background: linear-gradient(135deg, rgba(245, 158, 11, 1) 0%, rgba(217, 119, 6, 1) 100%);
    border-color: rgba(245, 158, 11, 1);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
}

.btn-como-usar:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.btn-free-mode:hover {
    background: linear-gradient(135deg, rgba(34, 197, 94, 1) 0%, rgba(22, 163, 74, 1) 100%);
    border-color: rgba(34, 197, 94, 1);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.5);
}

.btn-free-mode:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.4);
}

.config-menu::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.8), rgba(37, 99, 235, 0.8), rgba(29, 78, 216, 0.8), transparent);
}

/* Campo de busca */
/* Container do campo de busca */
.config-menu>div[style*="position: relative"] {
    position: relative;
    margin-bottom: 16px;
}

.config-menu-search {
    width: 100%;
    padding: 12px 40px 12px 14px;
    margin-bottom: 0;
    background: rgba(15, 23, 42, 0.7);
    border: 2px solid rgba(96, 165, 250, 0.8);
    border-radius: 10px;
    color: #ffffff;
    font-size: 13px;
    transition: all 0.2s ease;
    box-sizing: border-box;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    font-weight: 500;
}

/* Botão X para limpar busca */
.config-search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    height: 24px;
    width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(239, 68, 68, 0.3);
    border: 1px solid rgba(239, 68, 68, 0.5);
    border-radius: 50%;
    cursor: pointer;
    color: #fca5a5;
    font-size: 11px;
    transition: all 0.2s ease;
    z-index: 10;
    line-height: 1;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

.config-search-clear i {
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.config-search-clear:hover {
    background: rgba(239, 68, 68, 0.5);
    border-color: rgba(239, 68, 68, 0.8);
    color: #ffffff;
    transform: translateY(-50%) scale(1.1);
}

.config-menu-search:focus {
    outline: none;
    border-color: rgba(147, 197, 253, 1);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5);
    background: rgba(15, 23, 42, 0.9);
}

.config-menu-search::placeholder {
    color: rgba(203, 213, 225, 0.7);
}

.config-menu h2 {
    color: #ffffff;
    margin-bottom: 12px;
    font-size: 18px;
    text-align: center;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5), 0 0 10px rgba(255, 255, 255, 0.3);
    letter-spacing: 0.5px;
}

/* TÃ³picos expansÃ­veis */
.topic-item {
    margin-bottom: 12px;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(29, 78, 216, 0.95);
    border: 2px solid rgba(96, 165, 250, 0.8);
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.topic-item:hover {
    border-color: rgba(147, 197, 253, 1);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.5);
}

.topic-header {
    padding: 12px 14px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.6) 0%, rgba(29, 78, 216, 0.6) 100%);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
    user-select: none;
    border-bottom: 1px solid rgba(96, 165, 250, 0.4);
}

.topic-header:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.7) 0%, rgba(37, 99, 235, 0.7) 100%);
    border-bottom-color: rgba(147, 197, 253, 0.6);
}

.topic-header.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.85) 0%, rgba(37, 99, 235, 0.85) 100%);
    border-bottom: 2px solid rgba(147, 197, 253, 0.9);
}

.topic-title {
    color: #ffffff;
    font-weight: 700;
    font-size: 14px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.topic-toggle {
    color: #fff;
    font-size: 18px;
    transition: transform 0.3s ease;
}

.topic-header.active .topic-toggle {
    transform: rotate(180deg);
}

.topic-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: rgba(15, 23, 42, 0.4);
}

.topic-content.expanded {
    max-height: 1000px;
    border-top: 1px solid rgba(96, 165, 250, 0.3);
}

/* Quando há um item destacado, permitir overflow para a animação sair */
.topic-content:has(.config-item.tutorial-highlight-error) {
    overflow: visible !important;
}

.config-item {
    padding: 10px 14px;
    padding-left: 28px;
    color: #e2e8f0;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    border-left: 3px solid transparent;
    font-size: 13px;
    position: relative;
    margin-bottom: 2px;
    font-weight: 500;
}

.config-item::before {
    content: '▶';
    position: absolute;
    left: 10px;
    color: rgba(147, 197, 253, 0.8);
    font-size: 11px;
    transition: all 0.2s ease;
    font-weight: bold;
}

.config-item:hover {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.5) 0%, rgba(37, 99, 235, 0.4) 50%, rgba(29, 78, 216, 0.3) 100%);
    border-left-color: rgba(147, 197, 253, 1);
    color: #ffffff;
    transform: translateX(3px);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.config-item:hover::before {
    color: #dbeafe;
    transform: translateX(2px);
}

.config-item.active {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.7) 0%, rgba(37, 99, 235, 0.6) 50%, rgba(29, 78, 216, 0.5) 100%);
    border-left-color: #60a5fa;
    color: #ffffff;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    box-shadow: inset 2px 0 4px rgba(96, 165, 250, 0.3);
}

.config-item.active::before {
    color: #dbeafe;
}

/* AnimaÃ§Ã£o pulsante vermelha para tutorial destacado de erro */
.config-item.tutorial-highlight-error {
    animation: tutorialPulseError 1.2s ease-in-out infinite;
    border-left-color: #ef4444 !important;
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.4) 0%, rgba(220, 38, 38, 0.3) 50%, rgba(185, 28, 28, 0.2) 100%) !important;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.9), 0 0 0 0 rgba(239, 68, 68, 0.6);
    position: relative;
    z-index: 10000 !important;
    /* Permitir que a animação saia além dos limites */
    overflow: visible !important;
    /* Garantir que fique acima de tudo */
    isolation: isolate;
    /* Margem extra durante animação para permitir expansão lateral */
    margin: 5px 10px !important;
}

/* Classe especial para animação - z-index ultra alto apenas durante a animação */
.config-item.tutorial-highlight-active {
    z-index: 10000001 !important;
    /* Acima de tudo, inclusive do modal Como Usar */
    position: relative !important;
    /* Durante animação, garantir que haja espaço para expansão lateral */
    transform-origin: center !important;
}

/* Garantir que containers permitam overflow durante animação */
.topic-item:has(.config-item.tutorial-highlight-active),
.topic-content:has(.config-item.tutorial-highlight-active),
.config-menu:has(.config-item.tutorial-highlight-active) {
    overflow: visible !important;
    z-index: 10000000 !important;
    position: relative !important;
}

/* Permitir overflow lateral durante animação */
.config-menu:has(.config-item.tutorial-highlight-active) {
    overflow-x: visible !important;
    overflow-y: hidden !important;
    /* Manter hidden apenas verticalmente */
}

/* Garantir que o container de tópicos também permita overflow lateral */
.config-menu:has(.config-item.tutorial-highlight-active) #topicsContainer {
    overflow-x: visible !important;
    overflow-y: auto !important;
}

/* Permitir que a animação saia além do tópico e do conteúdo */
.topic-item:has(.config-item.tutorial-highlight-error) {
    overflow: visible !important;
    z-index: 9999 !important;
    position: relative;
}

.topic-content:has(.config-item.tutorial-highlight-error) {
    overflow: visible !important;
    z-index: 9998 !important;
    position: relative;
}

@keyframes tutorialPulseError {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.9), 0 0 0 0 rgba(239, 68, 68, 0.6);
        transform: scale(1);
    }

    50% {
        box-shadow:
            0 0 0 15px rgba(239, 68, 68, 0.3),
            0 0 0 25px rgba(239, 68, 68, 0.2),
            0 0 0 35px rgba(239, 68, 68, 0.1);
        transform: scale(1.05);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0), 0 0 0 0 rgba(239, 68, 68, 0);
        transform: scale(1);
    }
}

.config-item.tutorial-highlight-error::before {
    color: #fca5a5 !important;
    animation: tutorialPulseErrorIcon 1.5s ease-in-out infinite;
}

@keyframes tutorialPulseErrorIcon {

    0%,
    100% {
        transform: translateX(0);
    }

    50% {
        transform: translateX(3px);
    }
}


/* ProteÃ§Ã£o de tela */
.screen-protector {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #000;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 32px;
    overflow: hidden;
}

.screen-protector img {
    width: 67.5%;
    /* Aumentado de 45% para 67.5% (50% maior) */
    height: 67.5%;
    /* Aumentado de 45% para 67.5% (50% maior) */
    object-fit: contain;
    opacity: 0.9;
}

.screen-protector.hidden {
    display: none;
}

/* Modal de confirmaÃ§Ã£o para iniciar tutorial */
.start-tutorial-modal {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.98) 0%, rgba(37, 99, 235, 0.98) 50%, rgba(29, 78, 216, 0.98) 100%);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(59, 130, 246, 0.6), 0 0 0 4px rgba(59, 130, 246, 0.3);
    z-index: 10060;
    min-width: 300px;
    text-align: center;
    border: 3px solid rgba(255, 255, 255, 0.6);
}

.start-tutorial-modal.show {
    display: block;
}

.start-tutorial-modal h3 {
    color: #fff;
    margin-bottom: 15px;
    font-size: 22px;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.start-tutorial-modal p {
    color: #fff;
    margin-bottom: 25px;
    font-size: 15px;
    font-weight: 500;
    opacity: 0.95;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.modal-btn {
    padding: 10px 25px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-btn.yes {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3);
}

.modal-btn.yes:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(59, 130, 246, 0.4);
}

.modal-btn.no {
    background: rgba(100, 116, 139, 0.3);
    color: #cbd5e1;
}

.modal-btn.no:hover {
    background: rgba(100, 116, 139, 0.5);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4), 0 3px 10px rgba(0, 0, 0, 0.3);
}

/* Modal de conclusÃ£o do tutorial */
.tutorial-complete-modal {
    display: none !important;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.98) 0%, rgba(37, 99, 235, 0.98) 50%, rgba(29, 78, 216, 0.98) 100%);
    border-radius: 16px;
    padding: 35px;
    box-shadow: 0 20px 60px rgba(59, 130, 246, 0.6), 0 0 0 4px rgba(59, 130, 246, 0.3);
    z-index: 10000;
    min-width: 288px;
    text-align: center;
    border: 3px solid rgba(255, 255, 255, 0.6);
}

.tutorial-complete-modal.show {
    display: block !important;
}

.tutorial-complete-modal h3 {
    color: #fff;
    margin-bottom: 15px;
    font-size: 24px;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.tutorial-complete-modal p {
    color: #fff;
    margin-bottom: 30px;
    font-size: 16px;
    font-weight: 500;
    opacity: 0.95;
}

.modal-btn.retry {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.95) 0%, rgba(124, 58, 237, 0.95) 100%);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.6), 0 2px 8px rgba(0, 0, 0, 0.3);
}

.modal-btn.retry:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(139, 92, 246, 0.7), 0 3px 10px rgba(0, 0, 0, 0.4);
}

/* Frame do Smartphone */
.phone-container {
    position: relative;
    width: 100%;
    max-width: 324px;
    aspect-ratio: 9 / 19.5;
    display: flex;
    flex-direction: column;
    z-index: 1;
    /* Container base - mais baixo */
}

.phone-frame {
    position: relative;
    width: 100%;
    background: #1a1a1a;
    border-radius: 30px;
    padding: 8px;
    box-shadow:
        0 0 0 3px #2a2a2a,
        0 0 0 6px #1a1a1a,
        0 15px 40px rgba(0, 0, 0, 0.8),
        inset 0 0 0 2px rgba(255, 255, 255, 0.1);
    will-change: auto;
    transform: translateZ(0);
    backface-visibility: hidden;
    /* Garantir que elementos filhos apareÃ§am acima */
    z-index: 0;
    /* Remover isolation no modo editor para permitir que balÃµes apareÃ§am */
}

/* No modo editor, remover isolation do phone-frame */
body.editor-mode .phone-frame,
#configuracoes-guiadas-wrapper body.editor-mode .phone-frame,
body.editor-mode #configuracoes-guiadas-wrapper .phone-frame {
    isolation: auto !important;
    overflow: visible !important;
}

/* Notch */
.phone-notch {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 20px;
    background: #000;
    border-radius: 0 0 15px 15px;
    z-index: 10;
    /* Notch acima da borda */
    will-change: auto;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Barra de progresso no notch */
.notch-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%);
    border-radius: 0 0 20px 20px;
    transition: width 0.3s ease;
    z-index: 31;
}

.notch-progress-text {
    position: relative;
    z-index: 32;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Tela do Smartphone */
.phone-screen {
    background: #000;
    border-radius: 25px;
    overflow: visible;
    /* Mudado para visible para permitir botÃµes X dos balÃµes ficarem visÃ­veis */
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
    box-sizing: border-box;
    will-change: auto;
    transform: translateZ(0);
    backface-visibility: hidden;
    /* A tela estÃ¡ dentro do frame isolado, entÃ£o precisa de z-index para aparecer acima */
    z-index: 1 !important;
    position: relative !important;
}

/* Garantir que a imagem dentro do phone-screen tenha scroll quando necessÃ¡rio */
.phone-screen .screen-content {
    overflow-y: auto;
    /* Permitir scroll vertical quando a imagem for maior que a tela */
    overflow-x: hidden;
    border-radius: 25px;
    -webkit-overflow-scrolling: touch;
    /* Scroll suave no iOS */
    /* Permitir que animaÃ§Ãµes sejam visÃ­veis, mas nÃ£o afetem o scroll */
    /* Usar contain apenas para layout, nÃ£o para paint, para permitir animaÃ§Ãµes visÃ­veis */
    contain: layout;
    /* Isolar apenas layout, permitir que animaÃ§Ãµes sejam visÃ­veis */
}

/* Quando a imagem nÃ£o precisa de scroll, manter sem scrollbar visÃ­vel */
.phone-screen .screen-content:not(.scrollable) {
    overflow: hidden;
}

/* No modo editor, permitir overflow para balÃµes e Ã¡reas */
body.editor-mode .phone-screen,
#configuracoes-guiadas-wrapper body.editor-mode .phone-screen,
body.editor-mode #configuracoes-guiadas-wrapper .phone-screen {
    overflow: visible !important;
    position: relative !important;
    z-index: 10 !important;
    /* Garantir que a tela apareÃ§a acima da borda */
}

/* Garantir que elementos dentro do phone-screen apareÃ§am no modo editor */
body.editor-mode .phone-screen .editable-balloon,
#configuracoes-guiadas-wrapper body.editor-mode .phone-screen .editable-balloon,
body.editor-mode .editable-balloon,
#configuracoes-guiadas-wrapper body.editor-mode .editable-balloon,
.editable-balloon {
    position: absolute !important;
    z-index: 9999999 !important;
    /* BalÃµes editÃ¡veis - acima de tudo (aumentado para garantir) */
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    /* Garantir que apareÃ§a acima de qualquer elemento */
    transform: translate(-50%, -50%) !important;
    /* ForÃ§ar que apareÃ§a mesmo dentro de containers com overflow */
    will-change: transform !important;
}

body.editor-mode .phone-screen .clickable-area,
#configuracoes-guiadas-wrapper body.editor-mode .phone-screen .clickable-area {
    position: absolute !important;
    z-index: 500 !important;
    /* Ãreas clicÃ¡veis - acima da imagem */
    background: rgba(59, 130, 246, 0.2) !important;
    border: 2px dashed rgba(59, 130, 246, 0.6) !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* No modo editor, garantir que o body tambÃ©m permita overflow */
body.editor-mode,
body.editor-mode #configuracoes-guiadas-wrapper {
    overflow: visible !important;
}

/* Container para imagens com scroll */
.screen-content {
    position: relative;
    width: 100%;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    background: #000;
    z-index: 1;
    /* No modo editor, permitir que elementos apareÃ§am acima */
    pointer-events: none;
    /* Permitir cliques passarem para elementos filhos */
}

body.editor-mode .screen-content {
    pointer-events: auto;
    /* Restaurar cliques no modo editor */
    overflow: visible !important;
    /* Permitir que Ã¡reas clicÃ¡veis apareÃ§am */
}

.screen-content.scrollable {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    max-height: 100%;
    padding-right: 0;
}

.screen-content.scrollable .screen-image {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    object-fit: contain !important;
    /* Manter proporÃ§Ã£o (igual ao mapear-preview.html e editor-roteiro.css) */
    margin: 0;
    padding: 0;
}

/* Scrollbar customizada */
.screen-content.scrollable::-webkit-scrollbar {
    width: 3px;
}

.screen-content.scrollable::-webkit-scrollbar-track {
    background: transparent;
}

.screen-content.scrollable::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.screen-content.scrollable::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.screen-content.scrollable {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.screen-content:not(.scrollable) {
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 0;
}

.screen-image {
    position: relative;
    width: 100%;
    height: auto;
    display: block;
    background: #000;
    transition: opacity 0.2s ease-in-out;
    will-change: opacity;
    z-index: 1;
    /* Imagem de fundo - mais baixo */
}

/* Balões de diálogo */
.dialog-balloon {
    position: absolute;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.95) 0%, rgba(37, 99, 235, 0.95) 100%);
    color: #fff;
    padding: 14px 18px;
    border-radius: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow:
        0 8px 32px rgba(59, 130, 246, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    max-width: 280px;
    min-width: 180px;
    font-size: 14px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 500;
    line-height: 1.4;
    text-align: center;
    z-index: 1000;
    pointer-events: none;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.3s ease;
}

/* Botões dos balões */
.dialog-balloon button {
    transition: all 0.2s ease;
}

.dialog-balloon button:hover {
    transform: translateY(-1px) scale(1.05);
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.6), 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.dialog-balloon button:active {
    transform: translateY(0) scale(0.95);
}

/* Animação de pulso para botões */
@keyframes balloonPulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(255, 255, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

.guide-pulse-button {
    animation: balloonPulse 2s infinite;
}

/* Modo editor - cursor especial (mantido para compatibilidade) */

#configuracoes-guiadas-wrapper body.editor-mode .screen-image,
body.editor-mode .screen-image {
    cursor: crosshair;
}

/* Menu inferior fixo */
.fixed-bottom-menu {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 20;
    pointer-events: none;
    background: transparent;
    transform: translateY(0);
}

.fixed-bottom-menu img {
    width: 100%;
    height: auto;
    display: block;
    pointer-events: all;
    vertical-align: bottom;
}

/* Ãreas clicÃ¡veis do menu inferior ficam na frente */
.clickable-area[data-from-menu="true"] {
    z-index: 25 !important;
}

/* Ãreas clicÃ¡veis - ocultas por padrÃ£o */
.clickable-area {
    position: absolute;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 100;
    /* Ãreas clicÃ¡veis - acima da imagem mas abaixo dos balÃµes */
    transition: all 0.2s ease;
    pointer-events: auto;
}

.clickable-area:hover {
    background: transparent;
}

/* Ãreas clicÃ¡veis visÃ­veis apenas no modo editor */
body.editor-mode .clickable-area,
#configuracoes-guiadas-wrapper body.editor-mode .clickable-area,
body.editor-mode #configuracoes-guiadas-wrapper .clickable-area,
body.editor-mode .phone-screen .clickable-area,
#configuracoes-guiadas-wrapper body.editor-mode .phone-screen .clickable-area {
    background: rgba(59, 130, 246, 0.2) !important;
    border: 2px dashed rgba(59, 130, 246, 0.6) !important;
    cursor: crosshair !important;
    z-index: 500 !important;
    /* VisÃ­vel no modo editor - acima da imagem */
    pointer-events: auto !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

body.editor-mode .clickable-area:hover,
#configuracoes-guiadas-wrapper body.editor-mode .clickable-area:hover,
body.editor-mode #configuracoes-guiadas-wrapper .clickable-area:hover {
    background: rgba(59, 130, 246, 0.3) !important;
    border-color: rgba(59, 130, 246, 0.9) !important;
}

/* AnimaÃ§Ã£o de pulso para botÃµes (X de balÃµes) */
@keyframes guidePulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }
}

.guide-pulse-button {
    animation: guidePulse 1.2s ease-in-out infinite !important;
}

/* AnimaÃ§Ã£o de pulso para Ã¡reas ativas no tutorial - OTIMIZADA */
.clickable-area.tutorial-active {
    position: relative;
    will-change: transform;
    transform: translateZ(0);
    /* GPU acceleration */
    /* Permitir que a animaÃ§Ã£o seja visÃ­vel alÃ©m da Ã¡rea, mas sem afetar o layout */
    overflow: visible;
    /* NÃ£o usar contain: paint para permitir que a animaÃ§Ã£o seja visÃ­vel */
    contain: layout style;
    /* Isolar apenas layout e style, nÃ£o paint */
}

.clickable-area.tutorial-active::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translateZ(0);
    /* GPU acceleration */
    width: var(--animation-size, 70px);
    height: var(--animation-size, 70px);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.9) 0%, rgba(37, 99, 235, 0.7) 50%, rgba(29, 78, 216, 0.4) 100%);
    animation: tutorialPulseCenter 1.5s ease-in-out infinite;
    pointer-events: none;
    z-index: 1000;
    /* Colocar acima da imagem mas abaixo de outros elementos */
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.6), 0 0 40px rgba(37, 99, 235, 0.4);
    will-change: transform, opacity;
    /* OtimizaÃ§Ã£o de animaÃ§Ã£o */
    backface-visibility: hidden;
    /* Prevenir flickering */
    /* Permitir que a animaÃ§Ã£o seja visÃ­vel alÃ©m dos limites da Ã¡rea */
    /* Usar clip-path: none para garantir que nÃ£o seja cortada */
    clip-path: none;
}

/* Classe para desabilitar animaÃ§Ã£o quando balÃ£o estÃ¡ aberto */
.clickable-area.animation-disabled::before {
    display: none !important;
    content: none !important;
    animation: none !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
}

@keyframes tutorialPulseCenter {

    0%,
    100% {
        transform: translate(-50%, -50%) translateZ(0) scale(1);
        opacity: 0.9;
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.6), 0 0 40px rgba(37, 99, 235, 0.4);
    }

    50% {
        transform: translate(-50%, -50%) translateZ(0) scale(1.2);
        /* Reduzido de 1.3 para 1.2 para evitar overflow */
        opacity: 0.6;
        box-shadow: 0 0 25px rgba(59, 130, 246, 0.7), 0 0 50px rgba(37, 99, 235, 0.5);
        /* Reduzido para evitar overflow */
    }
}

/* AnimaÃ§Ã£o sutil para Ã¡reas info: no modo livre (exclusiva do modo livre) - OTIMIZADA */
.clickable-area.info-area-highlight.guide-highlight {
    will-change: transform;
    transform: translateZ(0);
    /* GPU acceleration */
}

.clickable-area.info-area-highlight.guide-highlight::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translateZ(0);
    /* GPU acceleration */
    width: var(--animation-size, 43px);
    height: var(--animation-size, 43px);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.7) 0%, rgba(5, 150, 105, 0.5) 50%, rgba(4, 120, 87, 0.3) 100%);
    animation: infoAreaPulse 2s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.5), 0 0 30px rgba(5, 150, 105, 0.3);
    will-change: transform, opacity;
    /* OtimizaÃ§Ã£o de animaÃ§Ã£o */
    backface-visibility: hidden;
    /* Prevenir flickering */
}

@keyframes infoAreaPulse {

    0%,
    100% {
        transform: translate(-50%, -50%) translateZ(0) scale(1);
        opacity: 0.7;
        box-shadow: 0 0 15px rgba(16, 185, 129, 0.5), 0 0 30px rgba(5, 150, 105, 0.3);
    }

    50% {
        transform: translate(-50%, -50%) translateZ(0) scale(1.2);
        opacity: 0.5;
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.6), 0 0 40px rgba(5, 150, 105, 0.4);
    }
}

/* Modal de informaÃ§Ãµes */
.info-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.info-modal.show {
    display: flex;
}

.info-modal-content {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.98) 0%, rgba(15, 23, 42, 0.98) 100%);
    border-radius: 16px;
    padding: 25px;
    max-width: 380px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(59, 130, 246, 0.4);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.info-modal-content h3 {
    color: #3b82f6;
    font-size: 18px;
    margin-bottom: 12px;
    font-weight: 700;
}

.info-modal-content p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.info-modal-close {
    padding: 10px 25px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.info-modal-close:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

/* Media queries para mobile */
@media (max-width: 768px) {
    .configuracoes-guiadas-container {
        flex-direction: column;
        gap: 15px;
    }

    .ui-fake-container {
        width: 100%;
        max-width: 100%;
        position: relative;
    }

    .phone-container {
        position: relative;
    }

    .phone-screen {
        position: relative;
    }

    .config-menu {
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        max-height: 100% !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        transform: translateY(20px) !important;
        opacity: 0;
        display: none;
        z-index: 100005 !important;
        transition: opacity 0.3s ease, transform 0.3s ease;
        margin: 0;
        border-radius: 25px !important;
        overflow: hidden;
    }

    .config-menu.menu-aberto {
        display: flex;
        opacity: 1;
        transform: translateY(0) !important;
    }


    .phone-container {
        width: 100%;
        max-width: 360px;
        margin: 0 auto;
    }

    /* Balões: mesma fonte, padding e tamanho do desktop (fonte 15px, padding 14px 18px) */
    .phone-screen .dialog-balloon,
    .phone-screen .preview-balloon {
        font-size: 15px !important;
        font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
        padding: 14px 18px !important;
        line-height: 1.4 !important;
        /* zoom para igualar proporção visual ao desktop (phone 324px desktop vs ~360px mobile) */
        zoom: 1.1;
    }
    .phone-screen .dialog-balloon > div,
    .phone-screen .preview-balloon > div {
        font-size: inherit !important;
    }
}

/* Modal Como Usar - Melhorias */
#comoUsarModal {
    z-index: 10000000;
    /* Muito maior que todos os outros elementos */
}

#comoUsarModal .info-modal-content {
    max-width: 480px;
    max-height: 90vh;
    border: 2px solid rgba(245, 158, 11, 0.4);
}

#comoUsarModal .info-modal-content h3 {
    color: #f59e0b;
    font-size: 20px;
    margin-bottom: 15px;
}

#comoUsarModal .modal-body-scroll {
    margin: 0;
    padding: 0;
    max-height: calc(90vh - 160px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(245, 158, 11, 0.6) rgba(30, 41, 59, 0.3);
}

#comoUsarModal .modal-body-scroll::-webkit-scrollbar {
    width: 6px;
}

#comoUsarModal .modal-body-scroll::-webkit-scrollbar-track {
    background: rgba(30, 41, 59, 0.3);
    border-radius: 3px;
    margin: 2px;
}

#comoUsarModal .modal-body-scroll::-webkit-scrollbar-thumb {
    background: rgba(245, 158, 11, 0.6);
    border-radius: 3px;
    border: none;
}

#comoUsarModal .modal-body-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(245, 158, 11, 0.8);
}

#comoUsarModal .modal-footer {
    margin-top: 20px;
    padding-top: 20px;
    padding-bottom: 10px;
    border-top: 1px solid rgba(245, 158, 11, 0.3);
    flex-shrink: 0;
}

#comoUsarModal .btn-primary {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.9) 0%, rgba(217, 119, 6, 0.9) 100%);
    border: 2px solid rgba(245, 158, 11, 0.8);
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

#comoUsarModal .btn-primary:hover {
    background: linear-gradient(135deg, rgba(245, 158, 11, 1) 0%, rgba(217, 119, 6, 1) 100%);
    border-color: rgba(245, 158, 11, 1);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
}

#comoUsarModal .btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}