/* ══════════════════════════════════════════════════════════
   CARD ADMIN — Painel de Gestão Soberana
   Iniciativa ICD
   ══════════════════════════════════════════════════════════ */

/* ─── BOTÃO FLUTUANTE DE ACESSO ─────────────────────────── */
#icd-admin-trigger {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 9000;
    background: #000000;
    color: #F09A0F;
    border: 1px solid rgba(240, 154, 15, 0.4);
    padding: 10px 18px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}

#icd-admin-trigger:hover {
    background: #F09A0F;
    color: #000000;
    border-color: #F09A0F;
    box-shadow: 0 8px 32px rgba(240, 154, 15, 0.3);
    transform: translateY(-2px);
}

.adm-trigger-icon {
    font-size: 1rem;
    line-height: 1;
}

.adm-trigger-label {
    letter-spacing: 2.5px;
}

/* ─── PAINEL PRINCIPAL ───────────────────────────────────── */
#icd-admin-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 480px;
    max-width: 100vw;
    height: 100vh;
    background: #0d0d0d;
    border-left: 1px solid rgba(240, 154, 15, 0.2);
    z-index: 9500;
    display: flex;
    flex-direction: column;
    font-family: 'Montserrat', sans-serif;
    box-shadow: -12px 0 60px rgba(0, 0, 0, 0.8);
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.77, 0, 0.175, 1);
    overflow: hidden;
}

#icd-admin-panel.adm-visible {
    transform: translateX(0);
}

/* ─── HEADER ─────────────────────────────────────────────── */
.adm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    background: #000000;
    border-bottom: 1px solid rgba(240, 154, 15, 0.25);
    flex-shrink: 0;
}

.adm-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.adm-crown {
    font-size: 1.1rem;
}

.adm-title {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 3px;
    color: #F09A0F;
    text-transform: uppercase;
}

.adm-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ─── BOTÕES BASE ────────────────────────────────────────── */
.adm-btn {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 8px 14px;
    border: 1px solid;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.adm-btn-save {
    background: #F09A0F;
    color: #000;
    border-color: #F09A0F;
}

.adm-btn-save:hover {
    background: #C57C00;
    border-color: #C57C00;
}

.adm-btn-close {
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    border-color: rgba(255, 255, 255, 0.15);
    padding: 8px 10px;
    font-size: 0.75rem;
}

.adm-btn-close:hover {
    background: #9F0E07;
    color: #fff;
    border-color: #9F0E07;
}

.adm-btn-danger {
    background: transparent;
    color: #9F0E07;
    border-color: rgba(159, 14, 7, 0.4);
}

.adm-btn-danger:hover {
    background: #9F0E07;
    color: #fff;
}

.adm-btn-apply {
    background: transparent;
    color: #F09A0F;
    border-color: rgba(240, 154, 15, 0.35);
    font-size: 0.6rem;
    letter-spacing: 2px;
    width: 100%;
    padding: 10px;
    margin-top: 4px;
}

.adm-btn-apply:hover {
    background: rgba(240, 154, 15, 0.12);
    border-color: #F09A0F;
}

/* ─── TABS ───────────────────────────────────────────────── */
.adm-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    flex-shrink: 0;
    background: #111111;
}

.adm-tab {
    flex: 1;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 13px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.25s ease;
}

.adm-tab:hover {
    color: rgba(255, 255, 255, 0.7);
}

.adm-tab.active {
    color: #F09A0F;
    border-bottom-color: #F09A0F;
    background: rgba(240, 154, 15, 0.04);
}

/* ─── BODY SCROLLÁVEL ────────────────────────────────────── */
.adm-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px;
    scrollbar-width: thin;
    scrollbar-color: rgba(240, 154, 15, 0.3) transparent;
}

.adm-body::-webkit-scrollbar {
    width: 4px;
}

.adm-body::-webkit-scrollbar-thumb {
    background: rgba(240, 154, 15, 0.3);
    border-radius: 2px;
}

/* ─── CARD EDITOR ────────────────────────────────────────── */
.adm-card-editor {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 10px;
    transition: border-color 0.25s;
}

.adm-card-editor:hover {
    border-color: rgba(240, 154, 15, 0.2);
}

.adm-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.adm-card-header:hover {
    background: rgba(240, 154, 15, 0.05);
}

.adm-card-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
}

.adm-card-chevron {
    color: rgba(240, 154, 15, 0.6);
    font-size: 0.9rem;
    transition: transform 0.3s;
}

.adm-card-editor.adm-collapsed .adm-card-chevron {
    transform: rotate(-90deg);
}

.adm-card-fields {
    padding: 4px 16px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    transition: all 0.3s ease;
}

.adm-card-editor.adm-collapsed .adm-card-fields {
    display: none;
}

