/* ==========================================================================
   FOCAPLAY — CHAT INTERATIVO DA FOFOCA (ENVIO DE PRODUÇÕES)
   Paleta Oficial: Midnight #09090F, Electric Purple #7628F5, Neon Violet #C34AFF,
   Cloud White #F5F2FF, Fresh Mint #21E6B5, Dark Surface #242331
   ========================================================================== */
.fpf-page-main {
    min-height: calc(100vh - 80px);
    background: #09090F;
    padding: 96px 16px 48px;
}

.fpf-shell {
    position: relative;
    max-width: 880px;
    margin: 0 auto;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #F5F2FF;
}

.fpf-ambient-glow {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(circle at 18% 20%, rgba(118, 40, 245, 0.16) 0%, transparent 45%),
        radial-gradient(circle at 82% 80%, rgba(33, 230, 181, 0.08) 0%, transparent 42%);
}

.fpf-chat-card {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    height: min(82vh, 780px);
    min-height: 580px;
    background: linear-gradient(180deg, rgba(22, 21, 34, 0.94) 0%, rgba(12, 12, 20, 0.98) 100%);
    border: 1px solid rgba(195, 74, 255, 0.24);
    border-radius: 24px;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.72), 0 0 40px rgba(118, 40, 245, 0.12);
    overflow: hidden;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

/* Cabeçalho da Fofoca */
.fpf-chat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 22px;
    background: rgba(15, 14, 25, 0.92);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.fpf-head-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.fpf-avatar-ring {
    position: relative;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    padding: 2.5px;
    background: linear-gradient(135deg, #7628F5 0%, #C34AFF 55%, #21E6B5 100%);
    box-shadow: 0 0 22px rgba(118, 40, 245, 0.45);
    flex-shrink: 0;
}

.fpf-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    background: #141322;
}

.fpf-avatar-fallback {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #1c1933;
    align-items: center;
    justify-content: center;
    font-size: 26px;
}

.fpf-online-dot {
    position: absolute;
    right: 1px;
    bottom: 1px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #21E6B5;
    border: 2.5px solid #0f0e19;
    box-shadow: 0 0 10px #21E6B5;
    animation: fpfPulseDot 2.2s infinite;
}

@keyframes fpfPulseDot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.18); opacity: 0.78; }
}

.fpf-head-meta {
    min-width: 0;
}

.fpf-head-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.fpf-head-name {
    margin: 0;
    font-family: 'Space Grotesk', 'Montserrat', sans-serif;
    font-size: 20px;
    font-weight: 800;
    color: #F5F2FF;
    line-height: 1.1;
}

.fpf-head-badge {
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #21E6B5;
    background: rgba(33, 230, 181, 0.12);
    border: 1px solid rgba(33, 230, 181, 0.28);
    padding: 3px 9px;
    border-radius: 999px;
}

