* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --wa-bg: #efeae2;
    --wa-header: #008069;
    --wa-header-dark: #005c4b;
    --wa-bubble-incoming: #ffffff;
    --wa-bubble-outgoing: #d9fdd3;
    --wa-text: #111b21;
    --wa-text-secondary: #667781;
    --wa-time: #667781;
    --wa-option-border: #00a884;
    --wa-option-text: #008069;
    --wa-blue-link: #027eb5;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    font-family: var(--font);
    background: #111b21;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* ===== PHONE CONTAINER ===== */
.phone-container {
    width: 100%;
    max-width: 100%;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    background: var(--wa-bg);
}

@media (min-width: 480px) {
    body {
        padding: 20px;
    }

    .phone-container {
        max-width: 440px;
        height: 92vh;
        max-height: 780px;
        border-radius: 12px;
        box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
        overflow: hidden;
    }
}

@media (min-width: 768px) {
    body {
        padding: 30px;
        background: linear-gradient(180deg, #00a884 0%, #00a884 15%, #111b21 15%, #111b21 100%);
    }

    .phone-container {
        max-width: 460px;
        height: 88vh;
        max-height: 820px;
        border-radius: 14px;
        box-shadow: 0 12px 50px rgba(0, 0, 0, 0.5);
    }
}

@media (min-width: 1024px) {
    body {
        padding: 40px;
    }

    .phone-container {
        max-width: 480px;
        max-height: 860px;
    }

    .bubble {
        font-size: 14.5px;
    }

    .option-btn {
        font-size: 14.5px;
        padding: 13px 18px;
    }
}

/* ===== WHATSAPP HEADER ===== */
.wa-header {
    background: var(--wa-header);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    z-index: 10;
}

.wa-header-back {
    color: white;
    display: flex;
    align-items: center;
}

.wa-header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.wa-header-info {
    flex: 1;
}

.wa-header-name {
    color: white;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
}

.wa-header-status {
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
}

.wa-header-actions {
    display: flex;
    gap: 16px;
    color: white;
}

/* ===== CHAT AREA ===== */
.wa-chat-wrapper {
    flex: 1;
    position: relative;
    overflow: hidden;
    min-height: 0;
    background-color: #efeae2;
}

.wa-chat-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("https://static.whatsapp.net/rsrc.php/yx/r/voSdkk88H7C.svg");
    background-repeat: repeat;
    background-size: 412.5px 749.5px;
    opacity: 0.08;
    pointer-events: none;
    z-index: 1;
}

.wa-chat {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: transparent;
    overflow-y: auto;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    scroll-behavior: smooth;
    z-index: 2;
    /* Oculta scrollbar mantendo a rolagem funcional */
    scrollbar-width: none;        /* Firefox */
    -ms-overflow-style: none;     /* IE / Edge legado */
}

.wa-chat::-webkit-scrollbar {
    display: none;                /* Chrome, Safari, Opera */
}

/* ===== BUBBLES ===== */
.bubble {
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.45;
    color: var(--wa-text);
    position: relative;
    animation: bubbleIn 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    word-wrap: break-word;
    flex-shrink: 0;
}

@keyframes bubbleIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.bubble-incoming {
    background: var(--wa-bubble-incoming);
    align-self: flex-start;
    border-top-left-radius: 0;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.06);
}

.bubble-outgoing {
    background: var(--wa-bubble-outgoing);
    align-self: flex-end;
    border-top-right-radius: 0;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.06);
}

.bubble-time {
    font-size: 11px;
    color: var(--wa-time);
    text-align: right;
    margin-top: 4px;
}

.bubble-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--wa-header);
    margin-bottom: 2px;
}

/* ===== TYPING INDICATOR ===== */
.typing-indicator {
    align-self: flex-start;
    background: var(--wa-bubble-incoming);
    border-radius: 8px;
    border-top-left-radius: 0;
    padding: 12px 16px;
    display: flex;
    gap: 4px;
    align-items: center;
    animation: bubbleIn 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.typing-dot {
    width: 7px;
    height: 7px;
    background: #90959a;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-4px);
    }
}

/* ===== OPTIONS ===== */
.options-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
    align-self: flex-start;
    width: 80%;
    animation: bubbleIn 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    flex-shrink: 0;
}

