/* ConfereAI - Estilos Personalizados */
/* Paleta de cores baseada em #08275a */

:root {
  --primary-color: #08275a;
  --primary-light: #0d3a7a;
  --primary-dark: #051a3f;
  --primary-light-alt: #0a3068;
  --secondary-color: #6c757d;
  --success-color: #198754;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --info-color: #0dcaf0;
  --light-color: #f8f9fa;
  --dark-color: #212529;
  --white: #ffffff;
  --gray-100: #f8f9fa;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-400: #ced4da;
  --gray-500: #adb5bd;
  --gray-600: #6c757d;
  --gray-700: #495057;
  --gray-800: #343a40;
  --gray-900: #212529;
}

/* Reset e configurações globais */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--dark-color);
  background-color: var(--gray-100);
  padding-top: 76px; /* Compensar navbar fixo */
}

/* Página sem navbar */
body.no-navbar {
  padding-top: 0;
}

/* Navbar personalizada */
.navbar-custom {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
  box-shadow: 0 2px 10px rgba(8, 39, 90, 0.15);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  height: 76px;
}

.navbar-custom .navbar-brand,
.navbar-custom .nav-link {
  color: var(--white) !important;
  font-weight: 500;
}

.navbar-custom .nav-link:hover {
  color: var(--gray-200) !important;
  transform: translateY(-1px);
  transition: all 0.3s ease;
}

.navbar-custom .dropdown-menu {
  border: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Menu colapsado em dispositivos móveis */
.navbar-custom .navbar-collapse {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
  border-radius: 0 0 10px 10px;
  margin-top: 10px;
  padding: 15px;
  box-shadow: 0 4px 15px rgba(8, 39, 90, 0.15);
}

/* Media Queries - Organizados por breakpoint */

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
  .navbar-custom .navbar-collapse {
    background: none;
    border-radius: 0;
    margin-top: 0;
    padding: 0;
    box-shadow: none;
  }
  
  /* Layout gerenciado pelo Bootstrap */
}

/* Logo */
.navbar-brand img {
  height: 40px;
  width: auto;
}

/* Sidebar */
.sidebar {
  background: linear-gradient(180deg, var(--white) 0%, var(--gray-100) 100%);
  border-right: 1px solid var(--gray-300);
  min-height: calc(100vh - 76px);
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

/* Medium devices (tablets, 768px and down) */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 76px;
    left: -250px;
    width: 250px;
    height: calc(100vh - 76px);
    z-index: 1000;
    transition: left 0.3s ease;
  }
  
  .sidebar.show {
    left: 0;
  }
  
  .main-content {
    margin-left: 0 !important;
  }
  
  .stats-card {
    margin-bottom: 20px;
  }
  
  .table-responsive {
    border-radius: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .table-responsive table {
    min-width: 600px;
    margin-bottom: 0;
  }
  
  .table th,
  .table td {
    white-space: nowrap;
    padding: 0.75rem 0.5rem;
    font-size: 0.875rem;
  }
  
  .navbar-brand img {
    height: 35px;
  }
  
  /* Títulos menores em tablets */
  h3.text-primary-custom {
    font-size: 1.5rem !important;
  }
  
  /* Melhorar o espaçamento dos cards em mobile */
  .card {
    margin-bottom: 1.5rem;
  }
}

.sidebar .nav-link {
  color: var(--gray-700);
  padding: 12px 12px;
  border-radius: 8px;
  margin: 4px 0px;
  transition: all 0.3s ease;
  font-weight: 500;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
  color: var(--white);
  transform: translateX(5px);
  box-shadow: 0 4px 15px rgba(8, 39, 90, 0.2);
}

.sidebar .nav-link[data-bs-toggle="collapse"] .bi-chevron-down {
    transition: transform 0.3s ease;
}

.sidebar .nav-link[data-bs-toggle="collapse"][aria-expanded="true"] .bi-chevron-down {
    transform: rotate(180deg);
}

.sidebar .sub-link {
    padding-left: 2.5rem !important; /* Indent sub-menu items */
    font-size: 0.9em;
}

