/* ========================================
   ENCUESTA INSIGHTS — Data Visualizations
   Ideas 1, 3, 4, 5, 6
   ======================================== */

/* ── Shared Section Base ── */
.insights-section {
    padding: 5rem 0;
    position: relative;
    overflow: hidden;
}

.insights-section .section-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.2rem;
    border-radius: 25px;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.insights-header {
    text-align: center;
    margin-bottom: 3rem;
}

.insights-header h2 {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.insights-header p {
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
    font-size: 1.05rem;
}

/* ════════════════════════════════════════
   1. GRÁFICA INTERACTIVA — Barras animadas
   ════════════════════════════════════════ */
.chart-section {
    background: linear-gradient(180deg, #0a0a0a 0%, #111827 100%);
    color: #fff;
}

.chart-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    max-width: 1000px;
    margin: 0 auto;
}

.chart-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    padding: 2rem;
    backdrop-filter: blur(10px);
}

.chart-card h3 {
    font-size: 1.1rem;
    color: #fff;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chart-card h3 i {
    color: var(--primary);
    font-size: 0.9rem;
}

.bar-chart {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.bar-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.bar-label {
    min-width: 85px;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.5);
    text-align: right;
}

.bar-track {
    flex: 1;
    height: 28px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 14px;
    overflow: hidden;
    position: relative;
}

.bar-fill {
    height: 100%;
    border-radius: 14px;
    width: 0;
    transition: width 1.5s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
}

.bar-fill.animated {
    /* width set inline */
}

.bar-fill span {
    font-size: 0.72rem;
    font-weight: 700;
    color: #fff;
    opacity: 0;
    transition: opacity 0.5s ease 1.2s;
}

.bar-fill.animated span {
    opacity: 1;
}