.option-btn {
    background: white;
    border: 1.5px solid var(--wa-option-border);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--wa-option-text);
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
}

.option-btn:active {
    transform: scale(0.97);
    background: #e7faf4;
}

.option-btn.selected {
    background: var(--wa-bubble-outgoing);
    border-color: var(--wa-header-dark);
    color: var(--wa-header-dark);
    font-weight: 600;
    pointer-events: none;
}

/* ===== CTA LINK ===== */
.cta-link {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1.5px solid var(--wa-option-border);
    border-radius: 8px;
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--wa-option-text);
    text-decoration: none;
    margin-top: 8px;
    align-self: flex-start;
    max-width: 80%;
    animation: ctaPulse 2s infinite;
    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
}

.cta-link:active {
    transform: scale(0.97);
}

@keyframes ctaPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(0, 168, 132, 0.3);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(0, 168, 132, 0);
    }
}

.cta-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ===== NATIVE AD (WhatsApp Business Template Style) ===== */
.native-ad {
    max-width: 90%;
    width: 90%;
    align-self: flex-start;
    background: var(--wa-bubble-incoming);
    border-radius: 8px;
    border-top-left-radius: 0;
    overflow: hidden;
    animation: bubbleIn 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    text-decoration: none;
    display: block;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
}

.native-ad-image {
    width: 100%;
    display: block;
    border-radius: 6px 6px 0 0;
    margin: 3px;
    margin-bottom: 0;
    width: calc(100% - 6px);
    border-radius: 6px;
}

.native-ad-body {
    padding: 6px 10px 2px;
    font-size: 14px;
    color: var(--wa-text);
    line-height: 1.4;
}

.native-ad-time {
    font-size: 11px;
    color: var(--wa-time);
    text-align: right;
    padding: 0 10px 6px;
}

.native-ad-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    color: #00a884;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
}

.native-ad-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ===== DATE DIVIDER ===== */
.date-divider {
    align-self: center;
    background: #e1f2fb;
    color: var(--wa-text-secondary);
    font-size: 12px;
    padding: 5px 12px;
    border-radius: 8px;
    margin: 8px 0;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

/* ===== FOOTER ===== */
.wa-footer {
    background: #f0f2f5;
    padding: 8px 16px;
    text-align: center;
    font-size: 11px;
    color: var(--wa-text-secondary);
    flex-shrink: 0;
}

.wa-footer a {
    color: var(--wa-blue-link);
    text-decoration: none;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 360px) {
    .bubble {
        font-size: 13px;
    }

    .option-btn {
        padding: 10px 14px;
        font-size: 13px;
    }

    .options-container {
        width: 85%;
    }
}

@media (min-width: 480px) {
    .wa-header {
        border-radius: 12px 12px 0 0;
    }

    .wa-footer {
        border-radius: 0 0 12px 12px;
    }
}

/* ===== SIMULATION CARD ===== */
.simulation-card {
    max-width: 90% !important;
    padding: 0 !important;
    overflow: hidden;
}

.sim-header {
    background: #e8f8f4;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--wa-header);
    border-bottom: 1px solid rgba(0, 128, 105, 0.15);
}

.sim-rows {
    padding: 2px 0;
}

.sim-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 14px;
    font-size: 13px;
}

.sim-row:nth-child(even) {
    background: rgba(0, 0, 0, 0.025);
}

.sim-label {
    color: var(--wa-text-secondary);
}

.sim-value {
    font-weight: 600;
    color: var(--wa-text);
}

.sim-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.08);
    margin: 4px 0;
}

.sim-highlight {
    background: #e8f8f4 !important;
    padding-top: 9px !important;
    padding-bottom: 9px !important;
}

.sim-highlight .sim-label {
    color: var(--wa-header);
    font-weight: 600;
}

.sim-highlight .sim-value {
    color: var(--wa-header);
    font-size: 15px;
    font-weight: 700;
}

.sim-disclaimer {
    padding: 6px 14px 4px;
    font-size: 10px;
    color: var(--wa-text-secondary);
    font-style: italic;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.simulation-card .bubble-time {
    padding: 2px 14px 8px;
    margin-top: 0;
}
