/* VivaLAR Despesas Fixas - Frontend Styles */

.vivalar-despesas-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: #f8fafc;
  min-height: 100vh;
}

/* Hero Section */
.vivalar-hero {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: white;
  padding: 2rem 1rem 3rem;
  margin: 0 -1rem;
  border-radius: 0 0 1rem 1rem;
}

.hero-content {
  max-width: 1200px;
  margin: 0 auto;
}

.hero-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 1rem;
  opacity: 0.9;
  margin: 0 0 2rem 0;
  font-weight: 400;
}

.summary-card {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border-radius: 1rem;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.summary-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.amount-label {
  font-size: 0.8rem;
  opacity: 0.8;
  margin-bottom: 0.25rem;
}

.amount-value {
  font-size: 1.875rem;
  font-weight: 700;
  line-height: 1;
}

.summary-comparison {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}

.comparison-label {
  font-size: 0.8rem;
  opacity: 0.8;
  margin-bottom: 0.25rem;
}

.comparison-value {
  font-size: 1.125rem;
  font-weight: 600;
}

.comparison-value.increase::before {
  content: '↑';
  margin-right: 0.25rem;
}

.comparison-value.decrease::before {
  content: '↓';
  margin-right: 0.25rem;
}

.summary-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 600;
}

.stat-item.paid .stat-icon {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

.stat-item.pending .stat-icon {
  background: rgba(251, 191, 36, 0.2);
  color: #fbbf24;
}

.stat-content {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.75rem;
  opacity: 0.8;
  margin-bottom: 0.125rem;
}

.stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
}

/* Sections */
.quick-actions,
.categories-section,
.recent-expenses,
.upcoming-section {
  padding: 1.5rem 0;
  max-width: 1200px;
  margin: 0 auto;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 1.5rem 0;
}

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

.see-all-btn {
  background: none;
  border: none;
  color: #f97316;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.see-all-btn:hover {
  color: #ea580c;
}

/* Quick Actions */
.actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border: none;
  border-radius: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.action-btn.primary {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: white;
}

.action-btn.secondary {
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
  color: white;
}

.action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.btn-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 600;
}

.btn-content {
  display: flex;
  flex-direction: column;
}

.btn-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.btn-subtitle {
  font-size: 0.75rem;
  opacity: 0.8;
}

/* Categories */
.categories-grid {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.categories-grid::-webkit-scrollbar {
  display: none;
}

.category-card {
  background: white;
  border-radius: 1rem;
  padding: 0.75rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid transparent;
  min-width: 80px;
  flex-shrink: 0;
  text-align: center;
}

.category-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  border-color: #f97316;
}

.category-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  margin: 0 auto 0.5rem auto;
  color: white;
}

.category-info {
  display: flex;
  flex-direction: column;
}

.category-name {
  font-size: 0.7rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.125rem;
  line-height: 1.2;
}

.category-amount {
  font-size: 0.75rem;
  font-weight: 700;
  color: #1f2937;
  line-height: 1.2;
}

/* Expenses */
.expenses-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.expense-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.expense-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.expense-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  background: rgba(249, 115, 22, 0.1);
}

.expense-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.expense-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 0.125rem;
}

.expense-date {
  font-size: 0.75rem;
  color: #6b7280;
}

.expense-amount {
  font-size: 0.9rem;
  font-weight: 700;
  color: #1f2937;
}

/* Upcoming Section */
.upcoming-section {
  background: white;
  margin: 0;
  border-radius: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  padding: 1.5rem;
}

.upcoming-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.upcoming-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-radius: 0.75rem;
  border: 2px solid transparent;
}

.upcoming-item.warning {
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.2);
}

.upcoming-item.overdue {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.2);
}

.upcoming-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.upcoming-item.warning .upcoming-icon {
  background: rgba(251, 191, 36, 0.2);
  color: #f59e0b;
}

.upcoming-item.overdue .upcoming-icon {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.upcoming-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.upcoming-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 0.125rem;
}

.upcoming-date {
  font-size: 0.75rem;
  color: #6b7280;
}

.upcoming-amount {
  font-size: 0.9rem;
  font-weight: 700;
  color: #1f2937;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  padding: 1rem;
  box-sizing: border-box;
}

