
/*
=========================================================
MUSICALWORLD — ESTILOS DA CÂMERA DE PUBLICAÇÃO ARTÍSTICA

Arquivo:
css/publicacao-artistica-camera.css

RESPONSABILIDADES:
- Estilizar a interface de câmera em celulares e computadores.
- Organizar a prévia da câmera, os modos Foto e Vídeo,
  os controles e as miniaturas.
- Adaptar o layout para diferentes tamanhos de tela.
- Respeitar a área segura inferior de celulares.
- Manter a identidade visual da interface independente
  dos estilos da página atual.
=========================================================
*/

/* =======================================================
   BLOQUEIO DA ROLAGEM DA PÁGINA AO ABRIR A CÂMERA
======================================================= */

body.mw-camera-aberta {
    overflow: hidden;
}

/* =======================================================
   CONFIGURAÇÃO GERAL
======================================================= */

.mw-camera-overlay,
.mw-camera-overlay * {
    box-sizing: border-box;
}

.mw-camera-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483000;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    background: #10131b;
    color: #ffffff;

    font-family: "Manrope", sans-serif;
}

/* =======================================================
   PAINEL PRINCIPAL
======================================================= */

.mw-camera-painel {
    width: 100%;
    height: 100%;
    max-width: 760px;

    display: flex;
    flex-direction: column;

    min-height: 0;
    overflow: hidden;

    background: #10131b;
}

/* =======================================================
   CABEÇALHO
======================================================= */

.mw-camera-topo {
    min-height: 62px;

    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;

    gap: 12px;
    padding: 8px 16px;

    flex: 0 0 auto;
}

.mw-camera-topo strong {
    text-align: center;

    font-size: 15px;
    font-weight: 700;
}

/* =======================================================
   BOTÕES DE ÍCONE
======================================================= */

