/*!
 * 1MZ Date Picker — estilo isolado.
 *
 * @package OneMZ_For_Artists
 * @since   1.5.147
 *
 * Tudo é prefixado com .rmbz-dp para isolar do resto do plugin/tema.
 * Cores e variáveis são auto-contidas (sem dependência de design tokens
 * externos) para garantir consistência mesmo se o tema mexer em vars.
 */

/* ============================================================
   COMPONENTE PRINCIPAL — wrapper + label
   ============================================================ */

.rmbz-dp {
    display: block;
    width: 100%;
    margin: 0;
    box-sizing: border-box;
}

.rmbz-dp-label {
    display: block;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    line-height: 1.4;
}

.rmbz-dp-required {
    color: #f0b90b;
    margin-left: 2px;
}

.rmbz-dp-hint {
    display: block;
    color: #9a9a9a;
    font-size: 12px;
    line-height: 1.45;
    margin-top: 6px;
}

/* ============================================================
   TRIGGER — botão fake estilo "25.Jan.2026"
   ============================================================ */

.rmbz-dp-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: #0e0e10;
    color: #ffffff;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 11px 14px;
    font-size: 16px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    box-sizing: border-box;
    line-height: 1.4;
    text-align: left;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.rmbz-dp-trigger:hover {
    border-color: rgba(240, 185, 11, 0.5);
    background: #131316;
}

.rmbz-dp-trigger:focus,
.rmbz-dp-trigger:focus-visible {
    outline: none;
    border-color: #f0b90b;
    box-shadow: 0 0 0 3px rgba(240, 185, 11, 0.2);
}

.rmbz-dp-trigger-empty .rmbz-dp-trigger-text {
    color: #888;
    font-weight: 400;
}

.rmbz-dp-trigger-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rmbz-dp-trigger-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #f0b90b;
    flex-shrink: 0;
    margin-left: 12px;
}

/* ============================================================
   MODAL — overlay + dialog
   ============================================================ */

.rmbz-dp-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.rmbz-dp-modal[hidden] {
    display: none !important;
}

.rmbz-dp-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    cursor: pointer;
}

.rmbz-dp-modal-dialog {
    position: relative;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    width: 100%;
    max-width: 720px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    box-sizing: border-box;
}

.rmbz-dp-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid #2a2a2a;
}

.rmbz-dp-modal-title {
    margin: 0;
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.2;
}

.rmbz-dp-modal-close {
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 6px;
    line-height: 0;
    border-radius: 4px;
    transition: color 0.15s ease, background 0.15s ease;
}

.rmbz-dp-modal-close:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.rmbz-dp-modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    padding: 24px;
}

.rmbz-dp-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid #2a2a2a;
}

