/* ===================================
   Components — Buttons, Cards, Badges, Accordion
   =================================== */

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: 600;
    padding: 12px 28px;
    border-radius: var(--radius-full);
    border: none;
    cursor: pointer;
    transition: transform var(--duration-fast) var(--ease-out),
                box-shadow var(--duration-fast) var(--ease-out),
                background-color var(--duration-fast) var(--ease-out);
    text-decoration: none;
    line-height: 1.4;
}

.btn:active {
    transform: translateY(0) !important;
}

.btn-sm {
    padding: 8px 20px;
    font-size: var(--text-sm);
}

.btn-lg {
    padding: 16px 36px;
    font-size: var(--text-lg);
}

.btn-full {
    width: 100%;
}

/* Primary — Teal solid */
.btn-primary {
    background-color: var(--color-teal);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--color-teal-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(8, 145, 178, 0.3);
}

/* Secondary — Charcoal outline */
.btn-secondary {
    background: transparent;
    color: var(--color-charcoal);
    border: 1.5px solid var(--color-charcoal);
}

.btn-secondary:hover {
    background-color: var(--color-charcoal);
    color: var(--color-cream);
    transform: translateY(-2px);
}

/* Ghost — Text only */
.btn-ghost {
    background: transparent;
    color: var(--color-teal);
    padding-left: 4px;
    padding-right: 4px;
}

.btn-ghost:hover {
    color: var(--color-teal-light);
    background-color: var(--color-teal-bg);
    padding-left: 16px;
    padding-right: 16px;
}

/* ---- Cards ---- */
.card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    padding: var(--space-8);
    transition: transform var(--duration-normal) var(--ease-out),
                box-shadow var(--duration-normal) var(--ease-out);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card--elevated {
    background: var(--white);
    box-shadow: var(--shadow-md);
}

/* Pricing cards */
.pricing-card {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
    padding: var(--space-10);
    text-align: center;
    position: relative;
    transition: transform var(--duration-normal) var(--ease-out),
                box-shadow var(--duration-normal) var(--ease-out);
}

.pricing-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.pricing-card--featured {
    border: 2px solid var(--color-teal);
    transform: scale(1.02);
    box-shadow: var(--shadow-xl);
}

.pricing-card--featured:hover {
    transform: scale(1.02) translateY(-4px);
}

.pricing-badge {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-teal);
    color: var(--white);
    font-size: var(--text-xs);
    font-weight: 600;
    padding: 6px 20px;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.pricing-header {
    margin-bottom: var(--space-8);
}

.pricing-label {
    display: inline-block;
    background: var(--color-teal-bg);
    color: var(--color-teal);
    font-size: var(--text-xs);
    font-weight: 600;
    padding: 6px 16px;
    border-radius: var(--radius-full);
    margin-bottom: var(--space-4);
}

.pricing-value {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
}

.pricing-value .currency {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 600;
    color: var(--color-text);
}

.pricing-value .amount {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 2rem + 2vw, 3.5rem);
    font-weight: 700;
    color: var(--color-text);
    line-height: 1;
}

.pricing-value .period {
    font-size: var(--text-base);
    color: var(--color-text-muted);
}

.pricing-agents {
    display: block;
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    margin-top: var(--space-2);
}

.pricing-features {
    list-style: none;
    text-align: left;
    margin-bottom: var(--space-8);
}

.pricing-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
    font-size: var(--text-sm);
}

.pricing-features li:last-child {
    border-bottom: none;
}

.pricing-features svg {
    color: var(--color-teal);
    flex-shrink: 0;
}

/* ---- Badges ---- */
.badge {
    display: inline-flex;
    align-items: center;
    font-size: var(--text-xs);
    font-weight: 600;
    padding: 4px 12px;
    border-radius: var(--radius-full);
}

.badge--teal {
    background: var(--color-teal-bg);
    color: var(--color-teal);
}

.badge--amber {
    background: var(--color-amber-bg);
    color: var(--color-amber);
}