.mw-camera-icone {
    width: 42px;
    height: 42px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 0;
    border-radius: 50%;

    color: #ffffff;
    background: #292d37;

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.mw-camera-icone:hover {
    background: #3a3f4c;
}

.mw-camera-icone:active {
    transform: scale(0.94);
}

.mw-camera-icone:focus-visible,
.mw-camera-modo:focus-visible,
.mw-camera-galeria:focus-visible,
.mw-camera-continuar:focus-visible,
.mw-camera-capturar:focus-visible,
.mw-camera-miniatura:focus-visible {
    outline: 2px solid #9b8aff;
    outline-offset: 3px;
}

.mw-camera-icone svg,
.mw-camera-modo svg,
.mw-camera-galeria svg,
.mw-camera-continuar svg {
    width: 21px;
    height: 21px;

    display: block;

    flex-shrink: 0;
}

/* =======================================================
   VISOR DA CÂMERA
======================================================= */

.mw-camera-visor {
    position: relative;

    flex: 1 1 auto;

    min-height: 180px;
    overflow: hidden;

    background: #050608;
}

.mw-camera-video {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;

    object-fit: cover;

    background: #050608;
}

/* =======================================================
   MENSAGEM DE CÂMERA INDISPONÍVEL
======================================================= */

.mw-camera-sem-acesso {
    position: absolute;
    inset: 0;
    z-index: 1;

    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;

    gap: 10px;
    padding: 28px;

    text-align: center;

    color: #e7e9ef;
    background: #171a22;

    font-size: 13px;
    line-height: 1.55;
}

.mw-camera-sem-acesso.visivel {
    display: flex;
}

.mw-camera-sem-acesso-titulo {
    color: #ffffff;

    font-size: 17px;
    font-weight: 800;
}

/* =======================================================
   CRONÔMETRO DA GRAVAÇÃO
======================================================= */

.mw-camera-cronometro {
    position: absolute;
    top: 16px;
    left: 50%;

    transform: translateX(-50%);

    padding: 7px 12px;

    border-radius: 999px;

    color: #ffffff;
    background: #d92d20;

    font-size: 13px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

/* =======================================================
   MENSAGEM DE STATUS
======================================================= */

.mw-camera-status {
    min-height: 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 7px 16px;

    color: #d1d5df;
    background: #10131b;

    font-size: 12px;
    line-height: 1.4;
    text-align: center;

    flex: 0 0 auto;
}

/* =======================================================
   SELEÇÃO ENTRE FOTO E VÍDEO
======================================================= */

.mw-camera-modos {
    display: flex;
    justify-content: center;

    gap: 26px;
    padding: 6px 16px 12px;

    background: #10131b;

    flex: 0 0 auto;
}

.mw-camera-modo {
    display: inline-flex;
    align-items: center;

    gap: 7px;
    padding: 9px 13px;

    border: 1px solid transparent;
    border-radius: 999px;

    color: #c6cad4;
    background: transparent;

    font: inherit;
    font-size: 13px;
    font-weight: 700;

    cursor: pointer;

    transition:
        color 0.2s ease,
        background 0.2s ease,
        border-color 0.2s ease;
}

.mw-camera-modo:hover {
    color: #ffffff;
    background: #252936;
}

.mw-camera-modo.ativo {
    color: #ffffff;

    border-color: #6d4aff;
    background: #2b2250;
}

/* =======================================================
   CONTROLES PRINCIPAIS
======================================================= */

.mw-camera-controles {
    min-height: 82px;

    display: grid;
    grid-template-columns: 1fr 88px 1fr;
    align-items: center;

    gap: 12px;
    padding: 4px 22px 12px;

    background: #10131b;

    flex: 0 0 auto;
}

/* =======================================================
   BOTÃO GALERIA
======================================================= */

.mw-camera-galeria {
    min-width: 0;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 7px;
    padding: 10px 8px;

    border: 0;

    color: #e7e9ef;
    background: transparent;

    font: inherit;
    font-size: 12px;
    font-weight: 700;

    cursor: pointer;

    transition: color 0.2s ease;
}

.mw-camera-galeria:hover {
    color: #b8aaff;
}

/* =======================================================
   BOTÃO USAR / CONTINUAR
======================================================= */

.mw-camera-continuar {
    justify-self: end;
    min-width: 0;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 7px;
    padding: 10px 8px;

    border: 0;

    color: #c8bfff;
    background: transparent;

    font: inherit;
    font-size: 12px;
    font-weight: 700;

    cursor: pointer;

    transition:
        color 0.2s ease,
        opacity 0.2s ease;
}

.mw-camera-continuar:hover:not(:disabled) {
    color: #ffffff;
}

.mw-camera-continuar:disabled {
    opacity: 0.38;
    cursor: not-allowed;
}

/* =======================================================
   BOTÃO CIRCULAR DE FOTO / GRAVAÇÃO
======================================================= */

.mw-camera-capturar {
    width: 72px;
    height: 72px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    justify-self: center;

    padding: 0;

    border: 4px solid #ffffff;
    border-radius: 50%;

    background: transparent;

    cursor: pointer;

    transition:
        transform 0.15s ease,
        border-color 0.15s ease;
}

.mw-camera-capturar:hover {
    transform: scale(1.04);
}

.mw-camera-capturar:active {
    transform: scale(0.95);
}

.mw-camera-capturar-miolo {
    width: 54px;
    height: 54px;

    border-radius: 50%;

    background: #ffffff;

    transition:
        border-radius 0.15s ease,
        transform 0.15s ease,
        background 0.15s ease;
}

/* Aparência do botão enquanto grava. */

.mw-camera-capturar.gravando
.mw-camera-capturar-miolo {
    width: 27px;
    height: 27px;

    border-radius: 7px;

    background: #e5484d;
}

/* =======================================================
   TÍTULO DA FAIXA DE MINIATURAS
======================================================= */

.mw-camera-faixa-titulo {
    padding: 7px 16px 5px;

    color: #d9dce5;
    background: #191c25;

    font-size: 11px;
    font-weight: 800;

    flex: 0 0 auto;
}

/* =======================================================
   LISTA HORIZONTAL DE MINIATURAS
======================================================= */

.mw-camera-miniaturas {
    min-height: 78px;

    display: flex;
    align-items: center;

    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;

    padding: 8px 14px;

    background: #191c25;

    flex: 0 0 auto;

    scrollbar-width: thin;
    scrollbar-color: #454b5b #191c25;
}

.mw-camera-miniaturas::-webkit-scrollbar {
    height: 5px;
}

.mw-camera-miniaturas::-webkit-scrollbar-track {
    background: #191c25;
}

.mw-camera-miniaturas::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: #454b5b;
}

/* Mensagem exibida quando não há mídias. */

.mw-camera-vazio {
    color: #9298a8;

    font-size: 11px;
    line-height: 1.4;
}

/* =======================================================
   MINIATURA INDIVIDUAL
======================================================= */

.mw-camera-miniatura {
    position: relative;

    width: 58px;
    height: 58px;

    flex: 0 0 58px;

    overflow: hidden;
    padding: 0;

    border: 1px solid #464b59;
    border-radius: 8px;

    background: #292d37;

    cursor: pointer;

    transition:
        border-color 0.2s ease,
        transform 0.2s ease;
}

.mw-camera-miniatura:hover {
    border-color: #9b8aff;
    transform: translateY(-2px);
}

.mw-camera-miniatura img,
.mw-camera-miniatura video {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;
}

/* Indicador visual para miniaturas de vídeo. */

.mw-camera-miniatura-video {
    position: absolute;
    right: 3px;
    bottom: 3px;

    width: 21px;
    height: 21px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    color: #ffffff;
    background: #10131bdb;
}

.mw-camera-miniatura-video svg {
    width: 12px;
    height: 12px;
}

/* =======================================================
   TEXTO DE AJUDA INFERIOR
======================================================= */

.mw-camera-ajuda {
    margin: 0;

    padding:
        7px
        16px
        max(10px, env(safe-area-inset-bottom));

    color: #858c9d;
    background: #191c25;

    font-size: 10px;
    line-height: 1.4;
    text-align: center;

    flex: 0 0 auto;
}

/* =======================================================
   COMPUTADOR / TELAS MAIORES
======================================================= */

@media (min-width: 700px) {
    .mw-camera-overlay {
        padding: 22px;

        background: rgba(10, 13, 20, 0.82);

        backdrop-filter: blur(8px);
    }

    .mw-camera-painel {
        height: min(900px, 100%);

        border: 1px solid #343947;
        border-radius: 20px;

        box-shadow:
            0 24px 90px rgba(0, 0, 0, 0.42);
    }

    .mw-camera-visor {
        flex: 1 1 440px;
    }

    .mw-camera-miniaturas {
        min-height: 86px;
    }
}

/* =======================================================
   TELAS COM POUCA ALTURA
======================================================= */

@media (max-height: 680px) {
    .mw-camera-topo {
        min-height: 50px;
    }

    .mw-camera-icone {
        width: 36px;
        height: 36px;
    }

    .mw-camera-controles {
        min-height: 72px;
    }

    .mw-camera-capturar {
        width: 62px;
        height: 62px;
    }

    .mw-camera-capturar-miolo {
        width: 46px;
        height: 46px;
    }

    .mw-camera-miniaturas {
        min-height: 64px;
    }

    .mw-camera-miniatura {
        width: 48px;
        height: 48px;

        flex-basis: 48px;
    }
}

/* =======================================================
   ACESSIBILIDADE — REDUÇÃO DE MOVIMENTO
======================================================= */

@media (prefers-reduced-motion: reduce) {
    .mw-camera-icone,
    .mw-camera-modo,
    .mw-camera-galeria,
    .mw-camera-continuar,
    .mw-camera-capturar,
    .mw-camera-capturar-miolo,
    .mw-camera-miniatura {
        transition: none;
    }
}

/*
=========================================================
MUSICALWORLD — OCULTAR A SEÇÃO DE MÍDIAS VAZIA

A faixa de mídias selecionadas e seu título só aparecem
quando existe pelo menos uma mídia na lista.
=========================================================
*/

.mw-camera-faixa-titulo,
.mw-camera-miniaturas,
.mw-camera-ajuda {
    display: none;
}

/* Exibir a seção quando houver miniaturas. */
.mw-camera-painel:has(
    .mw-camera-miniatura
) .mw-camera-faixa-titulo,
.mw-camera-painel:has(
    .mw-camera-miniatura
) .mw-camera-miniaturas,
.mw-camera-painel:has(
    .mw-camera-miniatura
) .mw-camera-ajuda {
    display: flex;
}

/* Manter o texto de ajuda como parágrafo. */
.mw-camera-painel:has(
    .mw-camera-miniatura
) .mw-camera-ajuda {
    display: block;
}