.fpf-head-status {
    margin: 3px 0 0;
    font-size: 12.5px;
    color: rgba(245, 242, 255, 0.65);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fpf-head-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.fpf-progress-pill {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    color: rgba(245, 242, 255, 0.72);
}

.fpf-progress-track {
    width: 112px;
    height: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    overflow: hidden;
}

.fpf-progress-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #7628F5 0%, #C34AFF 65%, #21E6B5 100%);
    transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.fpf-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(245, 242, 255, 0.8);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.fpf-icon-btn:hover {
    background: rgba(118, 40, 245, 0.28);
    border-color: #C34AFF;
    color: #fff;
}

/* Área de Mensagens */
.fpf-messages {
    flex: 1;
    overflow-y: auto;
    padding: 22px 22px 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}

.fpf-messages::-webkit-scrollbar {
    width: 6px;
}

.fpf-messages::-webkit-scrollbar-thumb {
    background: rgba(195, 74, 255, 0.28);
    border-radius: 999px;
}

.fpf-msg {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    max-width: 86%;
    animation: fpfMsgIn 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes fpfMsgIn {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.fpf-msg.bot {
    align-self: flex-start;
}

.fpf-msg.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.fpf-msg-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid rgba(195, 74, 255, 0.5);
    flex-shrink: 0;
    background: #1a182d;
}

.fpf-bubble {
    padding: 13px 17px;
    border-radius: 18px;
    font-size: 14.5px;
    line-height: 1.55;
    word-break: break-word;
}

.fpf-msg.bot .fpf-bubble {
    background: rgba(36, 35, 49, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom-left-radius: 5px;
    color: #F5F2FF;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.fpf-msg.user .fpf-bubble {
    background: linear-gradient(135deg, #7628F5 0%, #9b36ff 100%);
    border-bottom-right-radius: 5px;
    color: #FFFFFF;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(118, 40, 245, 0.35);
}

.fpf-bubble strong {
    color: #FFFFFF;
    font-weight: 700;
}

.fpf-msg.bot .fpf-bubble .fpf-hl {
    color: #21E6B5;
    font-weight: 700;
}

/* Indicador "Fofoca está digitando..." */
.fpf-typing {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 12px 16px;
}

.fpf-typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #C34AFF;
    animation: fpfBounce 1.2s infinite ease-in-out;
}

.fpf-typing span:nth-child(2) { animation-delay: 0.16s; }
.fpf-typing span:nth-child(3) { animation-delay: 0.32s; }

@keyframes fpfBounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
    40% { transform: translateY(-5px); opacity: 1; }
}

/* Mini Guia Visual das Capas dentro da bolha da Fofoca */
.fpf-cover-guide {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 12px;
}

.fpf-guide-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(9, 9, 15, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
}

.fpf-guide-shape {
    flex-shrink: 0;
    border: 2px solid #C34AFF;
    background: rgba(118, 40, 245, 0.22);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 800;
    color: #F5F2FF;
}

.fpf-guide-shape.landscape {
    width: 44px;
    height: 26px;
}

.fpf-guide-shape.portrait {
    width: 24px;
    height: 40px;
    border-color: #21E6B5;
    background: rgba(33, 230, 181, 0.18);
}

.fpf-guide-text {
    font-size: 12px;
    line-height: 1.35;
    color: rgba(245, 242, 255, 0.8);
}

.fpf-guide-text strong {
    display: block;
    font-size: 12.5px;
    color: #F5F2FF;
}

/* Composer (Painel Inferior Interativo) */
.fpf-composer {
    padding: 16px 20px 18px;
    background: rgba(14, 13, 23, 0.96);
    border-top: 1px solid rgba(195, 74, 255, 0.18);
    flex-shrink: 0;
    max-height: 54%;
    overflow-y: auto;
}

.fpf-composer-form {
    display: flex;
    flex-direction: column;
    gap: 11px;
}

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

.fpf-field-row.three {
    grid-template-columns: 1fr 1fr 1fr;
}

.fpf-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.fpf-field label {
    font-size: 12px;
    font-weight: 700;
    color: rgba(245, 242, 255, 0.78);
}

.fpf-input,
.fpf-textarea,
.fpf-select {
    width: 100%;
    padding: 11px 14px;
    border-radius: 12px;
    border: 1.5px solid rgba(255, 255, 255, 0.14);
    background: rgba(28, 27, 42, 0.9);
    color: #F5F2FF;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.fpf-input:focus,
.fpf-textarea:focus,
.fpf-select:focus {
    border-color: #C34AFF;
    box-shadow: 0 0 0 3px rgba(118, 40, 245, 0.24);
}

.fpf-textarea {
    resize: vertical;
    min-height: 82px;
}

.fpf-inline-send {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.fpf-inline-send .fpf-input {
    flex: 1;
}

/* Botões e Chips */
.fpf-chips-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.fpf-chip-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 14px;
    border: 1.5px solid rgba(255, 255, 255, 0.14);
    background: rgba(36, 35, 49, 0.85);
    color: #F5F2FF;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.fpf-chip-btn:hover,
.fpf-chip-btn.selected {
    background: linear-gradient(135deg, rgba(118, 40, 245, 0.35), rgba(195, 74, 255, 0.28));
    border-color: #C34AFF;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(118, 40, 245, 0.28);
}

.fpf-rating-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.fpf-rating-chip {
    min-width: 42px;
    height: 36px;
    padding: 0 10px;
    border-radius: 8px;
    border: 2px solid transparent;
    font-weight: 800;
    font-size: 13px;
    cursor: pointer;
    color: #fff;
    opacity: 0.55;
    transition: all 0.18s ease;
}

.fpf-rating-chip.selected,
.fpf-rating-chip:hover {
    opacity: 1;
    transform: scale(1.06);
    border-color: #FFFFFF;
}

.fpf-rating-chip[data-r="L"]  { background: #0c9f48; }
.fpf-rating-chip[data-r="10"] { background: #0082d2; }
.fpf-rating-chip[data-r="12"] { background: #f5b800; color: #111; }
.fpf-rating-chip[data-r="14"] { background: #f26522; }
.fpf-rating-chip[data-r="16"] { background: #dc2626; }
.fpf-rating-chip[data-r="18"] { background: #18181b; border-color: rgba(255,255,255,0.28); }

.fpf-actions-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 2px;
}

.fpf-actions-right {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.fpf-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: 12px;
    border: 0;
    background: linear-gradient(135deg, #7628F5 0%, #C34AFF 100%);
    color: #FFFFFF;
    font-family: 'Space Grotesk', 'Plus Jakarta Sans', sans-serif;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(118, 40, 245, 0.42);
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
    text-decoration: none;
}

.fpf-btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 12px 30px rgba(195, 74, 255, 0.55);
}

.fpf-btn-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.fpf-btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: transparent;
    color: rgba(245, 242, 255, 0.78);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s ease;
}

.fpf-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #FFFFFF;
}

.fpf-error-inline {
    font-size: 12.5px;
    font-weight: 600;
    color: #fb7185;
    background: rgba(244, 63, 94, 0.12);
    border: 1px solid rgba(244, 63, 94, 0.3);
    padding: 8px 12px;
    border-radius: 10px;
}

/* Upload de Capas (Deitada 16:9 + Em Pé 9:16 + Hero Opcional) */
.fpf-uploads-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.fpf-upload-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 6px;
    padding: 14px 10px;
    border-radius: 14px;
    border: 1.5px dashed rgba(195, 74, 255, 0.42);
    background: rgba(36, 35, 49, 0.65);
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 128px;
    overflow: hidden;
}

.fpf-upload-card:hover {
    border-color: #21E6B5;
    background: rgba(118, 40, 245, 0.14);
}

.fpf-upload-card.has-file {
    border-style: solid;
    border-color: #21E6B5;
    padding: 8px;
}

.fpf-upload-card input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.fpf-upload-tag {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(118, 40, 245, 0.25);
    color: #e9d5ff;
}

.fpf-upload-tag.mint {
    background: rgba(33, 230, 181, 0.16);
    color: #21E6B5;
}

.fpf-upload-title {
    font-size: 12.5px;
    font-weight: 800;
    color: #F5F2FF;
}

.fpf-upload-sub {
    font-size: 11px;
    color: rgba(245, 242, 255, 0.62);
    line-height: 1.3;
}

.fpf-upload-preview {
    width: 100%;
    height: 78px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.fpf-upload-preview.portrait {
    width: 48px;
    height: 82px;
}

.fpf-upload-fname {
    font-size: 10.5px;
    color: #21E6B5;
    font-weight: 700;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Construtor de Episódios de Série */
.fpf-ep-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 165px;
    overflow-y: auto;
    padding-right: 4px;
}

.fpf-ep-row {
    display: grid;
    grid-template-columns: 58px 58px 1.2fr 1.6fr 32px;
    gap: 6px;
    align-items: center;
    background: rgba(36, 35, 49, 0.72);
    padding: 8px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.fpf-ep-row .fpf-input {
    padding: 8px 9px;
    font-size: 12.5px;
}

.fpf-ep-rm {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 0;
    background: rgba(244, 63, 94, 0.16);
    color: #fb7185;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

/* Card de Resumo & Sucesso */
.fpf-summary-card {
    margin-top: 10px;
    background: rgba(9, 9, 15, 0.7);
    border: 1px solid rgba(195, 74, 255, 0.3);
    border-radius: 16px;
    padding: 14px;
    display: flex;
    gap: 14px;
    align-items: center;
}

.fpf-summary-thumb {
    width: 120px;
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    object-fit: cover;
    background: #1a182d;
    flex-shrink: 0;
}

.fpf-summary-info {
    min-width: 0;
    flex: 1;
}

.fpf-summary-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 16px;
    font-weight: 800;
    color: #fff;
    margin: 0 0 4px;
}

.fpf-summary-meta {
    font-size: 12px;
    color: rgba(245, 242, 255, 0.72);
    line-height: 1.45;
}

.fpf-protocol-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(33, 230, 181, 0.14);
    border: 1px solid rgba(33, 230, 181, 0.32);
    color: #21E6B5;
    font-size: 12px;
    font-weight: 800;
}

.fpf-terms-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 12.5px;
    color: rgba(245, 242, 255, 0.84);
    line-height: 1.45;
    cursor: pointer;
    background: rgba(36, 35, 49, 0.65);
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.fpf-terms-label input {
    margin-top: 3px;
    accent-color: #7628F5;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Autocomplete de busca de obra no Chat de Remoção */
.fpf-autocomplete-list {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(100% + 6px);
    background: #141322;
    border: 1px solid rgba(195, 74, 255, 0.38);
    border-radius: 12px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 180px;
    overflow-y: auto;
    z-index: 40;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.75);
}

.fpf-auto-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 9px 11px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #F5F2FF;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.fpf-auto-item:hover {
    background: rgba(118, 40, 245, 0.28);
}

.fpf-auto-item small {
    color: #21E6B5;
    font-weight: 700;
}

/* Confetes de celebração da Fofoca */
.fpf-confetti {
    position: fixed;
    top: -12px;
    width: 9px;
    height: 9px;
    border-radius: 2px;
    z-index: 9999;
    pointer-events: none;
    animation: fpfFall 2.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes fpfFall {
    to {
        transform: translateY(105vh) rotate(540deg);
        opacity: 0;
    }
}

/* Responsividade Mobile */
@media (max-width: 720px) {
    .fpf-page-main {
        padding: 74px 8px 18px;
    }

    .fpf-chat-card {
        height: calc(100dvh - 96px);
        min-height: 520px;
        border-radius: 18px;
    }

    .fpf-chat-head {
        padding: 12px 14px;
    }

    .fpf-avatar-ring {
        width: 44px;
        height: 44px;
    }

    .fpf-head-name {
        font-size: 17px;
    }

    .fpf-progress-track {
        width: 76px;
    }

    .fpf-messages {
        padding: 14px 12px;
    }

    .fpf-msg {
        max-width: 94%;
    }

    .fpf-composer {
        padding: 12px 12px 14px;
        max-height: 60%;
    }

    .fpf-field-row,
    .fpf-field-row.three,
    .fpf-uploads-grid,
    .fpf-cover-guide {
        grid-template-columns: 1fr;
    }

    .fpf-ep-row {
        grid-template-columns: 1fr 1fr;
    }

    .fpf-summary-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .fpf-summary-thumb {
        width: 100%;
    }
}