.badge--neutral {
    background: var(--neutral-100);
    color: var(--neutral-500);
}

/* ---- Text Highlight — Hand-drawn marker stroke ---- */
.text-highlight {
    position: relative;
    display: inline;
}

.text-highlight::after {
    content: '';
    position: absolute;
    left: -2%;
    right: -2%;
    bottom: 0;
    height: 0.18em;
    z-index: -1;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'%3E%3Cpath d='M2 8 C20 3, 40 10, 60 6 S100 2, 130 7 S170 10, 198 5' stroke='%230891B2' stroke-width='8' fill='none' stroke-linecap='round' opacity='0.35'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: 100% 100%;
}

/* ---- WhatsApp Conversation ---- */
.wa-conversation {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    max-width: 480px;
    width: 100%;
}

.wa-header {
    background: #075E54;
    color: var(--white);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.wa-header__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #128C7E;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-sm);
    font-weight: 700;
    flex-shrink: 0;
}

.wa-header__info {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.wa-header__name {
    font-weight: 600;
    font-size: var(--text-sm);
}

.wa-header__label {
    font-size: 11px;
    opacity: 0.8;
}

.wa-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: #ECE5DD;
    min-height: 120px;
}

.wa-bubble {
    background: var(--white);
    padding: 8px 12px;
    border-radius: 8px 8px 8px 0;
    max-width: 85%;
    font-size: var(--text-sm);
    color: #303030;
    line-height: 1.45;
    position: relative;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.06);
}

.wa-bubble--sent {
    background: #DCF8C6;
    border-radius: 8px 8px 0 8px;
    align-self: flex-end;
}

.wa-time {
    font-size: 10px;
    color: #8C8C8C;
    text-align: right;
    margin-top: 2px;
}

.wa-gap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    margin: 8px auto;
    background: rgba(0, 0, 0, 0.04);
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    color: #8C8C8C;
}

.wa-alert {
    background: var(--color-danger-bg);
    border-left: 3px solid var(--color-danger);
    padding: 10px 14px;
    margin: 8px 0 0;
    border-radius: 0 8px 8px 0;
    font-size: var(--text-sm);
    color: var(--color-danger);
    font-weight: 600;
    line-height: 1.4;
}

.wa-alert__sub {
    font-weight: 400;
    color: #666;
    display: block;
    margin-top: 2px;
    font-size: 12px;
}

/* ---- WhatsApp Typing Indicator ---- */
.wa-typing {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--white);
    padding: 10px 14px;
    border-radius: 8px 8px 8px 0;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.06);
    width: fit-content;
}

.wa-typing__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #999;
    animation: wa-typing-bounce 1.4s infinite ease-in-out;
}

.wa-typing__dot:nth-child(2) { animation-delay: 0.2s; }
.wa-typing__dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes wa-typing-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-4px); opacity: 1; }
}

/* Hidden state for chat animation */
.wa-bubble--hidden {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin: 0;
    overflow: hidden;
}

/* ---- Koee Analysis Panel ---- */
.koee-analysis {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    max-width: 420px;
    width: 100%;
}

.koee-analysis__header {
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-teal);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.koee-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid var(--color-border);
}

.koee-item__icon {
    font-size: 16px;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 2px;
}

.koee-item__content {
    flex: 1;
}

.koee-item__label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    display: block;
}

.koee-item__value {
    font-size: var(--text-sm);
    color: var(--color-text);
    margin-top: 2px;
    display: block;
}

/* ---- Dead Tag ---- */
.dead-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--color-danger);
    color: var(--white);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 6px 14px;
    border-radius: var(--radius-full);
}

/* ---- Accordion ---- */
.accordion-item {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-3);
    border: 1px solid var(--color-border);
    overflow: hidden;
}

.accordion-trigger {
    width: 100%;
    padding: var(--space-5) var(--space-6);
    font-family: var(--font-body);
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--color-text);
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
}

.accordion-trigger:hover {
    color: var(--color-teal);
}

