/* 
 * interface-rica.css
 * Estilos para a interface completa de colorir (replicando a page-colorir-online.php)
 */

:root {
    --primary-color: #0a6093;
    --accent-color: #c1127b;
    --bg-color: #e9dfc4;
    --toolbar-bg: rgba(255, 255, 255, 0.95);
}

/* Background rico replicado da original */
.page-template-page-artigo-colorir,
.bloco-desenho-colorir-wrapper {
    background: rgb(233, 223, 196);
    background: linear-gradient(to right,
            rgba(233, 223, 196, 1) 0%,
            rgba(233, 223, 196, 1) 1%,
            rgba(237, 227, 200, 1) 2%,
            rgba(237, 227, 200, 1) 24%,
            rgba(235, 221, 195, 1) 25%,
            rgba(233, 223, 196, 1) 48%,
            rgba(235, 221, 195, 1) 49%,
            rgba(230, 216, 189, 1) 52%,
            rgba(230, 216, 189, 1) 53%,
            rgba(233, 219, 192, 1) 54%,
            rgba(230, 216, 189, 1) 55%,
            rgba(230, 216, 189, 1) 56%,
            rgba(233, 219, 192, 1) 57%,
            rgba(230, 216, 189, 1) 58%,
            rgba(230, 216, 189, 1) 73%,
            rgba(233, 219, 192, 1) 74%,
            rgba(233, 219, 192, 1) 98%,
            rgba(235, 221, 195, 1) 100%);
    background-size: 120px;
    background-repeat: repeat;
    border-radius: 10px;
    box-shadow: inset 0 0 5px #cfac6a;
}

/* Container Principal */
.bloco-desenho-colorir {
    padding: 20px;
    margin-bottom: 30px;
    position: relative;
    max-width: 950px;
    margin-left: auto;
    margin-right: auto;
}

/* Canvas Container */
.canvas-container {
    position: relative;
    width: 100%;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    cursor: crosshair;
    touch-action: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.coloring-engine-wrapper {
    background: #fff !important;
}

#paintCanvas,
#imageCanvas {
    display: block;
    width: 100%;
    height: auto;
}

/* Toolbar Superior */
.header-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 15px;
}

.action-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    background: white;
    padding: 10px 15px;
    border-radius: 12px;
}

.action-buttons button {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
    transition: all 0.2s;
    min-width: 44px;
    min-height: 44px;
    gap: 5px;
}

.action-buttons .btn-toggle-draw {
    background: #0a6093;
    color: #fff;
    border: none;
}

.action-buttons .btn-toggle-draw svg,
.btn-download-pdf svg {
    color: #fff !important;
}

.action-buttons button:hover {
    background: #f0f0f0;
}

.action-buttons button svg {
    width: 24px;
    height: 24px;
    color: #636363;
}

/* Botão Imprimir Destacado */
.btn-download-pdf {
    background: linear-gradient(270deg, rgb(44, 161, 112), #2d7d5c) !important;
    color: white !important;
    border: none !important;
    padding: 10px 20px !important;
    min-width: 150px !important;
}

/* Modo Desenho vs Preenchimento */
.toggle-mode {
    font-weight: bold;
    font-size: 0.8rem;
    gap: 5px;
    padding: 8px 15px !important;
    background: #0a6093 !important;
    color: #fff !important;
}

.toggle-mode.active-draw-mode {
    background: #1082b3 !important;
    animation: piscar 2s infinite;
}

@keyframes piscar {

    0%,
    20%,
    40%,
    100% {
        background: #1082b3;
    }

    10%,
    30% {
        background: #10b37d;
    }
}

/* Barra de Progresso */
#spacesCounterContainer {
    width: 100%;
    max-width: 950px;
    margin: 0 auto 15px auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 15px;
    background: #fbf4de;
    border-radius: 8px;
}

.labelSCC {
    font-weight: 500;
    text-transform: uppercase;
    font-size: 1rem;
}

.spacesCountValue {
    font-weight: 600;
    line-height: normal;
    font-size: 1.5rem;
}

.progressBarWrapper {
    flex-grow: 1;
    height: 18px;
    background: #edd0ba;
    border-radius: 5px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 5px rgba(0, 0, 0, 0.05);
}

.progressBar {
    height: 100%;
    background: #5de662;
    width: 0%;
    transition: width 0.3s, background-color 0.3s;
}

.progressText {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: bold;
    color: #000;
    z-index: 2;
}

.difficultyLabel {
    font-size: 0.75rem;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 4px;
    color: #fff;
    text-transform: uppercase;
}

.difficultyLabel.easy {
    background: #22a127;
}

.difficultyLabel.medium {
    background: #ad8409;
}

.difficultyLabel.hard {
    background: #b63329;
}

