/* ===== Vibe Saúde - Estilo Global ===== */

:root {
    --primary: #0f766e;
    --primary-dark: #115e59;
    --primary-light: #14b8a6;
    --secondary: #8b5cf6;
    --accent: #f59e0b;
    --danger: #dc2626;
    --success: #16a34a;
    --bg: #f0fdfa;
    --bg-card: #ffffff;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow: 0 4px 12px rgba(15, 118, 110, 0.08);
    --shadow-lg: 0 10px 30px rgba(15, 118, 110, 0.15);
    --radius: 16px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f0fdfa 0%, #ecfeff 100%);
    color: var(--text);
    min-height: 100vh;
    padding-bottom: 80px;
}

/* ===== Topbar ===== */
.topbar {
    background: white;
    padding: 16px 20px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar h1 {
    font-size: 20px;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar h1::before {
    content: "💚";
    font-size: 24px;
}

.topbar-actions a {
    color: var(--text-muted);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s;
    font-size: 14px;
    margin-left: 4px;
}

.topbar-actions a:hover {
    background: var(--bg);
    color: var(--primary);
}

/* ===== Container ===== */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 20px;
}

.page-title {
    font-size: 28px;
    margin-bottom: 8px;
    color: var(--text);
}

.page-subtitle {
    color: var(--text-muted);
    margin-bottom: 28px;
}

/* ===== Cards ===== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.card-title {
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===== Auth ===== */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #0f766e 0%, #14b8a6 50%, #06b6d4 100%);
}

.auth-card {
    background: white;
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 420px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo .emoji {
    font-size: 56px;
    margin-bottom: 8px;
}

.auth-logo h1 {
    color: var(--primary);
    font-size: 28px;
}

.auth-logo p {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 4px;
}

/* ===== Forms ===== */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 13px 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.2s;
    background: white;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 22px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg);
    color: var(--primary);
}

.btn-secondary:hover {
    background: #ccfbf1;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
}

.btn-link {
    background: none;
    color: var(--primary);
    text-decoration: none;
    text-align: center;
    display: block;
    padding: 10px;
    margin-top: 12px;
    font-size: 14px;
}

.btn-link:hover {
    text-decoration: underline;
}

/* ===== Dashboard Grid ===== */
.greeting {
    margin-bottom: 24px;
}

.greeting h2 {
    font-size: 26px;
    margin-bottom: 4px;
}

.greeting p {
    color: var(--text-muted);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.dash-card {
    background: white;
    padding: 22px;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow);
    transition: all 0.2s;
    border: 2px solid transparent;
    cursor: pointer;
}

.dash-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.dash-card .icon {
    font-size: 38px;
    margin-bottom: 12px;
}

.dash-card h3 {
    font-size: 16px;
    margin-bottom: 4px;
    color: var(--text);
}

.dash-card p {
    font-size: 13px;
    color: var(--text-muted);
}

/* ===== Triagem Alimentar ===== */
.action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.action-btn {
    padding: 24px 16px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.2s;
    color: white;
    font-family: inherit;
}

