/* Compact Modern Mobile-First UI Design System for Expenses Tracker */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  /* Color Palette */
  --brand-primary: #6366f1;
  --brand-primary-hover: #4f46e5;
  --brand-primary-soft: rgba(99, 102, 241, 0.1);
  
  --cash-in: #10b981;
  --cash-in-hover: #059669;
  --cash-in-bg: rgba(16, 185, 129, 0.08);
  --cash-in-border: rgba(16, 185, 129, 0.2);
  
  --cash-out: #f43f5e;
  --cash-out-hover: #e11d48;
  --cash-out-bg: rgba(244, 63, 94, 0.08);
  --cash-out-border: rgba(244, 63, 94, 0.2);
  
  --bg-body: #f8fafc;
  --bg-surface: #ffffff;
  
  --text-main: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --border-color: #e2e8f0;
  --border-focus: #6366f1;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;
  
  --nav-height: 52px;
  --bottom-nav-height: 56px;
}

/* Force disable ALL box shadows across elements */
*, *::before, *::after,
.shadow, .shadow-sm, .shadow-md, .shadow-lg, .shadow-none,
.card, .card-custom, .btn, .form-control, .form-select, .modal-content, .dropdown-menu, .alert, .table {
  box-shadow: none !important;
  -webkit-box-shadow: none !important;
}

/* Disable hover transforms for cards and buttons */
.card-custom, .btn, .expense-item, .bottom-nav-item i {
  transform: none !important;
  transition: none !important;
}

/* Enable spinner rotation animation for loading screen */
.spinner-border {
  display: inline-block !important;
  width: 2.2rem !important;
  height: 2.2rem !important;
  vertical-align: -0.125em !important;
  border: 0.22em solid #6366f1 !important;
  border-right-color: transparent !important;
  border-radius: 50% !important;
  animation: spin-loader 0.75s linear infinite !important;
}

.fa-spin {
  animation: spin-loader 1s linear infinite !important;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-body);
  color: var(--text-main);
  margin: 0;
  padding-bottom: calc(var(--bottom-nav-height) + 12px);
  -webkit-font-smoothing: antialiased;
  font-size: 0.9rem;
}

@media (min-width: 769px) {
  body {
    padding-bottom: 24px;
  }
}

@media (min-width: 576px) {
  .w-sm-auto {
    width: auto !important;
  }
}

/* Compact Flat Cards */
.card-custom {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

/* Header App Bar */
.app-header {
  position: sticky;
  top: 0;
  z-index: 1020;
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 8px 0;
}

.app-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--brand-primary);
  text-decoration: none;
  cursor: default;
  user-select: none;
}

.app-logo i {
  background: var(--brand-primary);
  color: white;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

.app-logo-img {
  height: 32px;
  width: auto;
  object-fit: contain;
}

/* Compact Stat Cards */
.stat-card {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stat-card .stat-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  margin-bottom: 6px;
}

.stat-card-in {
  background: #f0fdf4;
  border: 1px solid var(--cash-in-border);
}
.stat-card-in .stat-icon {
  background: var(--cash-in-bg);
  color: var(--cash-in);
}
.stat-card-in .stat-value {
  color: var(--cash-in);
}

.stat-card-out {
  background: #fff1f2;
  border: 1px solid var(--cash-out-border);
}
.stat-card-out .stat-icon {
  background: var(--cash-out-bg);
  color: var(--cash-out);
}
.stat-card-out .stat-value {
  color: var(--cash-out);
}

.stat-card-net {
  background: #f5f3ff;
  border: 1px solid rgba(99, 102, 241, 0.2);
}
.stat-card-net .stat-icon {
  background: var(--brand-primary-soft);
  color: var(--brand-primary);
}
.stat-card-net .stat-value {
  color: var(--brand-primary);
}

.stat-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.stat-value {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.2;
}

/* Compact Mobile Bottom Navigation */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 1030;
}

@media (min-width: 769px) {
  .mobile-bottom-nav {
    display: none !important;
  }
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.7rem;
  font-weight: 600;
  gap: 2px;
  width: 25%;
  height: 100%;
}

.bottom-nav-item i {
  font-size: 1.15rem;
}

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

/* Compact Transaction Type Toggle Switches */
.type-toggle-container {
  display: flex;
  background: var(--bg-body);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 12px;
}

.type-toggle-btn {
  flex: 1;
  padding: 8px;
  border-radius: var(--radius-sm);
  border: none;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  background: transparent;
  color: var(--text-secondary);
}

.type-toggle-btn.active-in {
  background: var(--cash-in);
  color: white;
}

.type-toggle-btn.active-out {
  background: var(--cash-out);
  color: white;
}

/* Compact Mobile Transaction List Cards */
.expense-item {
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  margin-bottom: 8px;
  width: 100%;
  box-sizing: border-box;
}

.expense-icon-badge {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.expense-item.is-in .expense-icon-badge {
  background: var(--cash-in-bg);
  color: var(--cash-in);
}

.expense-item.is-out .expense-icon-badge {
  background: var(--cash-out-bg);
  color: var(--cash-out);
}

.expense-details {
  flex-grow: 1;
  margin: 0 10px;
}

.expense-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-main);
  margin-bottom: 1px;
}

.expense-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.expense-amount {
  font-weight: 400;
  font-size: 0.88rem;
  text-align: right;
  white-space: nowrap;
}

.expense-amount.in {
  color: var(--cash-in);
}

.expense-amount.out {
  color: var(--cash-out);
}

/* Compact Form Controls & Inputs */
.form-control-custom {
  border-radius: var(--radius-md);
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  font-family: var(--font-family);
  font-size: 0.88rem;
}

.form-control-custom:focus {
  border-color: var(--brand-primary);
  outline: none;
}

/* Compact Custom Buttons */
.btn-brand {
  background: var(--brand-primary);
  color: white;
  font-weight: 700;
  border-radius: var(--radius-md);
  padding: 8px 16px;
  border: none;
  font-size: 0.88rem;
}

.btn-brand:hover, .btn-brand:focus {
  background: var(--brand-primary-hover);
  color: white;
}

/* Compact Perfect Round Action Buttons */
.btn-icon-circle {
  width: 32px !important;
  height: 32px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  line-height: 1 !important;
  font-size: 0.85rem !important;
}

/* Perfect Round Pagination Buttons */
.pagination {
  gap: 8px !important;
}

.pagination .page-link {
  width: 36px !important;
  height: 36px !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 50% !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 0.88rem !important;
  font-weight: 700 !important;
}

/* Compact Modal Improvements */
.modal-content-custom {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.modal-header-custom {
  border-bottom: 1px solid var(--border-color);
  padding: 14px 18px;
  background: var(--bg-surface);
}

.modal-body-custom {
  padding: 18px;
}

/* Compact Table Styling with Row Separators */
.table-custom {
  border-collapse: collapse;
  width: 100%;
}

.table-custom th {
  border-bottom: 2px solid var(--border-color);
  font-weight: 700;
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 12px;
}

.table-custom td {
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  padding: 12px;
  vertical-align: middle;
  font-size: 0.88rem;
}

.table-custom tbody tr:last-child td {
  border-bottom: none;
}

/* Compact Badges */
.badge-custom {
  padding: 4px 8px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.7rem;
}

.badge-in {
  background: var(--cash-in-bg);
  color: var(--cash-in);
}

.badge-out {
  background: var(--cash-out-bg);
  color: var(--cash-out);
}