/* Barra de Cores Flutuante (Singleton) */
#floating-color-bar {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%) translateY(150px);
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 2px solid #9d7c4a78;
    border-radius: 20px;
    padding: 5px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s;
    opacity: 0;
    min-width: 280px;
    height: 75px;
}

#floating-color-bar.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.floating-undo {
    line-height: 1;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 5px;
}

.floating-undo svg {
    color: #636363;
}

.pens-list {
    display: flex;
    align-items: flex-end;
    gap: 2px;
}

.pen {
    width: 35px;
    height: 90px;
    cursor: pointer;
    transition: transform 0.2s, height 0.2s;
    position: relative;
}

.pen.selected {
    height: 110px;
    transform: translateY(-5px);
}

.pen svg {
    width: 100%;
    height: 100%;
}

.effect-icon {
    position: absolute;
    top: 25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
    pointer-events: none;
    text-shadow: 0 0 3px white;
}

/* Botão Mais Cores com Gradiente */
.btn-more-colors {
    background: linear-gradient(270deg, #f3267e, #9138c7, #139ae7, #1aad34, #ff0303);
    background-size: 300% 300%;
    animation: animacaoGradiente 3s ease infinite;
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    padding: 5px 12px;
    cursor: pointer;
    text-transform: uppercase;
    line-height: 1.1;
}

@keyframes animacaoGradiente {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Zoom Controls */
.zoomControls {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10;
}

.zoomControls button,
.zoomControls button.btn-drag {
    background: rgb(231 221 201);
    color: white;
    filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.4));
    border: 5px solid #fff;
    padding: 10px;
    border-radius: 50%;
    width: 54px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.zoomControls button svg {
    width: 30px;
    height: 30px;
}

.zoomControls button.btn-drag svg {
    width: 35px;
    height: 35px;

}

.zoomControls button.btn-drag.active {
    border-color: #1a73e8;
    color: #fff;
}

.zoomControls button.btn-drag svg {
    width: 24px;
    height: 24px;
}

/* Modais e Paleta Expandida (Singleton) */
.colorir-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}

.modal-content {
    background: #fff;
    border-radius: 15px;
    padding: 30px;
    max-width: 400px;
    max-height: 90vh;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
    overflow-x: hidden;
}

.expandedPalette {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-top: 20px;
    padding-bottom: 10px;
}

.color-option {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.color-option:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.color-option.selected {
    border: 3px solid var(--primary-color);
    transform: scale(1.1);
}

/* Download Modal */
.download-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 20000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.download-modal.show {
    display: flex;
}

.modal-title-download {
    font-size: 1.4rem;
    font-weight: bold;
    color: #0a6093;
    margin-bottom: 20px;
}

.timer-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 5px solid #0a6093;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    color: #0a6093;
    margin: 0 auto 20px;
}

.wait-text {
    color: #555;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.ad-label {
    font-size: 0.7rem;
    color: #999;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.ad-container-modal {
    width: 300px;
    height: 250px;
    background: #f0f0f0;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    overflow: hidden;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsividade */
@media (max-width: 768px) {
    .bloco-desenho-colorir {
        margin-bottom: 0 !important;
    }

    .bloco-desenho-colorir-wrapper {
        padding: 10px 0;
        width: 100vw;
        position: relative;
        left: 50%;
        right: 50%;
        margin-left: -50vw;
        margin-right: -50vw;
        border-radius: 0;
        margin-bottom: 30px;
    }

    .canvas-container {
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .header-container,
    #spacesCounterContainer {
        width: 95%;
        margin-left: auto;
        margin-right: auto;
    }

    .header-container {
        flex-direction: column;
        gap: 5px;
    }

    .action-buttons {
        width: 100%;
        justify-content: center;
    }

    .zoomControls {
        display: flex;
        /* Mostrar no mobile */
    }

    #floating-color-bar {
        min-width: auto;
    }

    .pen {
        width: 30px;
        height: 75px;
    }

    .pen.selected {
        height: 90px;
    }
}

/* --- TABS DO MODAL DE CORES --- */
.color-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
    border-bottom: 2px solid #eee;
    padding-bottom: 5px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.color-tab {
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.color-tab.active {
    background: #ffdc43;
    color: #361b58;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.gradient-option {
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.1s;
    height: 100%;
    aspect-ratio: 1/1;
}

/* --- BOTÃO "E NA CAMISA?!" – PINTE E VISTA (toolbar) --- */
/* Estilos base vêm inline no HTML (ffc609 amarelo, itálico, preto – idêntico à page-colorir-online.php) */
.btn-camisa-toolbar {
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease !important;
}

.btn-camisa-toolbar:hover {
    transform: scale(1.06) translateY(-1px) !important;
    box-shadow: 0 6px 16px rgba(255, 198, 9, 0.6) !important;
    filter: brightness(1.08) !important;
}

.btn-camisa-toolbar:active {
    transform: scale(0.97) !important;
}

button#closeMockupModal svg {
    min-width: 30px;
}