/* ─── CAMPOS ─────────────────────────────────────────────── */
.adm-field-row {
    margin-bottom: 12px;
}

.adm-field-row--2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.adm-label {
    display: block;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.35);
    margin-bottom: 5px;
}

.adm-input,
.adm-select,
.adm-textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.85);
    font-family: 'Lato', sans-serif;
    font-size: 0.82rem;
    padding: 8px 10px;
    transition: border-color 0.2s, background 0.2s;
    outline: none;
    resize: vertical;
}

.adm-input:focus,
.adm-select:focus,
.adm-textarea:focus {
    border-color: rgba(240, 154, 15, 0.5);
    background: rgba(255, 255, 255, 0.07);
}

.adm-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='rgba(240,154,15,0.6)'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

.adm-select option {
    background: #1a1a1a;
    color: #fff;
}

.adm-textarea {
    min-height: 80px;
}

/* ─── DIVISOR ────────────────────────────────────────────── */
.adm-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: 14px 0;
}

/* ─── SELETOR DE MODO (Só Texto / Imagem) ────────────────── */
.adm-mode-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.adm-mode-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 10px;
    cursor: pointer;
    transition: all 0.25s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.adm-mode-btn:hover {
    border-color: rgba(240, 154, 15, 0.4);
    color: rgba(255, 255, 255, 0.8);
}

.adm-mode-btn.active {
    background: rgba(240, 154, 15, 0.12);
    border-color: #F09A0F;
    color: #F09A0F;
}

.adm-mode-icon {
    font-size: 1.4rem;
}

/* ─── SELETOR DE VISIBILIDADE ────────────────────────────── */
.adm-visibility-selector {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.adm-vis-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 9px 12px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.adm-vis-btn:hover {
    border-color: rgba(240, 154, 15, 0.3);
    color: rgba(255, 255, 255, 0.8);
}

.adm-vis-btn.active {
    background: rgba(240, 154, 15, 0.1);
    border-color: rgba(240, 154, 15, 0.5);
    color: #F09A0F;
}

/* ─── CAMPOS DE IMAGEM ───────────────────────────────────── */
.adm-image-fields {
    background: rgba(240, 154, 15, 0.04);
    border: 1px solid rgba(240, 154, 15, 0.1);
    padding: 12px;
    margin-top: 8px;
    transition: all 0.3s ease;
}

.adm-image-fields.adm-hidden {
    display: none;
}

/* ─── AÇÕES DO CARD ──────────────────────────────────────── */
.adm-card-actions {
    margin-top: 12px;
}

/* ─── FOOTER ─────────────────────────────────────────────── */
.adm-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    background: #080808;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
    gap: 12px;
}

.adm-note {
    font-size: 0.58rem;
    color: rgba(255, 255, 255, 0.25);
    letter-spacing: 0.5px;
    flex: 1;
}

/* ─── TOAST DE FEEDBACK ─────────────────────────────────── */
#icd-admin-toast {
    position: fixed;
    bottom: 90px;
    right: 28px;
    z-index: 9999;
    background: #000000;
    color: #F09A0F;
    border: 1px solid rgba(240, 154, 15, 0.4);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 1px;
    padding: 12px 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    max-width: 320px;
}

#icd-admin-toast.toast-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ─── IMAGEM CENTRAL DO CARD ─────────────────────────────── */
.card-central-image-wrap {
    width: 100%;
    margin: 20px 0 16px;
    overflow: hidden;
    position: relative;
}

.card-central-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease, opacity 0.4s ease;
    opacity: 0.9;
}

.decreto-card:hover .card-central-image,
.portal-card:hover .card-central-image {
    transform: scale(1.03);
    opacity: 1;
}

/* No portal card, a imagem fica acima do portal-content */
.portal-card .card-central-image-wrap {
    position: absolute;
    inset: 0;
    margin: 0;
    z-index: 0;
}

.portal-card .card-central-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.5;
}

/* ─── TEXTO PARCIALMENTE OCULTO ──────────────────────────── */
.has-partial-text .decreto-titulo,
.has-partial-text .decreto-categoria,
.has-partial-text .decreto-excerpt,
.has-partial-text .decreto-numero,
.has-partial-text .portal-nome,
.has-partial-text .portal-sigla,
.has-partial-text .portal-desc {
    transition: opacity 0.35s ease;
}

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 540px) {
    #icd-admin-panel {
        width: 100vw;
    }

    #icd-admin-trigger {
        bottom: 16px;
        right: 16px;
        padding: 10px 14px;
    }

    .adm-field-row--2col {
        grid-template-columns: 1fr;
    }

    .adm-mode-selector {
        grid-template-columns: 1fr;
    }
}