.action-btn .emoji {
    display: block;
    font-size: 36px;
    margin-bottom: 8px;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-fome { background: linear-gradient(135deg, #f59e0b, #d97706); }
.btn-satisfeito { background: linear-gradient(135deg, #14b8a6, #0d9488); }
.btn-comer { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }

/* ===== Alerts ===== */
.alert {
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 16px;
    border-left: 4px solid;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-warning {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #92400e;
}

.alert-success {
    background: #d1fae5;
    border-color: #16a34a;
    color: #065f46;
}

.alert-info {
    background: #dbeafe;
    border-color: #3b82f6;
    color: #1e3a8a;
}

.alert-danger {
    background: #fee2e2;
    border-color: #dc2626;
    color: #991b1b;
}

/* ===== Mapa de Dor ===== */
.body-map-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.body-svg {
    max-width: 280px;
    width: 100%;
    height: auto;
}

.body-region {
    fill: #cbd5e1;
    stroke: #64748b;
    stroke-width: 1.5;
    cursor: pointer;
    transition: all 0.2s;
}

.body-region:hover {
    fill: #fca5a5;
}

.body-region.selected {
    fill: var(--danger);
    stroke: #7f1d1d;
}

.intensity-slider {
    width: 100%;
    margin: 16px 0;
}

.intensity-display {
    font-size: 48px;
    font-weight: bold;
    color: var(--danger);
    text-align: center;
    margin: 8px 0;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0;
}

.tag {
    padding: 8px 14px;
    border-radius: 20px;
    background: var(--bg);
    color: var(--text);
    border: 2px solid var(--border);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    user-select: none;
}

.tag.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ===== Medicamentos ===== */
.med-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.med-item {
    background: white;
    padding: 18px;
    border-radius: var(--radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow);
    flex-wrap: wrap;
}

.med-info h4 {
    font-size: 16px;
    margin-bottom: 4px;
}

.med-info p {
    font-size: 13px;
    color: var(--text-muted);
}

.med-info .horario {
    color: var(--primary);
    font-weight: 600;
}

.med-actions {
    display: flex;
    gap: 8px;
}

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.modal {
    background: white;
    border-radius: var(--radius);
    padding: 28px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 30px 80px rgba(0,0,0,0.3);
}

.modal h3 {
    margin-bottom: 18px;
    font-size: 20px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-actions .btn {
    flex: 1;
}

.hidden {
    display: none !important;
}

/* ===== Dump Mental ===== */
.audio-recorder {
    text-align: center;
    padding: 24px;
}

.record-btn {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: none;
    background: var(--danger);
    color: white;
    font-size: 36px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.3);
}

.record-btn:hover { transform: scale(1.05); }
.record-btn.recording { animation: pulse 1.5s infinite; }

@keyframes pulse {
    0% { box-shadow: 0 6px 20px rgba(220, 38, 38, 0.5); }
    50% { box-shadow: 0 6px 30px rgba(220, 38, 38, 0.8); }
    100% { box-shadow: 0 6px 20px rgba(220, 38, 38, 0.5); }
}

.timer {
    font-size: 28px;
    font-family: monospace;
    margin: 14px 0;
    color: var(--text);
}

.mood-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    gap: 10px;
    margin: 16px 0;
}

.mood-btn {
    background: white;
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 12px 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 12px;
    color: var(--text-muted);
    font-family: inherit;
}

.mood-btn .emoji {
    display: block;
    font-size: 30px;
    margin-bottom: 4px;
}

.mood-btn.selected {
    border-color: var(--primary);
    background: #ccfbf1;
    color: var(--primary);
}

.energy-display {
    text-align: center;
    margin: 12px 0;
    font-size: 20px;
    color: var(--text-muted);
}

/* ===== Relatórios ===== */
.report-types {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.report-type {
    padding: 18px;
    background: white;
    border: 2px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.report-type.selected {
    border-color: var(--primary);
    background: #ccfbf1;
}

.report-type .icon { font-size: 28px; margin-bottom: 6px; }
.report-type h4 { font-size: 14px; }

/* ===== Histórico ===== */
.history-list {
    list-style: none;
}

.history-item {
    background: white;
    padding: 14px 16px;
    border-radius: 10px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.history-item .info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.history-item .badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-fome { background: #fef3c7; color: #92400e; }
.badge-satisfeito { background: #d1fae5; color: #065f46; }
.badge-refeicao { background: #ede9fe; color: #5b21b6; }
.badge-tomado { background: #d1fae5; color: #065f46; }
.badge-adiado { background: #fef3c7; color: #92400e; }

.time { color: var(--text-muted); font-size: 13px; }

/* ===== Chart container ===== */
.chart-container {
    position: relative;
    height: 280px;
    margin: 10px 0;
}

/* ===== Print styles ===== */
@media print {
    .no-print { display: none !important; }
    body { background: white; padding: 0; }
    .topbar { display: none; }
    .card { box-shadow: none; border: 1px solid #ddd; page-break-inside: avoid; }
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
    .container { padding: 16px; }
    .page-title { font-size: 22px; }
    .auth-card { padding: 28px 22px; }
    .card { padding: 18px; }
    .topbar { padding: 14px 16px; }
    .topbar h1 { font-size: 18px; }
}

/* ===== Loading ===== */
.spinner {
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

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

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state .emoji {
    font-size: 48px;
    margin-bottom: 12px;
}