.sidebar .sub-link.active {
    font-weight: bold;
    color: var(--primary-color) !important;
    background: transparent !important;
    box-shadow: none !important;
    transform: none !important;
}
.navbar-nav .sub-link.active {
    font-weight: bold;
}

.sidebar .nav-link i {
  margin-right: 10px;
  width: 20px;
  text-align: center;
}

/* Cards personalizados */
.card-custom {
  border: none;
  border-radius: 15px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  overflow: hidden;
}

.card-custom:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.card-header-custom {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
  color: var(--white);
  border: none;
  padding: 20px;
  font-weight: 600;
}

/* Estatísticas do Dashboard */
.stats-card {
  background: linear-gradient(135deg, var(--white) 0%, var(--gray-100) 100%);
  border: none;
  border-radius: 15px;
  padding: 25px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

/* Custom orange for metas progress (91% - 100%) */
.bg-orange {
  background-color: #fd7e14 !important;
}

.stats-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-light) 100%);
}

.stats-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.stats-card .stats-icon {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 15px;
}

.stats-card .stats-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 5px;
}

.stats-card .stats-label {
  color: var(--gray-600);
  font-weight: 500;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

/* Indicador de força da senha */
.password-strength {
  height: 4px;
  border-radius: 2px;
  margin-top: 5px;
  transition: all 0.3s ease;
}

.password-strength.weak {
  background-color: var(--danger-color);
  width: 25%;
}

.password-strength.medium {
  background-color: var(--warning-color);
  width: 50%;
}

.password-strength.strong {
  background-color: var(--success-color);
  width: 75%;
}

.password-strength.very-strong {
  background-color: var(--success-color);
  width: 100%;
}

/* Animações */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.fade-in {
  animation: fadeIn 0.6s ease-out;
}

.slide-in {
  animation: slideIn 0.6s ease-out;
}

/* Small devices (phones, 576px and down) */
@media (max-width: 576px) {
  .stats-card .stats-number {
    font-size: 1.5rem;
  }
  
  .stats-card .stats-icon {
    font-size: 2rem;
  }
  
  .card-custom {
    margin-bottom: 15px;
  }
  
  .btn-primary-custom,
  .btn-outline-primary-custom {
    padding: 8px 15px;
    font-size: 0.9rem;
  }
  
  /* Títulos menores em dispositivos móveis */
  h3.text-primary-custom {
    font-size: 1.3rem !important;
  }
}

/* Utilitários */
.text-primary-custom {
  color: var(--primary-color) !important;
}

.bg-primary-custom {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%) !important;
}

/* Estilos para paginação */
.pagination .page-link {
  min-width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0;
  border-radius: 6px;
  margin: 0 2px;
  font-weight: 500;
}

.pagination-sm .page-link {
  min-width: 32px;
  height: 32px;
  font-size: 0.875rem;
}

.pagination .page-item.active .page-link {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

.pagination .page-item.disabled .page-link {
  color: #6c757d;
  background-color: #fff;
  border-color: #dee2e6;
}

.pagination .page-link:hover {
  background-color: var(--primary-light);
  border-color: var(--primary-light);
  color: white;
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--gray-200);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-light);
}

/* Estilos específicos para páginas */

/* Index.asp */
.gradient-background {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    min-height: 100vh;
}

