:root {
  --primary: #0d6efd;
  --primary-light: #e6f0ff;
  --primary-dark: #0b5ed7;
  --success: #28a745;
  --success-light: #e7f5ed;
  --danger: #dc3545;
  --danger-light: #fbecee;
  --warning: #ffc107;
  --warning-light: #fff8e6;
  --info: #0dcaf0;
  --info-light: #e6f9fd;
  --dark: #212529;
  --light: #f8f9fa;
  --gray: #6c757d;
  --gray-light: #e9ecef;
  --gray-lighter: #f5f5f7;
  --border-radius: 0.75rem;
  --border-radius-sm: 0.5rem;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
  --font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Dark theme variables */
.dark-theme {
  --primary: #3b82f6;
  --primary-light: #1e293b;
  --primary-dark: #60a5fa;
  --success: #22c55e;
  --success-light: #1e293b;
  --danger: #ef4444;
  --danger-light: #1e293b;
  --warning: #f59e0b;
  --warning-light: #1e293b;
  --info: #06b6d4;
  --info-light: #1e293b;
  --dark: #f8fafc;
  --light: #0f172a;
  --gray: #94a3b8;
  --gray-light: #1e293b;
  --gray-lighter: #0f172a;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

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

body {
  font-family: var(--font-family);
  background-color: var(--gray-lighter);
  color: var(--dark);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

.container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 0;
}

/* Header */
.app-header {
  background-color: white;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: var(--transition);
}

.dark-theme .app-header {
  background-color: var(--light);
  border-bottom: 1px solid var(--gray-light);
}

.app-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  transition: var(--transition);
}

.date-selector {
  display: flex;
  align-items: center;
  background-color: var(--gray-lighter);
  border-radius: var(--border-radius);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--dark);
  cursor: pointer;
  transition: var(--transition);
}

.dark-theme .date-selector {
  background-color: var(--gray-light);
  color: var(--dark);
}

.date-selector:hover {
  background-color: var(--primary-light);
  color: var(--primary);
}

.avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background-color: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.avatar:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow);
}

/* Main content */
.app-content {
  flex: 1;
  padding: 1rem;
  transition: var(--transition);
}

.card {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  margin-bottom: 1rem;
  transition: var(--transition);
  border: 1px solid transparent;
}

.dark-theme .card {
  background-color: var(--light);
  border-color: var(--gray-light);
}

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

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--dark);
  transition: var(--transition);
}

.dark-theme .card-title {
  color: var(--light);
}

/* Row and columns */
.row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -0.5rem;
}

.col-4 {
  flex: 0 0 33.333333%;
  max-width: 33.333333%;
  padding: 0 0.5rem;
}

/* Form elements */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--gray);
  transition: var(--transition);
}

.dark-theme .form-label {
  color: var(--gray-light);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 1px solid var(--gray-light);
  border-radius: var(--border-radius);
  background-color: white;
  transition: var(--transition);
}

.dark-theme .form-control {
  background-color: var(--gray-light);
  border-color: var(--gray);
  color: var(--dark);
}

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

.input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.input-group-text {
  position: absolute;
  left: 1rem;
  color: var(--gray);
  transition: var(--transition);
  z-index: 1;
}

.dark-theme .input-group-text {
  color: var(--gray-light);
}

.input-group .form-control {
  padding-left: 2.5rem;
}

.input-icon {
  position: absolute;
  left: 1rem;
  color: var(--gray);
  transition: var(--transition);
}

.dark-theme .input-icon {
  color: var(--gray-light);
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236c757d' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 16px 12px;
  padding-right: 2.5rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
}

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

.btn-primary:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

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

.btn-success:hover {
  background-color: #157347;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

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

.btn-danger:hover {
  background-color: #bb2d3b;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.btn-block {
  display: block;
  width: 100%;
}

/* Bottom navigation */
.bottom-nav {
  background-color: white;
  display: flex;
  justify-content: space-around;
  padding: 0.75rem 0;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  z-index: 100;
  transition: var(--transition);
}

.dark-theme .bottom-nav {
  background-color: var(--light);
  border-top: 1px solid var(--gray-light);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--gray);
  text-decoration: none;
  font-size: 0.75rem;
  transition: var(--transition);
  position: relative;
  padding: 0.5rem;
}

.nav-item::after {
  content: "";
  position: absolute;
  bottom: -0.75rem;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 3px;
  background-color: var(--primary);
  border-radius: 3px;
  transition: var(--transition);
}

.nav-item.active {
  color: var(--primary);
}

.nav-item.active::after {
  width: 1.5rem;
}

