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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #f0f2f5;
    color: #1a1a1a;
    min-height: 100vh;
}

.header {
    background: linear-gradient(135deg, #075e54, #128c7e);
    color: white;
    padding: 20px 32px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.header svg { width: 36px; height: 36px; }
.header h1 { font-size: 22px; font-weight: 600; }
.header p { font-size: 13px; opacity: 0.85; margin-top: 2px; }

.tabs {
    display: flex;
    background: white;
    border-bottom: 2px solid #e8e8e8;
    position: sticky;
    top: 0;
    z-index: 10;
}

.tab {
    flex: 1;
    padding: 14px;
    text-align: center;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    color: #667;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.tab:hover { background: #f8f9fa; }
.tab.active { color: #075e54; border-bottom-color: #075e54; font-weight: 600; }

.container { max-width: 900px; margin: 0 auto; padding: 24px 16px; }

.panel { display: none; }
.panel.active { display: block; }

.card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.card h2 { font-size: 18px; margin-bottom: 6px; color: #075e54; }
.card p.subtitle { font-size: 13px; color: #888; margin-bottom: 16px; }

textarea {
    width: 100%;
    padding: 14px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
    transition: border-color 0.2s;
}

textarea:focus { outline: none; border-color: #128c7e; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 12px;
}

.btn-primary { background: #075e54; color: white; }
.btn-primary:hover { background: #064e46; }
.btn-primary:disabled { background: #aaa; cursor: not-allowed; }

.btn-danger { background: #d32f2f; color: white; }
.btn-danger:hover { background: #b71c1c; }

.loading {
    display: none;
    text-align: center;
    padding: 32px;
    color: #666;
}

.loading.show { display: block; }

.spinner {
    width: 36px; height: 36px;
    border: 3px solid #e8e8e8;
    border-top-color: #075e54;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 12px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.results { margin-top: 20px; }

.alternative {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 16px;
    border-left: 4px solid #128c7e;
}

.alternative h3 {
    font-size: 15px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-bajo { background: #e8f5e9; color: #2e7d32; }
.badge-medio { background: #fff8e1; color: #f57f17; }
.badge-alto { background: #ffebee; color: #c62828; }
.badge-utility { background: #e3f2fd; color: #1565c0; }
.badge-marketing { background: #fce4ec; color: #c62828; }

.wa-bubble {
    background: #dcf8c6;
    border-radius: 8px 8px 0 8px;
    padding: 12px 16px;
    margin: 12px 0;
    max-width: 85%;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    position: relative;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.wa-bubble::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: -8px;
    width: 0; height: 0;
    border: 8px solid transparent;
    border-left-color: #dcf8c6;
    border-bottom-color: #dcf8c6;
}

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

.wa-buttons {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
    max-width: 85%;
}

.wa-btn {
    background: white;
    border: 1px solid #d4d4d4;
    border-radius: 6px;
    padding: 8px;
    text-align: center;
    font-size: 13px;
    color: #128c7e;
    font-weight: 500;
}

.variables-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 13px;
}

.variables-table th, .variables-table td {
    padding: 6px 10px;
    border: 1px solid #e0e0e0;
    text-align: left;
}

.variables-table th { background: #f5f5f5; font-weight: 600; }

.explanation {
    margin-top: 10px;
    font-size: 13px;
    color: #555;
    padding: 10px;
    background: white;
    border-radius: 6px;
}

.problems-list {
    list-style: none;
    margin: 10px 0;
}

.problems-list li {
    padding: 6px 12px;
    margin: 4px 0;
    background: #fff3e0;
    border-radius: 6px;
    font-size: 13px;
    border-left: 3px solid #ff9800;
}

.suggestions-list li {
    background: #e8f5e9;
    border-left-color: #4caf50;
}

select {
    padding: 10px 14px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: white;
    margin-bottom: 12px;
    width: 100%;
}

select:focus { outline: none; border-color: #128c7e; }

.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: #444; }

.history-item {
    padding: 14px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.15s;
}

.history-item:hover { background: #f8f9fa; }
.history-item:last-child { border-bottom: none; }

.history-item .meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #888;
    margin-bottom: 4px;
}

.history-item .idea { font-size: 14px; }

.rejection-item {
    padding: 16px;
    border-bottom: 1px solid #eee;
}

.rejection-item:last-child { border-bottom: none; }

.rejection-item .learning {
    background: #e8f5e9;
    padding: 10px;
    border-radius: 6px;
    margin-top: 8px;
    font-size: 13px;
}

.copy-btn {
    background: none;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    color: #555;
    transition: all 0.2s;
}

.copy-btn:hover { background: #f0f0f0; border-color: #999; }

.empty-state {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 14px;
}

.section-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.section-tab {
    padding: 8px 16px;
    border-radius: 20px;
    border: 1.5px solid #ddd;
    background: white;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.section-tab.active {
    background: #075e54;
    color: white;
    border-color: #075e54;
}

@media (max-width: 600px) {
    .header { padding: 16px; }
    .header h1 { font-size: 18px; }
    .container { padding: 12px 8px; }
    .card { padding: 16px; }
    .wa-bubble { max-width: 95%; }
}
