/* ===========================
   GLOBAL RESET & BASE STYLES
   =========================== */

/* Reset default browser styles for consistent rendering across browsers */
* {
  box-sizing: border-box; /* include padding/border in size */
  margin: 0;
  padding: 0;
}

/* Base body styles */
body {
  background-color: #ffffff;
  line-height: 1.6;
  overflow-x: hidden; /* prevent horizontal scrollbar */
  font-family: "Inter", sans-serif;
  font-weight: 600; /* keep as requested */
}

/* ===========================
   MAIN LAYOUT
   =========================== */

/* Main container holding sidebar and content */
.app-container {
  margin: 0.625rem; /* 10px */
  display: flex;
  height: calc(100vh - 1.25rem); /* full viewport minus top/bottom margins */
  gap: 1.25rem; /* 20px */
}

/* ===========================
   SIDEBAR
   =========================== */

/* Sidebar container - left side navigation */
.sidebar-container {
  background-color: #ffffff;
  flex: 0 0 20%;
  overflow-y: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 6.25rem; /* 100px */
  border-right: solid 0.0625rem #e0e0e0; /* 1px */
}

/* Website title positioning */
.website-title {
  color: #2a7ee5;
  font-size: 1.1rem;
  position: absolute;
  top: 1.5rem;
  left: 2rem;
}

/* Navigation links list */
.nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.nav-links li {
  text-align: left;
}

.nav-links li a {
  display: flex;
  align-items: center;
  gap: 0.75rem; /* 12px */
  text-decoration: none;
  font-size: 1.25rem; /* 20px */
  color: #000000;
  transition: color 0.3s ease;
}

.nav-links li a:hover,
.nav-links li a.active {
  color: #2a7ee5;
}

/* Smooth icon spacing */
.nav-links li a svg {
  transition: color 0.3s ease;
  margin-right: 0.625rem; /* 10px */
}

/* ===========================
   CONTENT CONTAINER
   =========================== */

/* Main content area - right side of app */
.content-container {
  flex: 1;
  overflow: hidden;
  padding: 1rem;
  background-color: #ffffff;
}

/* Individual view/section */
.view {
  display: none;
  flex-direction: column;
  height: 100%;
  gap: 1.25rem;
}

.view.active {
  display: flex;
}

/* Top row - takes 25% of height */
.top-row {
  flex: 0 0 25%;
  background-color: #ffffff;
  padding: 1.25rem;
  border-bottom: solid #e0e0e0 0.0625rem;
  overflow: hidden;
  display: flex;
  gap: 2rem;
  align-items: center;
  justify-items: center;
}

/* Bottom area - remaining 75% */
.bottom-area {
  flex: 1;
  display: flex;
  gap: 0.5rem;
  background-color: #ffffff;
  padding: 10px;
  min-height: 0; /* allow flex children to shrink */
}

/* Bottom left section */
.bottom-left {
  flex: 1;
  background-color: #ffffff;
  padding: 1.25rem;
  overflow-y: auto;
  border-right: solid #e0e0e0 0.0625rem;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Bottom right section */
.bottom-right {
  flex: 1;
  background-color: #ffffff;
  padding: 1.25rem;
  padding-left: 4rem; /* 50px spacing from feed */
  overflow: hidden;
  min-height: 0;
  display: flex;
  flex-direction: column;
  max-height: 100%;
}

/* ===========================
   DASHBOARD / INFO CARDS
   =========================== */

/* Container for the cards */
#dashboard .top-row {
  display: flex;
  gap: 2rem;
  align-items: center;
  justify-items: center;
}

/* Individual info card */
.info-card {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  background-color: #ffffff;
  padding: 1.5rem;
  height: 150px;
  transition: transform 0.25s ease;
}

.info-card:hover {
  transform: translateY(-2px);
  cursor: pointer;
}

/* Icon container */
.card-icon {
  width: 3.75rem;
  height: 3.75rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #ffffff;
}

.card-icon.blue { background-color: #2a7ee5; }
.card-icon.green { background-color: #09be09; }
.card-icon.red { background-color: #ef445b; }

.card-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-label {
  font-size: 1.1rem;
  color: #000000;
  font-weight: 600;
}

.card-value {
  font-size: 1.875rem;
  font-weight: 700;
  color: #000000;
}

/* ===========================
   TRANSACTION FEED
   =========================== */

.feed-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-shrink: 0;
  height: 32px;
}

.feed-header-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.feed-header-content svg {
  color: #000000;
  flex-shrink: 0;
}

.feed-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #000000;
  margin: 0;
}

/* Transaction feed container */
.transaction-feed {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1rem;
  overflow-y: auto;
  flex: 1;
}

/* Hide scrollbar for Chrome/Safari/Opera */
.transaction-feed::-webkit-scrollbar { display: none; }

/* Hide scrollbar for IE/Edge/Firefox */
.transaction-feed { -ms-overflow-style: none; scrollbar-width: none; }

/* Individual transaction card */
.transaction-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background-color: #ffffff;
  padding: 1rem;
  transition: all 0.2s ease;
  width: 100%;
  max-width: 650px;
}

