/* ============================================
   PADRONIZAÇÃO VISUAL ENTRE TEMAS
   Garante que linhas e botões mantenham o mesmo formato
   nos modos claro e escuro
   ============================================ */

/* ==================== BOTÕES ==================== */

/* Garantir border-radius consistente em todos os botões */
button,
.btn,
input[type="button"],
input[type="submit"],
a.btn,
a.button {
    border-radius: 50px !important;
    transition: all 0.3s ease !important;
}

/* Botões no modo claro */
body:not(.dark-theme) button,
body:not(.dark-theme) .btn,
body:not(.dark-theme) input[type="button"],
body:not(.dark-theme) input[type="submit"] {
    border-radius: 50px !important;
}

/* Botões no modo escuro */
body.dark-theme button,
body.dark-theme .btn,
body.dark-theme input[type="button"],
body.dark-theme input[type="submit"],
body.dark-theme a.btn,
body.dark-theme a.button {
    border-radius: 50px !important;
    border: 1px solid #505050 !important;
}

/* Botões específicos do sistema de anamnese */
.btn-primary,
.btn-secondary,
.btn-success,
.btn-danger,
.btn-warning,
.btn-info,
.btn-light,
.btn-dark,
.btn-logout,
.btn-generate,
.login-btn,
.submit-btn {
    border-radius: 50px !important;
}

/* Botões em modo escuro */
body.dark-theme .btn-primary,
body.dark-theme .btn-secondary,
body.dark-theme .btn-success,
body.dark-theme .btn-danger,
body.dark-theme .btn-warning,
body.dark-theme .btn-info,
body.dark-theme .btn-light,
body.dark-theme .btn-dark,
body.dark-theme .btn-logout,
body.dark-theme .btn-generate,
body.dark-theme .login-btn,
body.dark-theme .submit-btn {
    border-radius: 50px !important;
    border: 1px solid #505050 !important;
}

/* ==================== INPUTS E CAMPOS ==================== */

/* Inputs mantêm border-radius menor para melhor usabilidade */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
textarea,
select {
    border-radius: 10px !important;
    transition: all 0.3s ease !important;
}

/* Inputs no modo claro */
body:not(.dark-theme) input[type="text"],
body:not(.dark-theme) input[type="email"],
body:not(.dark-theme) input[type="tel"],
body:not(.dark-theme) input[type="password"],
body:not(.dark-theme) input[type="number"],
body:not(.dark-theme) input[type="date"],
body:not(.dark-theme) input[type="time"],
body:not(.dark-theme) textarea,
body:not(.dark-theme) select {
    border: 1px solid #ddd !important;
    background: white !important;
}

/* Inputs no modo escuro */
body.dark-theme input[type="text"],
body.dark-theme input[type="email"],
body.dark-theme input[type="tel"],
body.dark-theme input[type="password"],
body.dark-theme input[type="number"],
body.dark-theme input[type="date"],
body.dark-theme input[type="time"],
body.dark-theme textarea,
body.dark-theme select {
    border: 1px solid #404040 !important;
    background: #2a2a2a !important;
    color: #e0e0e0 !important;
    border-radius: 10px !important;
}

/* ==================== LINHAS E DIVISORES ==================== */

/* Linhas horizontais (hr) */
hr {
    border: none !important;
    border-top: 1px solid #e0e0e0 !important;
    margin: 1.5rem 0 !important;
}

body.dark-theme hr {
    border-top-color: #404040 !important;
}

/* Borders de divisão em cards e containers */
.card,
.anamnese-card,
.modal,
.modal-content,
.stat-card,
.info-box {
    border-radius: 15px !important;
}

body.dark-theme .card,
body.dark-theme .anamnese-card,
body.dark-theme .modal,
body.dark-theme .modal-content,
body.dark-theme .stat-card,
body.dark-theme .info-box {
    border: none !important;
    border-radius: 15px !important;
}

/* Exceção: modais mantêm borda sutil */
body.dark-theme .modal,
body.dark-theme .modal-content {
    border: 1px solid #404040 !important;
}