/* Bar colors by data type */
.bar-fill.bg-green { background: linear-gradient(90deg, rgba(16, 185, 129, 0.7), #10B981); }
.bar-fill.bg-blue { background: linear-gradient(90deg, rgba(81, 155, 233, 0.7), #519BE9); }
.bar-fill.bg-coral { background: linear-gradient(90deg, rgba(212, 74, 89, 0.7), #D44A59); }
.bar-fill.bg-amber { background: linear-gradient(90deg, rgba(245, 158, 11, 0.7), #F59E0B); }
.bar-fill.bg-purple { background: linear-gradient(90deg, rgba(139, 92, 246, 0.7), #8B5CF6); }
.bar-fill.bg-teal { background: linear-gradient(90deg, rgba(20, 184, 166, 0.7), #14B8A6); }

/* ════════════════════════════════════════
   3. MAPA DE CALOR — Stacked bars
   ════════════════════════════════════════ */
.heatmap-section {
    background: #0d1117;
    color: #fff;
    padding: 5rem 0;
}

.heatmap-container {
    max-width: 900px;
    margin: 0 auto;
}

.heatmap-row {
    margin-bottom: 1.5rem;
}

.heatmap-question {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.heatmap-bar {
    display: flex;
    height: 36px;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.heatmap-segment {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
    transition: width 1.5s cubic-bezier(0.16, 1, 0.3, 1);
    width: 0;
    min-width: 0;
    cursor: default;
    position: relative;
}

.heatmap-segment.animated {
    /* width set inline */
}

.heatmap-segment:hover {
    filter: brightness(1.15);
}

.heatmap-segment .seg-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a2e;
    color: #fff;
    padding: 0.4rem 0.7rem;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.heatmap-segment:hover .seg-tooltip {
    opacity: 1;
}

/* Heatmap colors: score 1-5 */
.seg-1 { background: #EF4444; }
.seg-2 { background: #F59E0B; }
.seg-3 { background: #FBBF24; }
.seg-4 { background: #34D399; }
.seg-5 { background: #10B981; }

/* Heatmap legend */
.heatmap-legend {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.heatmap-legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.5);
}

.heatmap-legend-item .leg-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

/* ════════════════════════════════════════
   4. NUBE DE PALABRAS — Word Cloud
   ════════════════════════════════════════ */
.wordcloud-section {
    background: linear-gradient(180deg, #111827 0%, #0a0a0a 100%);
    color: #fff;
    padding: 5rem 0;
    overflow: hidden;
}

.wordcloud-container {
    position: relative;
    min-height: 320px;
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.wc-word {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 8px;
    font-weight: 600;
    opacity: 0;
    animation: wordPop 8s ease-in-out infinite;
    cursor: default;
    transition: transform 0.3s ease, text-shadow 0.3s ease;
    text-transform: capitalize;
}

.wc-word:hover {
    transform: scale(1.15) !important;
    text-shadow: 0 0 20px currentColor;
}

/* Word sizes */
.wc-xl { font-size: 2.2rem; color: #10B981; }
.wc-lg { font-size: 1.6rem; color: #519BE9; }
.wc-md { font-size: 1.15rem; color: #D44A59; }
.wc-sm { font-size: 0.9rem; color: rgba(255, 255, 255, 0.45); }
.wc-xs { font-size: 0.75rem; color: rgba(255, 255, 255, 0.3); }

@keyframes wordPop {
    0%   { opacity: 0; transform: scale(0.8) translateY(10px); }
    10%  { opacity: 1; transform: scale(1) translateY(0); }
    80%  { opacity: 1; transform: scale(1) translateY(0); }
    90%  { opacity: 0; transform: scale(0.9) translateY(-8px); }
    100% { opacity: 0; transform: scale(0.8) translateY(10px); }
}

/* Stagger delays */
.wc-word:nth-child(1)  { animation-delay: 0s; }
.wc-word:nth-child(2)  { animation-delay: 0.5s; }
.wc-word:nth-child(3)  { animation-delay: 1s; }
.wc-word:nth-child(4)  { animation-delay: 1.5s; }
.wc-word:nth-child(5)  { animation-delay: 0.3s; }
.wc-word:nth-child(6)  { animation-delay: 0.8s; }
.wc-word:nth-child(7)  { animation-delay: 1.3s; }
.wc-word:nth-child(8)  { animation-delay: 1.8s; }
.wc-word:nth-child(9)  { animation-delay: 0.6s; }
.wc-word:nth-child(10) { animation-delay: 1.1s; }
.wc-word:nth-child(11) { animation-delay: 1.6s; }
.wc-word:nth-child(12) { animation-delay: 2.1s; }
.wc-word:nth-child(13) { animation-delay: 0.4s; }
.wc-word:nth-child(14) { animation-delay: 0.9s; }
.wc-word:nth-child(15) { animation-delay: 1.4s; }
.wc-word:nth-child(16) { animation-delay: 1.9s; }
.wc-word:nth-child(17) { animation-delay: 2.4s; }
.wc-word:nth-child(18) { animation-delay: 0.2s; }
.wc-word:nth-child(19) { animation-delay: 0.7s; }
.wc-word:nth-child(20) { animation-delay: 1.2s; }
.wc-word:nth-child(21) { animation-delay: 1.7s; }
.wc-word:nth-child(22) { animation-delay: 2.2s; }
.wc-word:nth-child(23) { animation-delay: 2.7s; }
.wc-word:nth-child(24) { animation-delay: 0.15s; }
.wc-word:nth-child(25) { animation-delay: 0.65s; }

/* ════════════════════════════════════════
   5. NOTIFICACIÓN PUSH SIMULADA — Phone Mock
   ════════════════════════════════════════ */
.phone-mock-section {
    padding: 5rem 0;
    background: linear-gradient(180deg, var(--light-bg) 0%, #f0f4ff 100%);
    position: relative;
}

.phone-mock-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    max-width: 1000px;
    margin: 0 auto;
}

.phone-mock-text h2 {
    font-size: 2.4rem;
    color: var(--dark);
    margin-bottom: 1rem;
}

.phone-mock-text p {
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.phone-mock-features {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.phone-feature-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    color: var(--text-dark);
}

.phone-feature-item i {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: #fff;
    background: var(--primary);
    flex-shrink: 0;
}

/* Phone frame */
.phone-frame {
    width: 280px;
    height: 560px;
    margin: 0 auto;
    background: #1a1a2e;
    border-radius: 36px;
    padding: 12px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25), 0 0 0 2px rgba(255, 255, 255, 0.1);
    position: relative;
}

.phone-screen {
    width: 100%;
    height: 100%;
    background: #0f0f1a;
    border-radius: 26px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

.phone-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1.2rem;
    font-size: 0.65rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
}

.phone-status-bar .time { font-weight: 700; }
.phone-status-bar .icons { display: flex; gap: 0.3rem; }

.phone-notch {
    width: 80px;
    height: 22px;
    background: #1a1a2e;
    border-radius: 0 0 12px 12px;
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
}

/* WhatsApp-like Chat UI */
.chat-ui { flex: 1; display: flex; flex-direction: column; background: #0f111a; background-image: radial-gradient(rgba(255,255,255,0.03) 1px, transparent 0); background-size: 20px 20px; }
.chat-header { display: flex; align-items: center; gap: 0.6rem; padding: 0.8rem; background: #1a1e29; border-bottom: 1px solid rgba(255,255,255,0.05); }
.chat-back { color: var(--primary); font-size: 0.9rem; }
.chat-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #10B981, #059669); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 0.8rem; }
.chat-info { display: flex; flex-direction: column; flex: 1; }
.chat-name { font-size: 0.8rem; font-weight: 600; color: #fff; }
.chat-status { font-size: 0.6rem; color: rgba(255,255,255,0.5); }
.chat-opts { color: rgba(255,255,255,0.5); font-size: 0.8rem; padding: 0 0.4rem; }
.chat-body { flex: 1; padding: 1rem 0.8rem; display: flex; flex-direction: column; gap: 0.8rem; overflow-y: auto; }
.chat-date { text-align: center; font-size: 0.6rem; font-weight: 600; color: rgba(255,255,255,0.4); background: rgba(255,255,255,0.05); padding: 0.2rem 0.6rem; border-radius: 10px; align-self: center; margin-bottom: 0.5rem; }
.chat-msg { display: flex; max-width: 85%; opacity: 0; animation-fill-mode: forwards; }
.bot-msg { align-self: flex-start; animation: msgInLeft 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
.user-msg { align-self: flex-end; animation: msgInRight 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
.msg-bubble { padding: 0.6rem 0.8rem; border-radius: 12px; font-size: 0.72rem; line-height: 1.4; color: #fff; position: relative; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.bot-msg .msg-bubble { background: #1e293b; border-top-left-radius: 2px; }
.user-msg .msg-bubble { background: #059669; border-top-right-radius: 2px; }
.msg-bubble strong { color: #10B981; display: block; margin-bottom: 0.2rem; font-size: 0.75rem; }
.user-msg .msg-bubble strong { color: #a7f3d0; }
.msg-time { display: flex; justify-content: flex-end; align-items: center; font-size: 0.55rem; color: rgba(255,255,255,0.4); margin-top: 0.3rem; }
.user-msg .msg-time { color: rgba(255,255,255,0.7); }
.read { color: #60a5fa; margin-left: 0.2rem; }
.chat-input-area { display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem 0.8rem; background: #1a1e29; color: rgba(255,255,255,0.5); font-size: 0.9rem; }
.chat-input-pill { flex: 1; background: #0f111a; border-radius: 20px; padding: 0.4rem 0.8rem; font-size: 0.7rem; color: rgba(255,255,255,0.4); }
.animate-msg-1 { animation-delay: 1.5s; }
.animate-msg-2 { animation-delay: 3.5s; }
.animate-msg-3 { animation-delay: 6s; }
@keyframes msgInLeft { 0% { opacity: 0; transform: translateX(-15px) scale(0.9); } 100% { opacity: 1; transform: translateX(0) scale(1); } }
@keyframes msgInRight { 0% { opacity: 0; transform: translateX(15px) scale(0.9); } 100% { opacity: 1; transform: translateX(0) scale(1); } }
/* ════════════════════════════════════════
   6. PREOCUPACIONES VS SOLUCIONES
   ════════════════════════════════════════ */
.concerns-section {
    padding: 5rem 0;
    background: linear-gradient(180deg, #f8f9fa 0%, #fff 50%, #f5f9ff 100%);
}

.concerns-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
}

.concern-card {
    background: #fff;
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.concern-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(81, 155, 233, 0.12);
    border-color: var(--primary);
}

.concern-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 20px 20px 0 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.concern-card:hover::before {
    opacity: 1;
}

.concern-worry {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.08);
}

.concern-worry-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: rgba(212, 74, 89, 0.1);
    color: #D44A59;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.concern-worry-text {
    font-size: 0.92rem;
    color: var(--text-muted);
    font-style: italic;
    line-height: 1.5;
}

.concern-worry-text strong {
    color: var(--text-dark);
    font-style: normal;
}

.concern-solution {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.concern-solution-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: rgba(16, 185, 129, 0.1);
    color: #10B981;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.concern-solution-text {
    font-size: 0.92rem;
    color: var(--text-dark);
    line-height: 1.5;
    font-weight: 500;
}

.concern-solution-text .feature-tag {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    background: rgba(81, 155, 233, 0.08);
    border: 1px solid rgba(81, 155, 233, 0.15);
    border-radius: 6px;
    font-size: 0.72rem;
    color: var(--primary);
    font-weight: 600;
    margin-left: 0.3rem;
    vertical-align: middle;
}

/* ── Responsive for all sections ── */
@media (max-width: 768px) {
    .insights-header h2 { font-size: 2rem; }
    .chart-grid { grid-template-columns: 1fr; gap: 2rem; }
    .phone-mock-layout { grid-template-columns: 1fr; gap: 2rem; text-align: center; }
    .phone-mock-text { order: 1; }
    .phone-frame { order: 2; width: 240px; height: 480px; }
    .phone-mock-features { align-items: center; }
    .concerns-grid { grid-template-columns: 1fr; }
    .bar-label { min-width: 70px; font-size: 0.75rem; }
    .wordcloud-container { min-height: 240px; }
    .wc-xl { font-size: 1.6rem; }
    .wc-lg { font-size: 1.2rem; }
}

@media (max-width: 480px) {
    .phone-frame { width: 220px; height: 440px; }
    .wc-xl { font-size: 1.3rem; }
    .wc-lg { font-size: 1rem; }
    .wc-md { font-size: 0.85rem; }
    .heatmap-bar { height: 28px; }
    .heatmap-segment { font-size: 0.6rem; }
}