.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    text-align: center;
    color: white;
    padding-top: 1rem;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.btn-hero {
    background: rgba(255,255,255,0.2);
    border: 2px solid white;
    color: white;
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.btn-hero:hover {
    background: white;
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.feature-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.feature-card {
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
}

/* Login.asp */
.login-container {
    background: white;
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    max-width: 400px;
    width: 100%;
}

.login-logo {
    max-width: 200px;
    margin-bottom: 2rem;
}

.btn-google {
    background: #4285f4;
    border: none;
    color: white;
    padding: 12px 30px;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    width: 100%;
}

.btn-google:hover {
    background: #3367d6;
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(66, 133, 244, 0.3);
    color: white;
}

/* Dashboard.asp */
.welcome-card {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.welcome-card h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.welcome-card p {
    opacity: 0.9;
    margin-bottom: 0;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
}

.stat-icon {
    font-size: 2.5rem;
    opacity: 0.8;
}

/* Cartoes.asp */
.cartao-card {
    transition: transform 0.3s ease;
    overflow: hidden;
    position: relative;
}

.cartao-card:hover {
    transform: translateY(-5px);
}

.bandeira-visa { background: linear-gradient(135deg, #1a1f71, #0f4c75); }
.bandeira-mastercard { background: linear-gradient(135deg, #eb001b, #f79e1b); }
.bandeira-elo { background: linear-gradient(135deg, #0066cc, #ffcc00); }
.bandeira-americanexpress { background: linear-gradient(135deg, #000000, #c0c0c0); }
.bandeira-outros { background: linear-gradient(135deg, #00cc66, #0066cc); }

/* Estilos para botões de ação */
.card-header .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Categorias.asp */
.categoria-card {
    transition: transform 0.3s ease;
}

.categoria-card:hover {
    transform: translateY(-5px);
}

.categoria-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
}

/* Estilos para botões de ação das categorias */
.categoria-card .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Pagamentos.asp */
.pagamento-card {
    transition: transform 0.3s ease;
}

.pagamento-card:hover {
    transform: translateY(-5px);
}

.pagamento-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
}

.pagamento-recorrente-card {
    transition: transform 0.3s ease;
}

.pagamento-recorrente-card:hover {
    transform: translateY(-5px);
}

.pagamento-recorrente-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
}

/* Estilos para botões de ação dos pagamentos */
.pagamento-card .btn-sm,
.pagamento-recorrente-card .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Despesas.asp */
.despesa-item {
    transition: all 0.3s ease;
    border-left: 4px solid var(--primary-color);
}

.despesa-item:hover {
    transform: translateX(5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.valor-despesa {
    font-size: 1.0rem;
    font-weight: bold;
    color: var(--primary-color);
}

.badge-categoria {
    background-color: var(--primary-light);
}

/* Estilos para cards de despesas */
.despesa-card {
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.despesa-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.despesa-card .card-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border-bottom: 1px solid #e9ecef;
    padding: 0.75rem 1rem;
    overflow: hidden;
}

.despesa-card .card-header h6 {
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    white-space: normal;
    line-height: 1.4;
    margin-bottom: 0;
}

.despesa-card .card-body {
    padding: 1rem;
}

.despesa-card .card-footer {
    /*background-color: #f8f9fa;*/
    background-color: #eef1f3;
    border-top: 1px solid #e9ecef;
    padding: 0.75rem 1rem;
}

/* Estilos para botões de ação das despesas */
.despesa-card .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

  
  /* Cards de despesas em dispositivos pequenos */
  .despesa-card .card-header,
  .despesa-card .card-body,
  .despesa-card .card-footer {
    padding: 0.4rem 0.6rem;
  }
  
  .despesa-card h6 {
    font-size: 0.85rem;
  }
  
  .despesa-card h5 {
    font-size: 1rem;
  }
  
  .despesa-card small {
    font-size: 0.75rem;
  }
}

/* Medium devices - Cards de despesas */
@media (max-width: 768px) and (min-width: 577px) {
  .despesa-card .card-header,
  .despesa-card .card-body,
  .despesa-card .card-footer {
    padding: 0.5rem 0.75rem;
  }
  
  .despesa-card h6 {
    font-size: 0.9rem;
  }
  
  .despesa-card small {
    font-size: 0.75rem;
  }
}

/* Importar_fatura.asp */
.upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 15px;
    padding: 3rem;
    text-align: center;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background-color: #f0f4ff;
}

.upload-icon {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.csv-format {
    background-color: #e7f3ff;
    border-left: 4px solid var(--primary-color);
    padding: 1rem;
    border-radius: 0 10px 10px 0;
}

.fatura-item {
    transition: all 0.3s ease;
}

.fatura-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* Comparar_despesas.asp */
.fatura-card {
    transition: all 0.3s ease;
    cursor: pointer;
}

.fatura-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.fatura-card.selected {
    border: 2px solid var(--primary-color);
    background-color: #f0f4ff;
}

.comparison-item {
    border-left: 4px solid #dee2e6;
    transition: all 0.3s ease;
}

.comparison-item.matched {
    border-left-color: #28a745;
    background-color: #f8fff9;
}

.comparison-item.unmatched {
    border-left-color: #ffc107;
    background-color: #fffdf0;
}

.comparison-item.recognized {
    border-left-color: #007bff;
    background-color: #f0f8ff;
}

.comparison-item.not-recognized {
    border-left-color: #dc3545;
    background-color: #fff5f5;
}

.valor-positivo {
    color: #28a745;
    font-weight: bold;
}

.valor-negativo {
    color: #dc3545;
    font-weight: bold;
}

.diferenca-valor {
    font-size: 0.85em;
    color: #6c757d;
}

.status-badge {
    font-size: 0.75em;
    padding: 0.25em 0.5em;
}

/* Relatórios.asp */
.chart-container {
    position: relative;
    height: 300px;
    margin: 1rem 0;
}

.export-buttons {
    gap: 0.5rem;
}

.section-header {
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
    margin: 2rem 0 1rem 0;
}

.valor-positivo {
    color: #28a745;
    font-weight: bold;
}

.valor-negativo {
    color: #dc3545;
    font-weight: bold;
}

/* Medium and small devices (tablets and phones, 992px and down) */
@media (max-width: 992px) {
  .sidebar {
    display: none;
  }
}

/* Estilo para menu móvel no navbar */
.navbar-nav .nav-link {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.navbar-nav .nav-link:last-child {
    border-bottom: none;
}

.navbar-nav .nav-link.active {
    background-color: rgba(255,255,255,0.1);
    border-radius: 0.375rem;
}

/* Perfil.asp */
.profile-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border-radius: 15px 15px 0 0;
    padding: 2rem;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    background-color: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 1rem;
}

.danger-zone {
    border: 2px solid #dc3545;
    border-radius: 10px;
    background-color: #fff5f5;
}

/* Relatórios.asp */
.filter-card {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
}

/* Offline.html */
.offline-container {
    background: white;
    border-radius: 20px;
    padding: 3rem;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    width: 90%;
}

.offline-icon {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.btn-reconnect {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    color: white;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.btn-reconnect:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(8, 39, 90, 0.3);
    color: white;
}

.connection-status {
    margin-top: 1rem;
    padding: 10px;
    border-radius: 10px;
    font-weight: 500;
}

.status-offline {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-online {
    background-color: #d1edff;
    color: #0c5460;
    border: 1px solid #b8daff;
}

/* Política de Privacidade e Termos de Serviço */
.policy-content, .terms-content {
    line-height: 1.8;
}

.policy-content h2, .terms-content h2 {
    color: var(--primary-color);
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.policy-content h3, .terms-content h3 {
    color: var(--primary-dark);
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
    font-size: 1.2rem;
}

.policy-content p, .terms-content p {
    margin-bottom: 1rem;
    text-align: justify;
}

.policy-content ul, .terms-content ul {
    margin-bottom: 1rem;
}

.policy-content li, .terms-content li {
    margin-bottom: 0.5rem;
}

.highlight-box {
    background-color: #e3f2fd;
    border-left: 4px solid var(--primary-color);
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 0 8px 8px 0;
}

/* Estilos para páginas com fundo claro */
.light-background {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.logo {
    height: auto;
}

.nav-link {
    color: #6c757d;
    padding: 12px 20px;
    border-radius: 8px;
    margin: 2px 0;
    transition: all 0.3s ease;
}

.nav-link:hover, .nav-link.active {
    background-color: var(--primary-color);
    color: white;
}

.main-content {
    padding: 2rem;
}

/* Custom font sizes for mobile optimization */
.fs-7 {
  font-size: 0.75rem !important;
}

/* Print styles */
@media print {
  .sidebar,
  .navbar,
  .btn,
  .modal {
    display: none !important;
  }
  
  .main-content {
    margin-left: 0 !important;
  }
  
  .card {
    border: 1px solid var(--gray-400) !important;
    box-shadow: none !important;
  }
}