/* ==================== TABELAS E LISTAS ==================== */

/* Linhas de tabela */
table tr,
.anamnese-item,
.list-item {
    border-bottom: 1px solid #e0e0e0 !important;
}

body.dark-theme table tr,
body.dark-theme .anamnese-item,
body.dark-theme .list-item {
    border-bottom: 1px solid #404040 !important;
}

/* Cabeçalhos de tabela */
table thead tr,
.table-header {
    border-bottom: 2px solid #B8A1D9 !important;
}

body.dark-theme table thead tr,
body.dark-theme .table-header {
    border-bottom: 2px solid #9B7FC7 !important;
}

/* ==================== CARDS DE ANAMNESE ==================== */

/* Header do card de anamnese */
.anamnese-header {
    border-bottom: 1px solid #e0e0e0 !important;
}

body.dark-theme .anamnese-header {
    border-bottom: 1px solid #404040 !important;
}

/* Section headers */
.section-title,
.form-section h3,
h3[style*="border-bottom"] {
    border-bottom: 1px solid #e0e0e0 !important;
}

body.dark-theme .section-title,
body.dark-theme .form-section h3,
body.dark-theme h3[style*="border-bottom"] {
    border-bottom: 1px solid #404040 !important;
}

/* ==================== MODAIS ==================== */

/* Headers e footers de modais */
.modal-header {
    border-bottom: 1px solid #e0e0e0 !important;
    border-radius: 15px 15px 0 0 !important;
}

.modal-footer {
    border-top: 1px solid #e0e0e0 !important;
    border-radius: 0 0 15px 15px !important;
}

body.dark-theme .modal-header {
    border-bottom: 1px solid #404040 !important;
}

body.dark-theme .modal-footer {
    border-top: 1px solid #404040 !important;
}

/* ==================== AVATARES E BADGES ==================== */

/* Avatares e iniciais */
.avatar,
.avatar-initials {
    border-radius: 50% !important;
}

/* Badges e etiquetas */
.badge,
.status-badge,
.tag {
    border-radius: 20px !important;
}

body.dark-theme .badge,
body.dark-theme .status-badge,
body.dark-theme .tag {
    border: 1px solid #404040 !important;
    border-radius: 20px !important;
}

/* ==================== CARDS ESPECÍFICOS ==================== */

/* Stats cards */
.stats-grid .stat-card {
    border-radius: 15px !important;
}

body.dark-theme .stats-grid .stat-card {
    border: none !important;
    border-radius: 15px !important;
}

/* Header dos cards */
.header,
.page-header,
.section-header {
    border-bottom: 2px solid #e0e0e0 !important;
}

body.dark-theme .header,
body.dark-theme .page-header,
body.dark-theme .section-header {
    border-bottom: 2px solid #404040 !important;
}

/* ==================== FORMULÁRIOS ==================== */

/* Grupos de formulário */
.form-group {
    margin-bottom: 1.5rem;
}

/* Labels */
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

body.dark-theme .form-group label {
    color: #e0e0e0;
}

/* Mensagens de erro */
.error-message,
.alert-error {
    border-radius: 10px !important;
    border-left: 4px solid #f44336 !important;
}

body.dark-theme .error-message,
body.dark-theme .alert-error {
    background: rgba(244, 67, 54, 0.1) !important;
    border-radius: 10px !important;
}

/* Mensagens de sucesso */
.success-message,
.alert-success {
    border-radius: 10px !important;
    border-left: 4px solid #9B7FC7 !important;
}

body.dark-theme .success-message,
body.dark-theme .alert-success {
    background: rgba(155, 127, 199, 0.1) !important;
    border-radius: 10px !important;
}

/* ==================== TOOLTIPS E NOTIFICAÇÕES ==================== */

.tooltip,
.notification {
    border-radius: 10px !important;
}

body.dark-theme .tooltip,
body.dark-theme .notification {
    border: 1px solid #404040 !important;
    border-radius: 10px !important;
}