.accordion-icon {
    width: 24px;
    height: 24px;
    color: var(--color-teal);
    transition: transform var(--duration-normal) var(--ease-out);
    flex-shrink: 0;
}

.accordion-item.is-open .accordion-icon {
    transform: rotate(45deg);
}

.accordion-content {
    height: 0;
    overflow: hidden;
}

.accordion-inner {
    padding: 0 var(--space-6) var(--space-5);
    color: var(--color-text-muted);
    font-size: var(--text-base);
    line-height: var(--leading-relaxed);
}

/* ---- Floating Metric Cards (Hero) ---- */
.hero-float {
    position: absolute;
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    min-width: 150px;
    z-index: 10;
    will-change: transform, width, height;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-float__label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--neutral-500);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.hero-float__badge {
    font-size: 9px;
    background: var(--color-teal);
    color: var(--white);
    padding: 2px 7px;
    border-radius: 8px;
    font-weight: 700;
    margin-left: auto;
}

.hero-float__value {
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 800;
    color: var(--color-text);
    line-height: 1;
    letter-spacing: var(--tracking-tight);
}

.hero-float__value--teal {
    color: var(--color-teal);
}

.hero-float__unit {
    font-size: 16px;
    font-weight: 600;
    color: var(--neutral-500);
}

.hero-float__detail {
    font-size: 11px;
    color: var(--neutral-400);
    margin-top: 4px;
}

.hero-float__trend {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 8px;
}

.hero-float__trend--up {
    color: var(--color-teal);
}

/* Card positions (desktop) — at viewport edges, partially off-screen */
.hero-float--conversas  { top: 14%;  left: -1%;  transform: rotate(-3deg); }
.hero-float--score      { top: 10%;  right: -2%; transform: rotate(2.5deg); }
.hero-float--resposta   { bottom: 14%; right: 3%;  transform: rotate(-2deg); }
.hero-float--sentimento { bottom: 4%;  left: -2%;  transform: rotate(2.5deg); min-width: 180px; }
.hero-float--resolucao  { top: 52%; right: -1%;  transform: rotate(-1.5deg); min-width: 120px; }

/* Mini bar chart (sentimento card) */
.hero-float__mini-chart {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 44px;
    margin: 8px 0 6px;
}

.mini-bar {
    width: 8px;
    display: flex;
    flex-direction: column;
    gap: 1px;
    justify-content: flex-end;
}