/* Emoji circle on the left */
.transaction-emoji {
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

/* Transaction info (title + date) */
.transaction-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.transaction-title {
  font-size: 1rem;
  font-weight: 600;
  color: #000000;
}

.transaction-date {
  font-size: 0.875rem;
  color: #9ca3af;
  font-weight: 400;
}

/* Amount badge on the right */
.transaction-amount {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 15px;
  font-size: 0.875rem;
  font-weight: 600;
  flex-shrink: 0;
  height: 40px;
}

/* Delete button for transactions */
.transaction-delete {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #9ca3af;
  flex-shrink: 0;
  margin-left: 0.5rem;
}

.transaction-delete:hover {
  background-color: #ffeeee;
  color: #ef4444;
}

.transaction-delete svg {
  width: 18px;
  height: 18px;
}

/* Income styling - green */
.transaction-amount.income {
  color: #059669;
  background-color: rgba(5, 150, 105, 0.1);
}

/* Expense styling - red */
.transaction-amount.expense {
  color: #dc2626;
  background-color: rgba(220, 38, 38, 0.1);
}

.transaction-amount svg { width: 18px; height: 18px; }

/* ===========================
   FINANCIAL CHART SECTION
   =========================== */

.chart-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  height: 32px;
  margin-bottom: 1.5rem;
}

.chart-header svg {
  color: #000000;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
}

.chart-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.chart-wrapper {
  position: relative;
  width: 90%;
  max-width: 650px;
  max-height: 80%;
  aspect-ratio: 1;
  flex-shrink: 1;
}

.health-message {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
  border-radius: 15px;
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.5;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.health-message svg { width: 24px; height: 24px; flex-shrink: 0; }

/* Health status colors */
.health-message.good {
  color: #059669;
  background-color: rgba(5, 150, 105, 0.1);
}
.health-message.good svg { color: #059669; }

.health-message.caution {
  color: #d97706;
  background-color: rgba(217, 119, 6, 0.1);
}
.health-message.caution svg { color: #d97706; }

.health-message.alert {
  color: #dc2626;
  background-color: rgba(220, 38, 38, 0.1);
}
.health-message.alert svg { color: #dc2626; }

.health-message.neutral {
  color: #6b7280;
  background-color: rgba(107, 114, 128, 0.1);
}
.health-message.neutral svg { color: #6b7280; }

/* ===========================
   INCOME / EXPENSES SECTIONS
   =========================== */

/* Top rows for income & expenses */
#income .top-row,
#expenses .top-row {
  display: flex;
  flex-direction: column;
  height: 100%;
  align-items: flex-start;
  flex: 0 0 35%;
  padding-top: 0.5rem;
  padding-bottom: 1.5rem;
}

.section-header-simple {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: 10%;
  min-height: 30px;
  flex-shrink: 0;
  justify-content: flex-start;
  left: 2px;
}

.section-header-simple svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.section-header-simple h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
}

.line-chart-wrapper {
  flex: 1;
  position: relative;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

#incomeLineChart {
  width: 100% !important;
  height: 100% !important;
}

/* ===========================
   FORM HEADER & TRANSACTION FORM
   =========================== */

.form-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-shrink: 0;
  height: 32px;
}

.form-header svg { color: #000000; flex-shrink: 0; }

.form-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #000000;
  margin: 0;
}

.transaction-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  flex: 1;
  overflow-y: auto;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  font-size: 1rem;
  font-weight: 600;
  color: #000000;
}

.form-input {
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  color: #1f2937;
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  transition: all 0.2s ease;
  font-family: 'Inter', sans-serif;
}

.form-input:focus {
  outline: none;
  border-color: #2a7ee5;
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(42, 126, 229, 0.1);
}

.form-input::placeholder { color: #9ca3af; }

/* ===========================
   EMOJI PICKER
   =========================== */

.emoji-picker { position: relative; }

.emoji-button {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1.5rem;
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.emoji-button:hover {
  border-color: #2a7ee5;
  background-color: #ffffff;
}

.emoji-button svg { color: #9ca3af; flex-shrink: 0; }

.emoji-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  padding: 0.75rem;
  display: none;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 100;
  width: 100%;
  max-height: 350px;
}

.emoji-dropdown.active { display: flex; }

.emoji-search input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 0.875rem;
  font-family: 'Inter', sans-serif;
}

.emoji-search input:focus { outline: none; border-color: #2a7ee5; }

.emoji-categories {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 0.5rem;
}

.category-btn {
  padding: 0.5rem;
  font-size: 1.25rem;
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  opacity: 0.5;
}

.category-btn:hover { background-color: #f3f4f6; opacity: 1; }

.category-btn.active {
  background-color: rgba(42, 126, 229, 0.1);
  opacity: 1;
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.25rem;
  overflow-y: auto;
  max-height: 200px;
}

.emoji-option {
  padding: 0.5rem;
  font-size: 1.5rem;
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.emoji-option:hover {
  background-color: #f3f4f6;
  transform: scale(1.2);
}

/* ===========================
   ADD TRANSACTION BUTTON
   =========================== */

.btn-add-transaction {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 15px 30px; /* final padding */
  background-color: #2a7ee5;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Inter', sans-serif;
  margin-top: 0.5rem;
  width: auto;
  align-self: flex-start;
}

.btn-add-transaction:hover {
  background-color: #ffffff;
  color: #2a7ee5;
  border: solid 3px #2a7ee5;
}

.btn-add-transaction:active { transform: translateY(0); }

/* ===========================
   EMPTY STATE
   =========================== */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  text-align: center;
  color: #9ca3af;
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 0.5rem;
}

.empty-state-message {
  font-size: 0.875rem;
  color: #9ca3af;
  max-width: 280px;
}