/* ==================== ANAMNESE CARDS - CORREÇÃO ESPECÍFICA ==================== */

/* Corrigir linhas divisórias nos cards de anamnese */
.anamnese-card,
.anamnese-card .anamnese-header,
.anamnese-card > div:first-child {
    border-bottom-width: 1px !important;
}

body:not(.dark-theme) .anamnese-card,
body:not(.dark-theme) .anamnese-card .anamnese-header,
body:not(.dark-theme) .anamnese-card > div:first-child {
    border-bottom-color: #e0e0e0 !important;
}

body.dark-theme .anamnese-card,
body.dark-theme .anamnese-card .anamnese-header,
body.dark-theme .anamnese-card > div:first-child {
    border-bottom-color: #404040 !important;
}

/* Cards de anamnese - sem borda no modo escuro */
body.dark-theme .anamnese-card {
    border: none !important;
}

/* Títulos de seção dentro de formulários */
.form-section > h3,
.anamnese-section > h3,
.section-title,
.detail-section h3,
h3[style*="border"] {
    border-bottom-style: solid !important;
}

/* Títulos principais mantêm 2px lilás */
.section-title,
.detail-section h3,
body:not(.dark-theme) .section-title,
body:not(.dark-theme) .detail-section h3 {
    border-bottom-width: 2px !important;
    border-bottom-color: #B8A1D9 !important;
}

body.dark-theme .section-title,
body.dark-theme .detail-section h3 {
    border-bottom-width: 2px !important;
    border-bottom-color: #9B7FC7 !important;
}

/* Títulos secundários mantêm 1px */
.form-section > h3,
.anamnese-section > h3,
h3[style*="border"]:not(.section-title):not(.detail-section h3) {
    border-bottom-width: 1px !important;
}

body:not(.dark-theme) .form-section > h3,
body:not(.dark-theme) .anamnese-section > h3 {
    border-bottom-color: #e0e0e0 !important;
}

body.dark-theme .form-section > h3,
body.dark-theme .anamnese-section > h3 {
    border-bottom-color: #404040 !important;
}

/* Linhas de separação dentro de cards */
.anamnese-card hr,
.card hr,
.modal-content hr {
    border-top-width: 1px !important;
    border-bottom: none !important;
    border-left: none !important;
    border-right: none !important;
}

body:not(.dark-theme) .anamnese-card hr,
body:not(.dark-theme) .card hr,
body:not(.dark-theme) .modal-content hr {
    border-top-color: #e0e0e0 !important;
}

body.dark-theme .anamnese-card hr,
body.dark-theme .card hr,
body.dark-theme .modal-content hr {
    border-top-color: #404040 !important;
}

/* ==================== HERO SECTION - CORREÇÕES ESPECÍFICAS ==================== */

/* Badge "Nutrição & Treino Personalizado" */
.hero-badge {
    border-radius: 50px !important;
}

body.dark-theme .hero-badge {
    border-radius: 50px !important;
    background: linear-gradient(135deg, rgba(184, 161, 217, 0.2) 0%, rgba(155, 127, 199, 0.2) 100%);
    color: #DCCFF2;
    border: 1px solid rgba(184, 161, 217, 0.3);
}

/* Formas/Shapes de fundo - sempre circulares */
.shape,
.shape-1,
.shape-2,
.shape-3 {
    border-radius: 50% !important;
}

body.dark-theme .shape,
body.dark-theme .shape-1,
body.dark-theme .shape-2,
body.dark-theme .shape-3 {
    border-radius: 50% !important;
}

/* ==================== NAVBAR - CORREÇÕES ESPECÍFICAS ==================== */

/* Logo na navbar - tamanho consistente */
.nav-logo img {
    height: 96px !important;
    width: auto !important;
    filter: brightness(0.72) saturate(1.3) !important;
    transition: filter 0.3s ease !important;
}

.nav-logo img:hover {
    filter: brightness(0.6) saturate(1.4) !important;
}

