/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *
 *= require mobile
 *= require compact
 *= require_self
 */

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

body {
  font-family: var(--font-sans);
  line-height: 1.6;
  /* Cor/fundo vêm do Bootstrap (var(--bs-body-color/bg)), que já troca com
     data-bs-theme -- um valor fixo aqui quebraria o tema escuro. */
  color: var(--bs-body-color);
  background-color: var(--bs-body-bg);
}

/* Basic Typography */
h1, h2, h3, h4, h5, h6 {
  margin-bottom: 0.5em;
  font-weight: 600;
  line-height: 1.2;
}

p {
  margin-bottom: 1em;
}

/* Basic Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Basic Links */
a {
  /* var(--bs-link-color), não #007bff fixo -- o Bootstrap já calibra essa
     cor por tema (data-bs-theme); um valor fixo aqui ficava sempre o mesmo
     azul claro, com contraste insuficiente no fundo escuro. */
  color: var(--bs-link-color);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Basic Form Elements */
input, textarea, select {
  font-family: inherit;
  font-size: var(--text-base);
  padding: var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

button {
  cursor: pointer;
  padding: var(--space-2) var(--space-4);
  background-color: var(--color-action);
  color: var(--color-on-action);
  border: none;
  border-radius: var(--radius-sm);
  font-size: var(--text-base);
}

button:hover {
  background-color: var(--color-action-hover);
}

/* Highlight for the expense being edited: Bootstrap's own .bg-warning-subtle
   (used below) already adapts to data-bs-theme -- don't redeclare it with a
   fixed color, or dark mode gets a pale-yellow box with invisible dark text. */
.flash-highlight {
  animation: flash-highlight 1.2s ease-out 2;
}

/* Gira o ícone de expandir/recolher item de lista com filhos (ver
   toggleChildren em layouts/application.html.erb) em vez de trocar o glifo
   por outro -- mesmo ícone, só rotacionado, fica mais suave que alternar
   dois caracteres diferentes. */
.icon {
  transition: transform 0.15s ease;
}

.icon.rotate-90 {
  transform: rotate(90deg);
}

@keyframes flash-highlight {
  0% { box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.45); }
  50% { box-shadow: 0 0 0 8px rgba(255, 193, 7, 0.15); }
  100% { box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.0); }
}