/**
 * Chat Conversacional - Carinho Digital
 * Estilos para experiência de chat/conversa
 * Mobile-first design
 * Cores sincronizadas com o layout do site
 */

/* ========== LAYOUT PRINCIPAL ========== */

.chat-body {
    margin: 0;
    padding: 0;
    /* Cores do site: gradiente rosa/coral suave */
    background: linear-gradient(135deg, #FFE5F0 0%, #FFD6E8 50%, #FFF5F8 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ========== HEADER ========== */

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    /* Cores do site: fundo branco com blur */
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid rgba(255, 107, 157, 0.1);
}

.chat-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    /* Texto escuro com gradiente rosa */
    background: linear-gradient(135deg, #FF6B9D 0%, #FFD93D 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.chat-logo .logo-icon {
    font-size: 1.5rem;
}

.chat-logo .logo-text {
    font-size: 1.1rem;
}

.chat-alt-link {
    /* Link no estilo do site */
    color: #7F8C8D;
    text-decoration: none;
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 107, 157, 0.3);
    transition: all 0.3s;
}

.chat-alt-link:hover {
    background: rgba(255, 107, 157, 0.1);
    color: #FF6B9D;
    border-color: #FF6B9D;
}

/* ========== CONTAINER DO CHAT ========== */

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    padding: 1rem;
    padding-bottom: 220px;
    /* Espaço generoso para input fixo (especialmente o emocional) */
    overflow-y: auto;
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ========== BOLHAS DE MENSAGEM ========== */

.chat-message {
    display: flex;
    gap: 0.5rem;
    max-width: 85%;
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mensagem do Bot */
.chat-message.bot {
    align-self: flex-start;
}

.chat-message.bot .message-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.chat-message.bot .message-bubble {
    background: white;
    color: #333;
    padding: 0.85rem 1rem;
    border-radius: 18px 18px 18px 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Mensagem do Usuário */
.chat-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-message.user .message-bubble {
    background: linear-gradient(135deg, #FF6B9D 0%, #FF8E9B 100%);
    color: white;
    padding: 0.85rem 1rem;
    border-radius: 18px 18px 4px 18px;
    box-shadow: 0 2px 8px rgba(255, 107, 157, 0.3);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 0.5rem 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.6;
    }

    30% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

/* ========== ÁREA DE INPUT (FIXO NO RODAPÉ) ========== */

.chat-input-area {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 0.75rem 1rem;
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.chat-input-container {
    max-width: 600px;
    margin: 0 auto;
}

/* ========== CARDS DE SELEÇÃO ========== */

.chat-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    padding: 0.5rem 0;
}

.chat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.8rem 1.2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid transparent;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 80px;
}

.chat-card:hover {
    background: linear-gradient(135deg, #fff5f8 0%, #ffe5f0 100%);
    border-color: #FF6B9D;
    transform: translateY(-2px);
}

.chat-card:active {
    transform: scale(0.95);
}

.chat-card .card-icon {
    font-size: 1.8rem;
}

.chat-card .card-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
}

/* Grid para cards (ocasiões) */
.chat-cards.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.chat-cards.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

/* Grid 4 colunas para muitas opções (parentesco) */
.chat-cards.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.4rem;
    max-height: 180px;
    overflow-y: auto;
    padding: 0.5rem;
}

.chat-cards.grid-4 .chat-card {
    padding: 0.5rem 0.3rem;
    min-width: unset;
}

.chat-cards.grid-4 .chat-card .card-icon {
    font-size: 1.4rem;
}

.chat-cards.grid-4 .chat-card .card-label {
    font-size: 0.7rem;
}

@media (max-width: 480px) {
    .chat-cards.grid-4 {
        grid-template-columns: repeat(3, 1fr);
        max-height: 200px;
    }
}

/* ========== INPUT DE TEXTO ========== */

.chat-text-input {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}

.chat-text-input textarea {
    flex: 1;
    resize: none;
    border: 2px solid #e0e0e0;
    border-radius: 24px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    line-height: 1.4;
    max-height: 120px;
    outline: none;
    transition: border-color 0.3s;
}

.chat-text-input textarea:focus {
    border-color: #FF6B9D;
}

.chat-text-input textarea::placeholder {
    color: #999;
}

.chat-send-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #FF6B9D 0%, #FF8E9B 100%);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
}

.chat-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 107, 157, 0.4);
}