.nav-item:hover {
  color: var(--primary);
  transform: translateY(-2px);
}

.nav-icon {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
  transition: var(--transition);
}

.nav-item.active .nav-icon {
  transform: scale(1.1);
}

/* Floating action button */
.fab {
  position: fixed;
  bottom: 4.5rem;
  right: 1.5rem;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background-color: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: var(--shadow-lg);
  z-index: 101;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.fab:hover {
  background-color: var(--primary-dark);
  transform: scale(1.1) rotate(90deg);
}

/* Summary cards */
.summary-card {
  padding: 1rem;
  border-radius: var(--border-radius);
  margin-bottom: 1rem;
  color: white;
  transition: var(--transition);
  height: 100%;
}

.summary-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.summary-card.income {
  background-color: var(--success);
}

.summary-card.expense {
  background-color: var(--danger);
}

.summary-card.balance {
  background-color: var(--primary);
}

.summary-label {
  font-size: 0.875rem;
  opacity: 0.9;
  font-weight: 500;
}

.summary-amount {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0.5rem 0 0;
}

/* Transaction list */
.transaction-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.transaction-item {
  display: flex;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid var(--gray-light);
  transition: var(--transition);
}

.dark-theme .transaction-item {
  border-bottom-color: var(--gray-light);
}

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

.transaction-item:hover {
  background-color: var(--gray-lighter);
  border-radius: var(--border-radius-sm);
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.dark-theme .transaction-item:hover {
  background-color: var(--gray-light);
}

.transaction-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background-color: var(--gray-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 1rem;
  flex-shrink: 0;
  transition: var(--transition);
}

.transaction-details {
  flex: 1;
}

.transaction-title {
  font-weight: 500;
  margin: 0 0 0.25rem;
  transition: var(--transition);
}

.dark-theme .transaction-title {
  color: var(--light);
}

.transaction-date {
  font-size: 0.75rem;
  color: var(--gray);
  margin: 0;
  transition: var(--transition);
}

.dark-theme .transaction-date {
  color: var(--gray-light);
}

.transaction-amount {
  font-weight: 600;
  transition: var(--transition);
}

.transaction-amount.income {
  color: var(--success);
}

.transaction-amount.expense {
  color: var(--danger);
}

/* Profile page styles */
.profile-card {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
  overflow: hidden;
  position: relative;
}

.profile-cover {
  height: 80px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background-color: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 600;
  position: absolute;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid white;
  box-shadow: var(--shadow);
}

.profile-info {
  padding: 50px 1.5rem 1.5rem;
  text-align: center;
}

.profile-name {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.profile-email,
.profile-date {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray);
  font-size: 0.9rem;
  margin: 0.25rem 0;
}

.finance-summary {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.summary-header h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
}

.badge {
  background-color: var(--primary-light);
  color: var(--primary);
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 1rem;
  font-weight: 500;
}

.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.summary-item {
  display: flex;
  align-items: center;
  padding: 1rem;
  border-radius: var(--border-radius-sm);
}

.summary-item.income {
  background-color: var(--success-light);
}

.summary-item.expense {
  background-color: var(--danger-light);
}

.summary-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.75rem;
  font-size: 1.25rem;
}

.summary-item.income .summary-icon {
  background-color: var(--success);
  color: white;
}

.summary-item.expense .summary-icon {
  background-color: var(--danger);
  color: white;
}

.summary-details {
  display: flex;
  flex-direction: column;
}

.summary-label {
  font-size: 0.875rem;
  color: var(--gray);
  margin-bottom: 0.25rem;
}

.summary-value {
  font-size: 1.25rem;
  font-weight: 600;
}

.summary-item.income .summary-value {
  color: var(--success);
}

.summary-item.expense .summary-value {
  color: var(--danger);
}

.balance-summary {
  background-color: var(--gray-lighter);
  border-radius: var(--border-radius-sm);
  padding: 1rem;
  text-align: center;
}

.balance-label {
  font-size: 0.875rem;
  color: var(--gray);
  margin-bottom: 0.5rem;
}

.balance-value {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.balance-value.positive {
  color: var(--success);
}

.balance-value.negative {
  color: var(--danger);
}

.balance-progress {
  margin-top: 0.5rem;
}

.progress {
  height: 0.5rem;
  background-color: var(--gray-light);
  border-radius: 1rem;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 1rem;
}

.progress-bar.positive {
  background-color: var(--success);
}

.progress-bar.negative {
  background-color: var(--danger);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.card-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
}

.view-all {
  color: var(--primary);
  font-size: 0.875rem;
  text-decoration: none;
}

.view-all:hover {
  text-decoration: underline;
}

.profile-form {
  margin-top: 1rem;
}

.password-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gray-light);
}