.mini-bar__pos { background: #10b981; border-radius: 1px; display: block; }
.mini-bar__neu { background: #f59e0b; border-radius: 1px; display: block; }
.mini-bar__neg { background: #ef4444; border-radius: 1px; display: block; }

.hero-float__legend {
    display: flex;
    gap: 8px;
    font-size: 9px;
    color: var(--neutral-500);
    align-items: center;
}

.legend-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.legend-dot--pos { background: #10b981; }
.legend-dot--neu { background: #f59e0b; }
.legend-dot--neg { background: #ef4444; }

/* ---- Dashboard Window (Koee app mockup) ---- */
.dashboard-window {
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.05);
    max-width: 1060px;
    width: 92%;
    margin: 0 auto;
    overflow: hidden;
}

.dashboard-chrome {
    display: flex;
    gap: 7px;
    padding: 14px 18px;
    background: var(--neutral-50);
    border-bottom: 1px solid var(--color-border);
}

.chrome-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
}

.chrome-dot--red    { background: #ff5f57; }
.chrome-dot--yellow { background: #febc2e; }
.chrome-dot--green  { background: #28c840; }

.dashboard-body {
    display: flex;
    min-height: 420px;
}

.dashboard-sidebar {
    width: 180px;
    flex-shrink: 0;
    background: var(--neutral-50);
    border-right: 1px solid var(--color-border);
    padding: 20px 0;
}

.dashboard-sidebar__logo {
    padding: 0 16px 18px;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 12px;
}

.dashboard-sidebar__logo img {
    height: 26px;
    width: auto;
}

.dashboard-sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 8px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--neutral-500);
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
    cursor: pointer;
}

.sidebar-link--active {
    background: var(--color-teal-bg);
    color: var(--color-teal);
    font-weight: 600;
}

.sidebar-link svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

.dashboard-main {
    flex: 1;
    padding: 22px 26px;
    overflow: hidden;
}

.dashboard-main__greeting {
    margin-bottom: 18px;
}

.dashboard-main__greeting h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 2px;
}

.dashboard-main__greeting p {
    font-size: 13px;
    color: var(--neutral-400);
}

.dashboard-kpis {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto auto;
    gap: 14px;
    margin-bottom: 14px;
}

/* Sentimento spans 2 columns on row 2 */
.dashboard-kpi-slot[data-slot="sentimento"] {
    grid-column: 1 / 3;
}

.dashboard-kpi-slot {
    border-radius: var(--radius-lg);
    min-height: 120px;
}

/* Static KPI content — hidden on desktop (animated cards fill slots instead) */
.kpi-static {
    display: none;
}

@media (max-width: 1024px) {
    .kpi-static {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        padding: 20px 16px;
        background: var(--neutral-50);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-lg);
        height: 100%;
    }

    .kpi-static__label {
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 0.05em;
        text-transform: uppercase;
        color: var(--neutral-500);
        margin-bottom: 6px;
    }

    .kpi-static__value {
        font-family: var(--font-display);
        font-size: 28px;
        font-weight: 800;
        color: var(--color-text);
        line-height: 1;
    }

    .kpi-static__value--teal {
        color: var(--color-teal);
    }

    .kpi-static__value small {
        font-size: 14px;
        font-weight: 600;
        color: var(--neutral-500);
    }

    .dashboard-kpi-slot {
        min-height: auto;
    }
}

.dashboard-insight {
    background: linear-gradient(135deg, #f0faf8, #f5fbfa);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 12px;
    display: flex;
    gap: 8px;
    align-items: flex-start;
    border: 1px solid #e0f2ef;
    font-size: 12px;
    color: var(--neutral-600);
    line-height: 1.5;
}

.dashboard-insight__icon {
    flex-shrink: 0;
}

.dashboard-charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.dashboard-chart {
    background: var(--neutral-50);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 16px;
}

.dashboard-chart h4 {
    font-size: 12px;
    font-weight: 700;
    color: var(--neutral-500);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 10px;
}

/* ---- Feature Cards (Bento Grid) ---- */
.feature-card-wrapper {
    position: relative;
}

.feature-card {
    background: var(--neutral-50);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: 28px 24px;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 300px;
    transition: height 0.6s cubic-bezier(0.22, 1, 0.36, 1),
                background 0.6s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.6s cubic-bezier(0.22, 1, 0.36, 1),
                border-color 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.feature-card--featured {
    background: #eef8fa;
    border-color: #d5eef3;
}

.feature-card__title {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.3;
    flex-shrink: 0;
    transition: color 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.feature-card__illustration {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 0;
    min-height: 0;
}

.feature-card__avatar {
    width: 160px;
    height: auto;
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.feature-card__description {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    line-height: 1.55;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    flex-shrink: 0;
    transition: max-height 0.6s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
                margin 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    margin-top: 0;
}

/* Active state — card grows upward, description slides in */
.feature-card-wrapper.is-active .feature-card {
    height: 420px;
    box-shadow: 0 24px 60px rgba(8, 145, 178, 0.12), 0 6px 16px rgba(0, 0, 0, 0.04);
    border-color: var(--color-teal);
    background: var(--color-teal-bg);
}

.feature-card-wrapper.is-active .feature-card--featured {
    background: #daf0f5;
}

.feature-card-wrapper.is-active .feature-card__title {
    color: var(--color-teal);
}

.feature-card-wrapper.is-active .feature-card__avatar {
    transform: translateY(-4px);
}

.feature-card-wrapper.is-active .feature-card__description {
    opacity: 1;
    max-height: 140px;
    margin-top: 16px;
}