body.dark-theme .nav-logo img {
    height: 96px !important;
    width: auto !important;
    background: rgba(255, 255, 255, 0.95) !important;
    padding: 0.5rem !important;
    border-radius: 10px !important;
    box-sizing: content-box !important;
}

@media (max-width: 768px) {
    .nav-logo img {
        height: 56px !important;
    }
    body.dark-theme .nav-logo img {
        height: 56px !important;
    }
}

/* ==================== FOOTER - CORREÇÕES ESPECÍFICAS ==================== */

/* Logo no footer - visível em modo escuro */
.footer-brand img {
    height: 50px;
    margin-bottom: 1rem;
}

body.dark-theme .footer-brand img {
    height: 50px !important;
    filter: none !important;
    background: rgba(255, 255, 255, 0.95) !important;
    padding: 0.75rem !important;
    border-radius: 12px !important;
    box-shadow: none;
    box-sizing: content-box !important;
}

/* ==================== CARDS DE SERVIÇOS - LEGIBILIDADE ==================== */

/* Cards de serviços no modo escuro - texto legível */
body.dark-theme .servico-card {
    background: transparent !important;
    border: none !important;
}

body.dark-theme .servico-card h3 {
    color: #f0f0f0 !important;
}

body.dark-theme .servico-card > p {
    color: #b0b0b0 !important;
}

body.dark-theme .servico-card .servico-features li {
    color: #c0c0c0 !important;
}

body.dark-theme .servico-card .servico-icon {
    background: rgba(184, 161, 217, 0.2) !important;
}

body.dark-theme .servico-card .servico-icon svg {
    stroke: #B8A1D9 !important;
}

/* Card featured no modo escuro - lilás */
body.dark-theme .servico-card.featured {
    background: linear-gradient(135deg, #9B7FC7 0%, #7A5FA8 100%) !important;
    border: 1px solid #B8A1D9 !important;
}

body.dark-theme .servico-card.featured h3,
body.dark-theme .servico-card.featured p,
body.dark-theme .servico-card.featured .servico-features li {
    color: #ffffff !important;
}

body.dark-theme .servico-card.featured .servico-icon {
    background: rgba(255, 255, 255, 0.2) !important;
}

body.dark-theme .servico-card.featured .servico-icon svg {
    stroke: #ffffff !important;
}

/* Botão "Contato" na navbar */
.nav-link.nav-cta {
    background: linear-gradient(135deg, #B8A1D9 0%, #9B7FC7 100%);
    color: #ffffff;
    padding: 0.75rem 1.5rem;
    border-radius: 50px !important;
    border: none;
}

.nav-link.nav-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(155, 127, 199, 0.3);
    background: linear-gradient(135deg, #9B7FC7 0%, #7A5FA8 100%);
}

body.dark-theme .nav-link.nav-cta {
    background: linear-gradient(135deg, #9B7FC7 0%, #7A5FA8 100%);
    color: #ffffff;
    border-radius: 50px !important;
    border: 1px solid #B8A1D9;
}

body.dark-theme .nav-link.nav-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(155, 127, 199, 0.4);
    background: linear-gradient(135deg, #7A5FA8 0%, #9B7FC7 100%);
    border-color: #DCCFF2;
}

/* ==================== GARANTIR TRANSIÇÕES SUAVES ==================== */

button,
.btn,
input,
textarea,
select,
.card,
.modal,
hr,
.badge {
    transition: all 0.3s ease !important;
}

/* ==================== FOCO E HOVER CONSISTENTES ==================== */

/* Estado de foco */
input:focus,
textarea:focus,
select:focus,
button:focus,
.btn:focus {
    outline: 2px solid #9B7FC7 !important;
    outline-offset: 2px !important;
}

body.dark-theme input:focus,
body.dark-theme textarea:focus,
body.dark-theme select:focus,
body.dark-theme button:focus,
body.dark-theme .btn:focus {
    outline: 2px solid #B8A1D9 !important;
    outline-offset: 2px !important;
}

/* Estado de hover em botões */
button:hover,
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

body.dark-theme button:hover,
body.dark-theme .btn:hover {
    box-shadow: none;
}