.chat-send-btn:active {
    transform: scale(0.95);
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========== PREVIEW MODAL ========== */

.preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.preview-content {
    background: white;
    border-radius: 24px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.preview-header {
    padding: 1.5rem;
    text-align: center;
    background: linear-gradient(135deg, #fff5f8 0%, #ffe5f0 100%);
    border-radius: 24px 24px 0 0;
}

.preview-header h2 {
    margin: 0 0 0.5rem;
    color: #333;
    font-size: 1.3rem;
}

.preview-disclaimer {
    margin: 0;
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
    padding: 0.5rem;
    background: rgba(255, 215, 0, 0.2);
    border-radius: 8px;
    border-left: 3px solid #FFD700;
}

.preview-body {
    padding: 1.5rem;
    font-size: 1rem;
    line-height: 1.7;
    color: #333;
    white-space: pre-wrap;
}

.preview-body .preview-title {
    font-weight: 700;
    color: #667eea;
    margin-bottom: 1rem;
}

.preview-actions {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.5rem 1.5rem;
    justify-content: center;
}

.preview-actions .btn {
    flex: 1;
    max-width: 150px;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.preview-actions .btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.preview-actions .btn-primary {
    background: linear-gradient(135deg, #FF6B9D 0%, #FF8E9B 100%);
    color: white;
}

.preview-actions .btn:hover {
    transform: translateY(-2px);
}

/* ========== MOBILE ADJUSTMENTS ========== */

@media (max-width: 480px) {
    .chat-header {
        padding: 0.5rem 0.75rem;
    }

    .chat-logo .logo-text {
        font-size: 1rem;
    }

    .chat-container {
        padding: 0.75rem;
        padding-bottom: 120px;
    }

    .chat-message {
        max-width: 90%;
    }

    .chat-message.bot .message-avatar {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .chat-card {
        padding: 0.6rem 1rem;
        min-width: 70px;
    }

    .chat-card .card-icon {
        font-size: 1.5rem;
    }

    .chat-card .card-label {
        font-size: 0.8rem;
    }

    .preview-content {
        border-radius: 16px;
    }
}

/* ========== TEXTAREA EMOCIONAL (grande) ========== */

.chat-text-input.emotional textarea {
    min-height: 100px;
    max-height: 200px;
    border-radius: 16px;
}

.chat-text-input.emotional textarea::placeholder {
    color: #888;
    font-style: italic;
}

/* ========== PLANOS CARDS ========== */

.plan-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.plan-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 16px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.plan-card:hover {
    border-color: #FF6B9D;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 157, 0.2);
}

.plan-card.featured {
    border-color: #FFD700;
    background: linear-gradient(135deg, #fff9e6 0%, #fff5f8 100%);
}

.plan-card .plan-info {
    flex: 1;
}

.plan-card .plan-name {
    font-weight: 700;
    color: #333;
    font-size: 1rem;
}

.plan-card .plan-tagline {
    font-size: 0.85rem;
    color: #666;
}

.plan-card .plan-price {
    font-weight: 700;
    font-size: 1.2rem;
    color: #FF6B9D;
}

/* ========== MEDIA UPLOAD UI ========== */

.media-upload-container {
    background: white;
    border-radius: 16px;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    width: 100%;
    margin-top: 0.5rem;
}

.upload-btn-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
    width: 100%;
    margin-bottom: 1rem;
}

.btn-upload {
    border: 2px dashed #FF6B9D;
    color: #FF6B9D;
    background-color: #fff5f8;
    padding: 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s;
    text-align: center;
}

.btn-upload:hover {
    background-color: #ffe5f0;
    transform: translateY(-2px);
}

.btn-upload i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.media-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1rem;
    max-height: 200px;
    overflow-y: auto;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
}

.media-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background: #fff;
    border: 2px solid transparent;
    cursor: grab;
}

.media-item:active {
    cursor: grabbing;
}

.media-item img,
.media-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-item .remove-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(255, 68, 68, 0.9);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    border: none;
    cursor: pointer;
    z-index: 2;
}

.media-item .media-order {
    position: absolute;
    bottom: 2px;
    left: 2px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
}

.media-control-box {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.media-message-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #333;
    margin-bottom: 0.3rem;
    display: block;
}

.media-final-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
}

.btn-confirm-media {
    background: linear-gradient(135deg, #FF6B9D, #E5557F);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(255, 107, 157, 0.3);
}

/* Upsell Card */
.upsell-card {
    background: linear-gradient(135deg, #fff9e6 0%, #fff 100%);
    border: 2px solid #FFD700;
    padding: 1.5rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.2);
    margin: 1rem auto;
    width: 100%;
    max-width: 90%;
    animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
    0% {
        border-color: #FFD700;
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.4);
    }

    70% {
        border-color: #FFC107;
        box-shadow: 0 0 0 10px rgba(255, 215, 0, 0);
    }

    100% {
        border-color: #FFD700;
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0);
    }
}

.upsell-title {
    color: #f39c12;
    font-weight: 800;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.upsell-desc {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
}

/* ========== PLANOS MODAL ========== */

.plans-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 1rem;
}

.plans-modal.show {
    opacity: 1;
    pointer-events: auto;
}

.plans-modal-content {
    background: white;
    width: 100%;
    max-width: 960px;
    /* Wider for 3-column layout */
    border-radius: 24px;
    overflow: hidden;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.plans-header {
    background: linear-gradient(135deg, #FF6B9D 0%, #FF8E9B 100%);
    padding: 1.5rem 2rem;
    text-align: center;
    color: white;
    position: relative;
}

.plans-header h2 {
    margin: 0;
    font-size: 1.6rem;
    margin-bottom: 0.4rem;
}

.plans-header p {
    margin: 0;
    font-size: 1rem;
    opacity: 0.95;
}

.plans-list {
    padding: 1.5rem;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    background: linear-gradient(180deg, #f8f9fa 0%, #fff 100%);
    max-height: 75vh;
}


/* Ajustes nos cards quando dentro do modal */
.plans-list .plan-card {
    border: 2px solid #e8e8e8;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    padding: 1.5rem;
    position: relative;
    overflow: visible;
    background: white;
    border-radius: 20px;
    transition: all 0.3s ease;
    display: flex;
}

.plans-list .plan-card:hover {
    border-color: #FF6B9D;
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(255, 107, 157, 0.2);
}

.plans-list .plan-card.featured {
    border: 3px solid #FF6B9D;
    background: linear-gradient(180deg, #fff5f8 0%, #fff 30%);
    transform: scale(1.02);
    box-shadow: 0 12px 35px rgba(255, 107, 157, 0.25);
    z-index: 1;
}

.plans-list .plan-card.featured:hover {
    transform: scale(1.02) translateY(-4px);
}

.plan-header-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    margin-bottom: 0.75rem;
    gap: 0.5rem;
}

.plan-name-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: #333;
}

.plan-price-tag {
    font-size: 1.6rem;
    font-weight: 800;
    color: #FF6B9D;
    order: -1;
}

.plan-badge {
    background: #f0f0f0;
    color: #666;
    font-size: 0.7rem;
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.featured .plan-badge {
    background: linear-gradient(135deg, #FF6B9D 0%, #FF8E9B 100%);
    color: white;
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.plan-tagline-text {
    font-style: italic;
    font-weight: 600;
    color: #555;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.plan-desc-text {
    font-size: 0.9rem;
    color: #777;
    margin-bottom: 1rem;
    line-height: 1.5;
    flex-grow: 1;
}

.plan-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, #ddd, transparent);
    width: 100%;
    margin: 0.8rem 0;
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
    flex-grow: 1;
}

.plan-features li {
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    color: #444;
    padding-left: 0;
    line-height: 1.4;
}

/* Mobile responsive */
@media (max-width: 900px) {
    .plans-list {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
    }

    .plans-modal-content {
        max-width: 95%;
        max-height: 90vh;
    }

    .plans-list .plan-card.featured {
        transform: none;
        order: -1;
    }

    .plans-list .plan-card.featured:hover {
        transform: translateY(-2px);
    }
}

.plan-footer-link {
    font-size: 0.85rem;
    color: #FF6B9D;
    margin-top: 1rem;
    font-weight: 600;
    text-align: right;
    width: 100%;
    cursor: pointer;
}

.upsell-card.styled-like-plan {
    background: white;
    border: 2px solid #FFD700;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 8px 20px rgba(255, 215, 0, 0.2);
    text-align: center;
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
}

.plan-content {
    cursor: pointer;
    width: 100%;
}

.plan-footer-link {
    cursor: pointer;
    background: #fdfdfd;
    padding: 0.8rem;
    margin-top: 1rem;
    margin-right: -1.5rem;
    margin-bottom: -1.5rem;
    margin-left: -1.5rem;
    border-top: 1px solid #eee;
    text-align: center;
    color: #FF6B9D;
    font-weight: 600;
    transition: background 0.2s;
}

.plan-footer-link:hover {
    background: #fff0f5;
}

.upsell-actions {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
}
/* CTA Button inside plan */
.plan-cta-btn {
    display: block;
    width: 100%;
    padding: 0.9rem 1.5rem;
    background: linear-gradient(135deg, #FF6B9D 0%, #FF8E9B 100%);
    color: white;
    border: none;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    text-align: center;
    margin-top: auto;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.3);
}

.plan-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 157, 0.4);
}

.featured .plan-cta-btn {
    background: linear-gradient(135deg, #FF6B9D 0%, #e55585 100%);
    box-shadow: 0 6px 20px rgba(255, 107, 157, 0.35);
}