.modal.modal-large .modal-content {
  max-width: 800px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-content {
  background: white;
  margin: 2rem auto;
  padding: 0;
  border-radius: 1rem;
  max-width: 500px;
  width: 100%;
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  animation: modalFadeIn 0.3s ease;
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #1f2937;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.125rem;
  cursor: pointer;
  color: #6b7280;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
}

.modal-close:hover {
  background: #f3f4f6;
  color: #1f2937;
}

/* Form Styles */
.modal-body {
  padding: 0.75rem 1rem;
  max-height: calc(100vh - 12rem);
  overflow-y: auto;
}

.form-group {
  margin-bottom: 0.75rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.375rem;
  font-weight: 600;
  color: #374151;
  font-size: 0.8rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.5rem;
  border: 2px solid #e5e7eb;
  border-radius: 0.5rem;
  font-size: 0.8rem;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #f97316;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.modal-actions {
  display: flex;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid #e5e7eb;
  justify-content: flex-end;
  flex-shrink: 0;
}

.btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

.btn-primary {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #ea580c 0%, #dc2626 100%);
  transform: translateY(-1px);
}

.btn-secondary {
  background: #f3f4f6;
  color: #374151;
  border: 2px solid #e5e7eb;
}

.btn-secondary:hover {
  background: #e5e7eb;
  border-color: #d1d5db;
}

/* Expenses Table */
.expenses-filters {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.filter-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #374151;
}

.filter-group input,
.filter-group select {
  padding: 0.5rem;
  border: 2px solid #e5e7eb;
  border-radius: 0.375rem;
  font-size: 0.8rem;
}

.expenses-table-container {
  padding: 1rem;
  overflow-x: auto;
}

.expenses-table {
  width: 100%;
  background: white;
  border-collapse: collapse;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.expenses-table th,
.expenses-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

.expenses-table th {
  background: #f9fafb;
  font-weight: 600;
  color: #374151;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.expenses-table tbody tr:hover {
  background: #f9fafb;
}

.status-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-badge.status-pago {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
}

.status-badge.status-pendente {
  background: rgba(251, 191, 36, 0.1);
  color: #f59e0b;
}

/* Loading */
.loading-indicator {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  z-index: 1001;
}

.spinner {
  width: 2rem;
  height: 2rem;
  border: 3px solid #e5e7eb;
  border-top: 3px solid #f97316;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Login Required */
.vivalar-login-required {
  padding: 2rem;
  text-align: center;
  background: white;
  border-radius: 1rem;
  margin: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Responsive Design */
@media (max-width: 768px) {
  .vivalar-despesas-container {
    padding: 0 0.5rem;
  }
  
  .hero-title {
    font-size: 1.5rem;
  }
  
  .hero-subtitle {
    font-size: 0.9rem;
  }

  .amount-value {
    font-size: 1.5rem;
  }

  .comparison-value {
    font-size: 1rem;
  }

  .stat-item {
    padding: 0.5rem;
    gap: 0.375rem;
  }

  .stat-icon {
    width: 1.25rem;
    height: 1.25rem;
    font-size: 0.75rem;
  }

  .stat-value {
    font-size: 1rem;
  }

  .stat-label {
    font-size: 0.65rem;
  }

  .summary-stats {
    gap: 0.5rem;
  }
  
  .actions-grid {
    grid-template-columns: 1fr;
  }
  
  .categories-grid {
    gap: 0.75rem;
  }
  
  .category-card {
    min-width: 70px;
    padding: 0.5rem;
  }
  
  .category-icon {
    width: 1.5rem;
    height: 1.5rem;
    font-size: 0.875rem;
    margin-bottom: 0.375rem;
  }
  
  .category-name {
    font-size: 0.65rem;
  }
  
  .category-amount {
    font-size: 0.7rem;
  }
  
  .summary-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .summary-comparison {
    align-items: flex-start;
    text-align: left;
  }
  
  .modal-content {
    margin: 5vh auto;
    max-width: 70%;
    max-height: 70vh;
  }

  .modal-header {
    padding: 0.5rem 0.75rem;
  }

  .modal-header h3 {
    font-size: 0.9rem;
  }

  .modal-body {
    padding: 0.5rem 0.75rem;
  }

  .form-group {
    margin-bottom: 0.5rem;
  }

  .form-group label {
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    padding: 0.4rem;
    font-size: 0.75rem;
  }

  .modal-actions {
    padding: 0.5rem 0.75rem;
    gap: 0.75rem;
  }

  .btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
  }
  
  .expenses-filters {
    flex-direction: column;
  }
  
  .filter-group {
    width: 100%;
  }
  
  .upcoming-section {
    margin: 0;
    border-radius: 0;
  }

  .section-title {
    font-size: 1.125rem;
  }

  .btn-title {
    font-size: 0.9rem;
  }

  .btn-subtitle {
    font-size: 0.7rem;
  }

  .category-name {
    font-size: 0.75rem;
  }

  .category-amount {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .vivalar-despesas-container {
    padding: 0 0.25rem;
  }
  
  .hero-content {
    padding: 0 0.5rem;
  }
  
  .summary-card {
    padding: 1rem;
  }

  .hero-title {
    font-size: 1.25rem;
  }

  .hero-subtitle {
    font-size: 0.85rem;
  }

  .amount-value {
    font-size: 1.375rem;
  }

  .stat-item {
    padding: 0.375rem;
    gap: 0.25rem;
  }

  .stat-icon {
    width: 1rem;
    height: 1rem;
    font-size: 0.7rem;
  }

  .stat-value {
    font-size: 0.9rem;
  }

  .stat-label {
    font-size: 0.6rem;
  }

  .summary-stats {
    gap: 0.375rem;
  }
  
  .categories-grid {
    gap: 0.5rem;
  }
  
  .category-card {
    min-width: 65px;
    padding: 0.375rem;
  }

  .category-icon {
    width: 1.25rem;
    height: 1.25rem;
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
  }

  .category-name {
    font-size: 0.6rem;
  }
  
  .category-amount {
    font-size: 0.65rem;
  }

  .action-btn {
    padding: 0.75rem;
  }

  .btn-icon {
    width: 2rem;
    height: 2rem;
    font-size: 1rem;
  }

  .btn-title {
    font-size: 0.85rem;
  }

  .btn-subtitle {
    font-size: 0.65rem;
  }
  
  .expenses-table {
    font-size: 0.75rem;
  }
  
  .expenses-table th,
  .expenses-table td {
    padding: 0.5rem 0.25rem;
  }

  .modal-content {
    margin: 3vh auto;
    max-width: 85%;
    max-height: 75vh;
  }

  .modal-header {
    padding: 0.4rem 0.6rem;
  }

  .modal-header h3 {
    font-size: 0.85rem;
  }

  .modal-body {
    padding: 0.4rem 0.6rem;
  }

  .form-group {
    margin-bottom: 0.4rem;
  }

  .form-group label {
    font-size: 0.7rem;
    margin-bottom: 0.2rem;
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    padding: 0.35rem;
    font-size: 0.7rem;
  }

  .modal-actions {
    padding: 0.4rem 0.6rem;
    gap: 0.5rem;
  }

  .btn {
    padding: 0.35rem 0.7rem;
    font-size: 0.7rem;
  }

}