.section-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--dark);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

.logout-section {
  margin: 1.5rem 0;
  text-align: center;
}

.btn-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--danger-light);
  color: var(--danger);
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

.btn-logout:hover {
  background-color: var(--danger);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.btn-logout i {
  margin-right: 0.5rem;
  font-size: 1.125rem;
}

/* Utilities */
.mb-0 {
  margin-bottom: 0;
}
.mb-1 {
  margin-bottom: 0.25rem;
}
.mb-2 {
  margin-bottom: 0.5rem;
}
.mb-3 {
  margin-bottom: 1rem;
}
.mb-4 {
  margin-bottom: 1.5rem;
}
.mb-5 {
  margin-bottom: 3rem;
}

.mt-0 {
  margin-top: 0;
}
.mt-1 {
  margin-top: 0.25rem;
}
.mt-2 {
  margin-top: 0.5rem;
}
.mt-3 {
  margin-top: 1rem;
}
.mt-4 {
  margin-top: 1.5rem;
}
.mt-5 {
  margin-top: 3rem;
}

.me-2 {
  margin-right: 0.5rem;
}

.py-4 {
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}
.py-5 {
  padding-top: 3rem;
  padding-bottom: 3rem;
}

.text-center {
  text-align: center;
}
.text-right {
  text-align: right;
}

.text-success {
  color: var(--success);
}
.text-danger {
  color: var(--danger);
}
.text-primary {
  color: var(--primary);
}
.text-warning {
  color: var(--warning);
}
.text-info {
  color: var(--info);
}
.text-muted {
  color: var(--gray);
}

/* Padding for bottom navigation */
.pb-nav {
  padding-bottom: 5rem;
}

/* Responsive adjustments */
@media (min-width: 768px) {
  .container {
    max-width: 720px;
  }

  .app-content {
    padding: 1.5rem;
  }
}

/* Mejoras para la responsividad */
@media (max-width: 576px) {
  .container {
    max-width: 100%;
    padding: 0 0.75rem;
  }

  .card {
    padding: 1rem;
  }

  .summary-card {
    padding: 0.75rem;
  }

  .summary-amount {
    font-size: 1.25rem;
  }

  .app-header {
    padding: 0.75rem;
  }

  .bottom-nav {
    padding: 0.5rem 0;
  }

  .nav-item {
    font-size: 0.7rem;
  }

  .fab {
    width: 3rem;
    height: 3rem;
    right: 1rem;
  }
}

/* Mejoras para tablets */
@media (min-width: 577px) and (max-width: 768px) {
  .container {
    max-width: 540px;
  }
}

/* Mejoras para pantallas medianas */
@media (min-width: 769px) and (max-width: 992px) {
  .container {
    max-width: 720px;
  }
}

/* Mejoras para pantallas grandes */
@media (min-width: 993px) {
  .container {
    max-width: 960px;
  }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.3s ease forwards;
}

.slide-up {
  animation: slideUp 0.3s ease forwards;
}

/* Estilos para consejos financieros */
.tip-content {
  display: flex;
  align-items: flex-start;
  padding: 0.5rem;
}

.tip-icon {
  font-size: 1.5rem;
  color: var(--warning);
  margin-right: 1rem;
  flex-shrink: 0;
}

.btn-tip {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.25rem;
  border-radius: 50%;
  transition: var(--transition);
}

.btn-tip:hover {
  background-color: var(--primary-light);
  transform: rotate(180deg);
}

/* Estilos para estado vacío */
.empty-state {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--gray);
}

.empty-state i {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  opacity: 0.7;
}

.empty-state p {
  margin-bottom: 1.5rem;
}

/* Estilos para modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background-color: white;
  border-radius: var(--border-radius);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--gray);
  position: absolute;
  top: 1rem;
  right: 1rem;
}

.modal-body {
  margin-bottom: 1.5rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.transaction-options {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.transaction-option {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  border-radius: var(--border-radius);
  text-decoration: none;
  transition: var(--transition);
}

.transaction-option.income {
  background-color: var(--success-light);
  color: var(--success);
}

.transaction-option.expense {
  background-color: var(--danger-light);
  color: var(--danger);
}

.transaction-option i {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.transaction-option:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

.transaction-option.income:hover {
  background-color: var(--success);
  color: white;
}

.transaction-option.expense:hover {
  background-color: var(--danger);
  color: white;
}

/* Botón pequeño */
.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
}

/* Ajustes para el botón flotante */
.fab {
  z-index: 99;
}
