/* Custom CSS for Expense Manager - Dark Theme */

:root {
  --bs-primary-rgb: 13, 110, 253;
  --bs-secondary-rgb: 108, 117, 125;
  --bs-success-rgb: 25, 135, 84;
  --bs-danger-rgb: 220, 53, 69;
  --bs-warning-rgb: 255, 193, 7;
  --bs-info-rgb: 13, 202, 240;
  
  /* Custom colors for financial data */
  --income-color: #28a745;
  --expense-color: #dc3545;
  --transfer-color: #6c757d;
  --budget-positive: #20c997;
  --budget-negative: #fd7e14;
  
  /* Dark theme overrides */
  --bs-body-bg: #121212;
  --bs-body-color: #ffffff;
  --bs-card-bg: #1e1e1e;
  --bs-border-color: #333333;
}

/* Body and Layout */
body {
  background: linear-gradient(135deg, #0c0c0c 0%, #1a1a1a 100%);
  min-height: 100vh;
}

/* Cards */
.card {
  background: rgba(30, 30, 30, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.2);
}

.card-header {
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Navigation */
.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link:focus {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  transition: all 0.3s ease;
}

.navbar-brand:hover {
  transform: scale(1.05);
  transition: transform 0.3s ease;
}

/* Buttons */
.btn {
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-primary {
  background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
  border: none;
}

.btn-success {
  background: linear-gradient(135deg, var(--income-color) 0%, #1e7e34 100%);
  border: none;
}

.btn-danger {
  background: linear-gradient(135deg, var(--expense-color) 0%, #c82333 100%);
  border: none;
}

.btn-warning {
  background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
  border: none;
  color: #000;
}

.btn-info {
  background: linear-gradient(135deg, #0dcaf0 0%, #0aa2c0 100%);
  border: none;
}

/* Financial specific styles */
.amount-income {
  color: var(--income-color);
  font-weight: 600;
}

.amount-expense {
  color: var(--expense-color);
  font-weight: 600;
}

.amount-transfer {
  color: var(--transfer-color);
  font-weight: 600;
}

.balance-positive {
  color: var(--budget-positive);
  font-weight: 700;
}

.balance-negative {
  color: var(--budget-negative);
  font-weight: 700;
}

/* Account Type Badges */
.badge {
  font-weight: 500;
  padding: 0.5em 0.8em;
  border-radius: 6px;
}

/* Forms */
.form-control,
.form-select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.form-control:focus,
.form-select:focus {
  background: rgba(255, 255, 255, 0.1);
  border-color: #0d6efd;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.form-control::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.form-label {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
}

/* Tables */
.table-dark {
  --bs-table-bg: rgba(30, 30, 30, 0.8);
}

.table-hover tbody tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* Progress bars */
.progress {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
}

.progress-bar {
  transition: width 0.6s ease;
}

/* Alerts */
.alert {
  border: none;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.alert-success {
  background: linear-gradient(135deg, rgba(25, 135, 84, 0.2) 0%, rgba(25, 135, 84, 0.1) 100%);
  border-left: 4px solid var(--income-color);
}

.alert-danger {
  background: linear-gradient(135deg, rgba(220, 53, 69, 0.2) 0%, rgba(220, 53, 69, 0.1) 100%);
  border-left: 4px solid var(--expense-color);
}

.alert-warning {
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.2) 0%, rgba(255, 193, 7, 0.1) 100%);
  border-left: 4px solid #ffc107;
}

.alert-info {
  background: linear-gradient(135deg, rgba(13, 202, 240, 0.2) 0%, rgba(13, 202, 240, 0.1) 100%);
  border-left: 4px solid #0dcaf0;
}

/* Modals */
.modal-content {
  background: rgba(30, 30, 30, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
}

.modal-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Dropdowns */
.dropdown-menu {
  background: rgba(30, 30, 30, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  border-radius: 12px;
}

.dropdown-item:hover,
.dropdown-item:focus {
  background: rgba(255, 255, 255, 0.1);
}

/* Pagination */
.page-link {
  background: rgba(30, 30, 30, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.page-link:hover {
  background: rgba(13, 110, 253, 0.8);
  border-color: #0d6efd;
  color: #ffffff;
}

.page-item.active .page-link {
  background: #0d6efd;
  border-color: #0d6efd;
}

/* Spinners and Loading */
.spinner-border-sm {
  width: 1rem;
  height: 1rem;
}

/* Charts */
.chart-container {
  position: relative;
  height: 300px;
}

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

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

@keyframes slideInFromRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.slide-in-right {
  animation: slideInFromRight 0.5s ease-out;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .card {
    margin-bottom: 1rem;
  }
  
  .btn {
    font-size: 0.875rem;
  }
  
  .display-6 {
    font-size: 2rem;
  }
}

/* Print styles */
@media print {
  .navbar,
  .btn,
  .pagination,
  .modal {
    display: none !important;
  }
  
  .card {
    border: 1px solid #000;
    background: #fff !important;
    color: #000 !important;
  }
  
  body {
    background: #fff !important;
    color: #000 !important;
  }
}

/* Status indicators */
.status-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
}

.status-active {
  background-color: var(--income-color);
}

.status-inactive {
  background-color: var(--bs-warning);
}

.status-overdue {
  background-color: var(--expense-color);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
  100% {
    opacity: 1;
  }
}

/* Utility classes */
.text-income {
  color: var(--income-color) !important;
}

.text-expense {
  color: var(--expense-color) !important;
}

.text-transfer {
  color: var(--transfer-color) !important;
}

.bg-income {
  background-color: var(--income-color) !important;
}

.bg-expense {
  background-color: var(--expense-color) !important;
}

.bg-transfer {
  background-color: var(--transfer-color) !important;
}

/* Toast notifications */
.toast {
  border-radius: 12px;
  backdrop-filter: blur(10px);
}

/* File upload areas */
.file-drop-zone {
  border: 2px dashed rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.02);
}

.file-drop-zone:hover,
.file-drop-zone.dragover {
  border-color: #0d6efd;
  background: rgba(13, 110, 253, 0.1);
}

/* Dashboard specific styles */
.dashboard-stats-card {
  position: relative;
  overflow: hidden;
}

.dashboard-stats-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0.1) 100%);
}

/* Category color indicators */
.category-color-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 8px;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

/* Transaction type indicators */
.transaction-type-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: bold;
  margin-right: 8px;
}

.transaction-type-income {
  background: rgba(25, 135, 84, 0.2);
  color: var(--income-color);
}

.transaction-type-expense {
  background: rgba(220, 53, 69, 0.2);
  color: var(--expense-color);
}

.transaction-type-transfer {
  background: rgba(108, 117, 125, 0.2);
  color: var(--transfer-color);
}

/* Custom form controls */
.form-switch .form-check-input {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
}

.form-switch .form-check-input:checked {
  background-color: #0d6efd;
  border-color: #0d6efd;
}

/* Loading states */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(5px);
}

.loading-content {
  text-align: center;
  color: white;
}

/* Error states */
.error-container {
  text-align: center;
  padding: 3rem 1rem;
}

.error-icon {
  font-size: 4rem;
  opacity: 0.5;
  margin-bottom: 1rem;
}

/* Success states */
.success-container {
  text-align: center;
  padding: 3rem 1rem;
}

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

/* Footer */
footer {
  background: rgba(18, 18, 18, 0.95) !important;
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Responsive chart containers */
.chart-responsive {
  position: relative;
  height: 300px;
  width: 100%;
}

@media (max-width: 576px) {
  .chart-responsive {
    height: 250px;
  }
}

/* Accessibility improvements */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Focus improvements */
.btn:focus,
.form-control:focus,
.form-select:focus {
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.5);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .card {
    border: 2px solid #ffffff;
  }
  
  .btn {
    border: 2px solid;
  }
  
  .form-control,
  .form-select {
    border: 2px solid #ffffff;
  }
}