/**
 * 💰 LEDGER APP - Main Stylesheet
 */

/* ============================================================================
   Global Styles
   ============================================================================ */

body.dayMode {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}
.ledger-app-container {
  min-height: 100vh;
}

/* ============================================================================
   Cards & Panels
   ============================================================================ */

.card {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.blue-gradient {
  background: linear-gradient(135deg, #0277bd 0%, #01579b 100%);
}

.green-gradient {
  background: linear-gradient(135deg, #43a047 0%, #1b5e20 100%);
}

.red-gradient {
  background: linear-gradient(135deg, #e53935 0%, #b71c1c 100%);
}

.orange-gradient {
  background: linear-gradient(135deg, #fb8c00 0%, #e65100 100%);
}

.purple-gradient {
  background: linear-gradient(135deg, #8e24aa 0%, #4a148c 100%);
}

/* ============================================================================
   Tables
   ============================================================================ */

table {
  font-size: 0.95rem;
}

table th {
  background-color: #f5f5f5;
  font-weight: 600;
  color: #424242;
}

table tbody tr {
  transition: background-color 0.2s ease;
}

table tbody tr:hover {
  background-color: #f9f9f9;
}

table tbody tr.status-pending {
  border-left: 4px solid #ff9800;
}

table tbody tr.status-paid {
  border-left: 4px solid #4caf50;
}

table tbody tr.status-overdue {
  border-left: 4px solid #f44336;
}

/* ============================================================================
   Forms
   ============================================================================ */

.input-field > label {
  color: #666;
}

.input-field > label.active {
  color: #0277bd;
}

.input-field input:focus,
.input-field textarea:focus {
  border-bottom: 2px solid #0277bd;
  box-shadow: 0 1px 0 0 #0277bd;
}

.input-field select:focus {
  border-bottom: 1px solid #0277bd;
}

/* Materialize form fixes */


select option {
  background: white;
  color: #333;
}

/* ============================================================================
   Buttons
   ============================================================================ */

.btn {
  transition: all 0.3s ease;
  font-weight: 500;
  text-transform: none;
}

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

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

.btn-floating {
  transition: all 0.3s ease;
}

.btn-floating:hover {
  transform: scale(1.1);
}

.quick-actions .btn {
  margin: 1rem 0;
}
/* ============================================================================
   Modals
   ============================================================================ */

.modal {
  max-height: 90vh;
  overflow-y: auto;
}

.bottom-sheet {
  max-height: 90vh;
}

.modal-content {
  padding: 2rem;
}

.modal-footer {
  border-top: 1px solid #e0e0e0;
  text-align: right;
}

/* ============================================================================
   Dashboard
   ============================================================================ */

.dashboard-card {
  border-radius: 8px;
  overflow: hidden;
}

.dashboard-card .card-content {
  padding: 1.5rem;
}

.dashboard-card h3 {
  margin: 0;
  font-size: 2rem;
  font-weight: 600;
}

.dashboard-card small {
  display: block;
  margin-top: 0.5rem;
}

/* ============================================================================
   Lists
   ============================================================================ */

.transaction-list,
.bills-list {
  max-height: 400px;
  overflow-y: auto;
}

.transaction-item,
.bill-item {
  padding: 1rem;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.2s;
}

.transaction-item:hover,
.bill-item:hover {
  background-color: #f9f9f9;
}

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

/* ============================================================================
   Status Badges
   ============================================================================ */

.badge-status {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-pending {
  background-color: #fff3e0;
  color: #e65100;
}

.badge-paid {
  background-color: #e8f5e9;
  color: #1b5e20;
}

.badge-overdue {
  background-color: #ffebee;
  color: #b71c1c;
}

.badge-income {
  background-color: #e8f5e9;
  color: #1b5e20;
}

.badge-expense {
  background-color: #ffebee;
  color: #b71c1c;
}

/* ============================================================================
   Amount Display
   ============================================================================ */

.amount-income {
  color: #43a047;
  font-weight: 600;
}

.amount-expense {
  color: #e53935;
  font-weight: 600;
}

.amount-neutral {
  color: #0277bd;
  font-weight: 600;
}

/* ============================================================================
   Icons
   ============================================================================ */

.material-icons {
  vertical-align: middle;
}

.card-title .material-icons {
  margin-right: 0.5rem;
  vertical-align: top;
}

/* ============================================================================
   Responsive
   ============================================================================ */

@media (max-width: 600px) {
  .container {
    width: 90%;
  }

  .row {
    margin-bottom: 1rem;
  }

  .card {
    margin: 0;
  }

  .card-panel {
    padding: 1rem;
  }

  table {
    font-size: 0.85rem;
  }

  .btn {
    width: 100%;
    margin-bottom: 0.5rem;
  }

  .dashboard-card h3 {
    font-size: 1.5rem;
  }
}

/* ============================================================================
   Animations
   ============================================================================ */

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

.card {
  animation: slideIn 0.3s ease-out;
}

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

.pulse-toast {
  animation: pulse 0.6s ease-in-out;
}

/* ============================================================================
   Utilities
   ============================================================================ */

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

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

.text-left {
  text-align: left;
}

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

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.hidden {
  display: none !important;
}

.opacity-50 {
  opacity: 0.5;
}

.opacity-75 {
  opacity: 0.75;
}

/* ============================================================================
   Loading States
   ============================================================================ */

.loading {
  opacity: 0.6;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #0277bd;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* ============================================================================
   Print Styles
   ============================================================================ */

@media print {
  .btn,
  .modal,
  .sidenav,
  .navbar {
    display: none !important;
  }

  .container {
    width: 100%;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ddd;
    page-break-inside: avoid;
  }
}
.gold-btn { background-color: #d4af37 !important; }
.blue-btn { background-color: #2196f3 !important; }
.ledger-wrapper { border-radius: 10px; overflow: hidden; }

.modal .modal-content {
  display: flex;
  flex-direction: inherit;
  border-radius: inherit;
  margin: inherit;
  padding: inherit;
  min-width: inherit;
  height: inherit; /* Adjust as needed */
  background-color: rgb(255, 255, 255);
}
.nightMode .modal .modal-content {
  background-color: rgba(0, 0, 0, 0.831);
}
.modal button {
  border-radius: inherit;
  border: none;
  margin: 0 3px;
  padding: 2px 10px;
}

.mb-modal-fixed {
  flex-direction: column;
  height: 80% !important; /* Fixed height */
  overflow: hidden !important; /* Disable modal's native scroll */
}
.mb-modal-fixed .open {
  display: flex !important;
  top: 0 !important;
  height: 100% !important;
}

.mb-modal-fixed .modal-header {
  flex: 0 0 auto; /* Don't grow, don't shrink */
  padding: 20px;
  z-index: 2;
}

.mb-modal-fixed .modal-content {
  flex: 1 1 auto; /* Take up all remaining space */
  overflow-y: auto !important; /* Only this part scrolls */
  padding: 20px !important;
  width: 100%;
}

.mb-modal-fixed .modal-footer {
  flex: 0 0 auto; /* Don't grow, don't shrink */
  position: relative !important; /* Override Materialize absolute positioning */
  border-top: 1px solid #ddd;
  background: #fff;
  padding: 10px 20px;
  height: auto !important;
}

