/* Reset básico e configurações globais */
body {
    margin: 0;
    padding: 20px;
    background-color: transparent;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    box-sizing: border-box;
    overflow-x: hidden;
    font-family: var(--player-font-family, 'Roboto', sans-serif);
}

/* Preloader Styles */
#preloader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--loader-bg-color, rgba(44, 62, 80, 0.95)); /* Cor de fundo do loader */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.3s ease-out;
}

.loader {
    border: 8px solid var(--loader-secondary-color, #f3f3f3);
    border-top: 8px solid var(--loader-primary-color, #e74c3c);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

#preloader-text {
     color: var(--loader-text-color, #ecf0f1);
}


@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Tutorial Container */
#tutorial-container {
    background-color: transparent !important;
    padding: 0;
    border-radius: 12px;
    width: 100%;
    max-width: 900px;
    text-align: center;
    margin-top: 20px;
    margin-bottom: 20px;
    color: var(--player-text-color, #2c3e50);
    font-family: var(--player-font-family, 'Roboto', sans-serif);
}

#tutorial-title {
    margin-bottom: 25px;
    font-size: 1.8em;
    font-weight: 700;
    color: var(--player-text-color, #2c3e50);
}

/* Slide Viewer e Image Container */
#slide-viewer {
    margin-bottom: 20px;
    position: relative;
    background-color: #DDD;
    border-radius: 8px;
    overflow: hidden; /* MUITO IMPORTANTE para conter tooltips absolutos */
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

#image-container {
    position: relative;
    width: 100%;
    height: 0;
    overflow: hidden; /* Garante que hotspots não saiam se a imagem for menor */
    background-color: #EEE;
}

#current-slide-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: transform 0.7s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform-origin: center center;
    z-index: 1;
    -webkit-user-drag: none;
    user-select: none;
    -moz-user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
}

/* Hotspots Layer */
#hotspots-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Apenas para o layer, hotspots individuais terão pointer-events: all */
    z-index: 10;
    transition: transform 0.7s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform-origin: center center;
    /* overflow: hidden; // Removido daqui, slide-viewer deve controlar */
}

.hotspot {
    position: absolute;
    box-sizing: border-box;
    pointer-events: all;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: transparent !important;
}

.hotspot:hover:not(.blur-area) {
    transform: scale(1.15);
    z-index: 11; /* Hotspot em hover acima dos outros e do tooltip normal */
}

.hotspot.square {
    border-radius: 4px;
}

.hotspot.point {
    border-radius: 50%;
}

.hotspot.blur-area {
    background-color: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: none !important;
    border-radius: 4px;
    cursor: help;
}


/* Animação de Pulsar para Hotspots */
.pulsate::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: calc(100% + 10px);
    height: calc(100% + 10px);
    transform: translate(-50%, -50%);
    border-radius: inherit;
    box-shadow: 0 0 0 0 var(--pulse-color-start);
    animation: pulse-animation 2s infinite ease-out;
    pointer-events: none;
    z-index: -1;
}

@keyframes pulse-animation {
    0% {
        transform: translate(-50%, -50%) scale(0.9);
        box-shadow: 0 0 0 0px var(--pulse-color-start);
        opacity: 1;
    }
    70% {
        box-shadow: 0 0 0 15px var(--pulse-color-end);
        opacity: 0;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0;
    }
}


/* Caption */
#caption-container {
    margin-top: 15px;
    padding: 12px 15px;
    border-radius: 6px;
    min-height: 1em;
    background-color: var(--caption-bg-color, rgba(52, 73, 94, 0.8));
    color: var(--caption-text-color, #ecf0f1);
    transition: opacity 0.3s ease-out, max-height 0.3s ease-out;
    overflow: hidden;
}

#caption-container.hidden {
    opacity: 0;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
    border: none;
}


#current-slide-caption {
    font-size: 0.95em;
    line-height: 1.5;
    margin:0;
}

/* Navigation Controls */
#navigation-controls {
    margin-top: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#navigation-controls button {
    padding: 12px 25px;
    border: none;
    color: var(--nav-btn-text-color, white);
    background-color: var(--nav-btn-bg-color, #e74c3c);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 700;
    transition: background-color 0.2s ease, transform 0.1s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

#navigation-controls button:hover:not(:disabled) {
    background-color: var(--nav-btn-hover-bg-color, #c0392b);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}
#navigation-controls button:active:not(:disabled) {
    transform: translateY(0px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

#navigation-controls button:disabled {
    background-color: #95a5a6 !important;
    cursor: not-allowed;
    opacity: 0.7;
}

#slide-counter {
    font-size: 0.9em;
    font-weight: 500;
    color: var(--counter-text-color, #2c3e50);
}

/* Tooltip */
.tooltip {
    position: absolute; /* Alterado de fixed para absolute */
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 0.9em;
    z-index: 20; /* Acima dos hotspots normais, mas abaixo de um hotspot em hover se necessário */
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    max-width: 280px;
    line-height: 1.4;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease;
    /* display: none; // Controlado por visibility e opacity */
}


#tooltip-content {
    margin-bottom: 8px;
}
#tooltip-content:empty {
    margin-bottom: 0;
}

#tooltip-actions button {
    color: var(--tooltip-action-btn-text-color, white);
    background-color: var(--tooltip-action-btn-bg-color, #3498db);
    border: none;
    padding: 6px 10px;
    margin-top: 5px;
    margin-right: 5px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    transition: background-color 0.2s ease;
}

#tooltip-actions button:last-child {
    margin-right: 0;
}

/* Media Queries para Responsividade */
@media (max-width: 768px) {
    body { padding: 10px; }
    #tutorial-container { width: 100%; margin-top:10px; margin-bottom:10px;}
    #tutorial-title { font-size: 1.5em; margin-bottom: 15px; }
    #navigation-controls button { padding: 10px 15px; font-size: 0.8em; }
    #slide-counter { font-size: 0.8em; }
    .tooltip { font-size: 0.85em; padding: 8px 12px; }
}

@media (max-width: 480px) {
    #tutorial-title { font-size: 1.3em; }
    #navigation-controls { flex-direction: column; }
    #navigation-controls button { width: 100%; margin-bottom: 10px; }
    #navigation-controls span { margin-bottom: 10px; order: -1; }
    #caption-container { font-size: 0.9em; padding: 10px; }
}