/* Mobile — empilhar */
@media (max-width: 640px) {
    .rmbz-dp-modal-body {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .rmbz-dp-modal-dialog {
        max-width: 100%;
    }
}

/* ============================================================
   COLUNA ESQUERDA — texto + sugestão
   ============================================================ */

.rmbz-dp-modal-left {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.rmbz-dp-explanation {
    margin: 0;
    color: #cccccc;
    font-size: 13px;
    line-height: 1.55;
}

.rmbz-dp-suggestion {
    background: rgba(46, 204, 113, 0.08);
    border: 1px solid rgba(46, 204, 113, 0.3);
    border-radius: 8px;
    padding: 14px 16px;
    margin: 4px 0;
}

.rmbz-dp-suggestion-label {
    color: #9be7b8;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.rmbz-dp-suggestion-date {
    color: #ffffff;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
}

.rmbz-dp-alt {
    margin: 0;
    color: #9a9a9a;
    font-size: 12px;
    font-style: italic;
    line-height: 1.5;
}

/* ============================================================
   COLUNA DIREITA — calendário
   ============================================================ */

.rmbz-dp-modal-right {
    background: #0e0e10;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rmbz-dp-cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.rmbz-dp-cal-arrow {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #cccccc;
    border-radius: 6px !important;
    width: 32px !important;
    height: 32px !important;
    min-height: 0 !important;
    min-width: 0 !important;
    cursor: pointer;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s ease;
    padding: 0 !important;
    line-height: 1 !important;
    font-size: 14px !important;
    box-shadow: none !important;
}

.rmbz-dp-cal-arrow:hover {
    background: rgba(240, 185, 11, 0.1);
    border-color: rgba(240, 185, 11, 0.5);
    color: #f0b90b;
}

.rmbz-dp-cal-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.rmbz-dp-cal-selects {
    display: flex;
    gap: 6px;
    flex: 1;
    justify-content: center;
}

/* Selects de mês/ano — tema Foxiz força fundo branco, neutralizamos.
   `appearance: none` remove a aparência nativa do browser, depois aplicamos
   o nosso visual custom com seta SVG inline. Tudo com !important para
   vencer regras do tema. */
.rmbz-dp-cal-month,
.rmbz-dp-cal-year {
    background-color: #1a1a1a !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23f0b90b' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 8px center !important;
    background-size: 10px 6px !important;
    color: #ffffff !important;
    border: 1px solid #2a2a2a !important;
    border-radius: 6px !important;
    padding: 5px 22px 5px 8px !important;  /* espaço à direita p/ a seta */
    font-size: 13px !important;
    font-family: inherit !important;
    cursor: pointer !important;
    font-weight: 500 !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
    line-height: 1.3 !important;
    min-height: 0 !important;
    height: auto !important;
}

/* Quando dropdown nativo abre (browser controla isto, não estilizável),
   pelo menos garantir que as <option> tenham fundo escuro. Nem todos os
   browsers respeitam — é limitação do HTML nativo. */
.rmbz-dp-cal-month option,
.rmbz-dp-cal-year option {
    background-color: #1a1a1a !important;
    color: #ffffff !important;
}

.rmbz-dp-cal-month:focus,
.rmbz-dp-cal-year:focus {
    outline: none !important;
    border-color: #f0b90b !important;
    box-shadow: 0 0 0 2px rgba(240, 185, 11, 0.2) !important;
}

.rmbz-dp-cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    text-align: center;
}

.rmbz-dp-cal-weekdays span {
    color: #888;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 6px 0;
}

.rmbz-dp-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.rmbz-dp-cal-day {
    background: transparent !important;
    border: 1px solid transparent !important;
    color: #ddd;
    font-size: 13px !important;
    font-weight: 500;
    font-family: inherit !important;
    border-radius: 6px !important;
    padding: 0 !important;
    height: 36px !important;
    min-height: 0 !important;
    min-width: 0 !important;
    width: 100% !important;
    cursor: pointer;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    transition: all 0.12s ease;
    line-height: 1 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    box-sizing: border-box !important;
}

.rmbz-dp-cal-day:hover:not(:disabled):not(.rmbz-dp-cal-day-selected) {
    background: rgba(240, 185, 11, 0.12);
    color: #f0b90b;
}

.rmbz-dp-cal-day:disabled {
    color: #444;
    cursor: not-allowed;
}

.rmbz-dp-cal-day-other-month {
    color: #444;
}

.rmbz-dp-cal-day-today {
    background: rgba(46, 204, 113, 0.18);
    color: #2ecc71;
    border-color: rgba(46, 204, 113, 0.4);
}

.rmbz-dp-cal-day-selected {
    background: #f0b90b;
    color: #000;
    border-color: #f0b90b;
    font-weight: 700;
}

.rmbz-dp-cal-day-selected:hover {
    background: #ffce3a;
}

/* ============================================================
   BOTÕES (footer + atalho)
   ============================================================ */

.rmbz-dp-btn {
    border: none !important;
    border-radius: 8px !important;
    padding: 10px 18px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    font-family: inherit !important;
    cursor: pointer !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    transition: all 0.15s ease;
    line-height: 1.2 !important;
    min-height: 0 !important;
    height: auto !important;
    box-shadow: none !important;
    text-shadow: none !important;
    box-sizing: border-box !important;
}

.rmbz-dp-btn-suggested {
    background: #2ecc71;
    color: #ffffff;
    width: 100%;
    margin-top: 4px;
}

.rmbz-dp-btn-suggested:hover {
    background: #27ae60;
}

.rmbz-dp-btn-cancel {
    background: transparent;
    color: #aaa;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.rmbz-dp-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.rmbz-dp-btn-confirm {
    background: #f0b90b;
    color: #000;
}

.rmbz-dp-btn-confirm:hover {
    background: #ffce3a;
}

/* ============================================================
   ANIMAÇÃO (sutil)
   ============================================================ */

.rmbz-dp-modal:not([hidden]) .rmbz-dp-modal-dialog {
    animation: rmbz-dp-slide-in 0.2s ease-out;
}

@keyframes rmbz-dp-slide-in {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Bloquear scroll do body quando modal aberto */
body.rmbz-dp-open {
    overflow: hidden;
}

/* ============================================================
   [1.5.152] CAIXA AMARELA DE CATÁLOGO LEGADO (inline)
   ============================================================
   Aparece entre body e footer quando utilizador clica em data
   desabilitada e o picker tem allow_legacy=true. */

.rmbz-dp-legacy-prompt {
    margin: 0 24px 14px 24px;
    background: rgba(240, 185, 11, 0.1);
    border: 1px solid rgba(240, 185, 11, 0.4);
    border-radius: 8px;
    padding: 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    animation: rmbz-dp-legacy-slide 0.2s ease-out;
}

.rmbz-dp-legacy-prompt[hidden] {
    display: none !important;
}

@keyframes rmbz-dp-legacy-slide {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.rmbz-dp-legacy-prompt-icon {
    color: #f0b90b;
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
    padding-top: 1px;
}

.rmbz-dp-legacy-prompt-body {
    flex: 1;
    min-width: 0;
}

.rmbz-dp-legacy-prompt-title {
    color: #f0b90b !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    margin-bottom: 4px !important;
    line-height: 1.3 !important;
}

.rmbz-dp-legacy-prompt-text {
    color: #ddd !important;
    font-size: 12px !important;
    line-height: 1.5 !important;
    margin-bottom: 10px !important;
}

.rmbz-dp-legacy-prompt-btn {
    background: #f0b90b !important;
    color: #000 !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 7px 14px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
    line-height: 1.2 !important;
    min-height: 0 !important;
    height: auto !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

.rmbz-dp-legacy-prompt-btn:hover {
    background: #ffce3a !important;
}

/* Quando modo legacy está activo, o calendário visualmente sinaliza isso
   com um border-top âmbar para o utilizador saber. */
.rmbz-dp.rmbz-dp-legacy-mode .rmbz-dp-trigger {
    border-color: rgba(240, 185, 11, 0.5) !important;
}

/* Datas passadas no calendário ficam clicáveis quando legacy está activo */
.rmbz-dp-cal-grid.rmbz-dp-cal-grid-legacy .rmbz-dp-cal-day:disabled {
    color: #888 !important;
    cursor: pointer !important;
    opacity: 1 !important;
}

/* ============================================================
   [1.5.155] CAIXA INFO LEGACY — auto-activação
   ============================================================
   Aparece quando legacy é activado por navegação para mês passado
   (sem click). Verde claro, sem botão, apenas informativa. */

.rmbz-dp-legacy-info {
    margin: 0 24px 14px 24px;
    background: rgba(46, 204, 113, 0.08);
    border: 1px solid rgba(46, 204, 113, 0.35);
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    animation: rmbz-dp-legacy-slide 0.2s ease-out;
}

.rmbz-dp-legacy-info[hidden] {
    display: none !important;
}

.rmbz-dp-legacy-info-icon {
    color: #2ecc71;
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
    padding-top: 1px;
}

.rmbz-dp-legacy-info-body {
    flex: 1;
    min-width: 0;
}

.rmbz-dp-legacy-info-title {
    color: #9be7b8 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    margin-bottom: 3px !important;
    line-height: 1.3 !important;
}

.rmbz-dp-legacy-info-text {
    color: #ccc !important;
    font-size: 12px !important;
    line-height: 1.5 !important;
}
