:root {
  --primary: #3f51b5;
  --primary-light: #e8eaf6;
  --secondary: #ff4081;
  --text: #333;
  --text-light: #666;
  --border: #ddd;
  --success: #4caf50;
  --danger: #f44336;
  --warning: #ff9800;
  --background: #f9f9f9;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body { 
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  padding: 0; 
  margin: 0;
  background-color: var(--background);
  color: var(--text);
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

header {
  background-color: var(--primary);
  color: white;
  padding: 20px 0;
  box-shadow: 0 3px 5px rgba(0,0,0,0.1);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-logo {
  font-weight: 700;
  font-size: 1.5rem;
  color: white;
  padding-right: 15px;
}

.header-text {
  flex: 1;
}

header h1 {
  font-size: 2rem;
  margin: 0;
  font-weight: 600;
}

.free-badge {
  display: inline-block;
  background-color: var(--secondary);
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.9rem;
  margin-right: 8px;
  vertical-align: middle;
}

header p {
  margin-top: 5px;
  opacity: 0.8;
}

.card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  padding: 25px;
  margin-bottom: 25px;
}

h2 {
  color: var(--primary);
  margin-bottom: 20px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

h2 i {
  font-size: 1.2rem;
}

label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: var(--text-light);
}

input, textarea, select {
  width: 100%;
  padding: 10px 15px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 1rem;
  margin-bottom: 15px;
  transition: border 0.3s;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
}

button {
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

button:hover {
  background-color: #303f9f;
}

button.secondary {
  background-color: var(--secondary);
}

button.secondary:hover {
  background-color: #e91e63;
}

button.danger {
  background-color: var(--danger);
  padding: 6px 10px;
  font-size: 0.9rem;
}

button.warning {
  background-color: var(--warning);
}

button.warning:hover {
  background-color: #f57c00;
}

.flex {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.half {
  flex: 1 1 calc(50% - 10px);
  min-width: 300px;
}

.dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 25px;
}

.stat-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  padding: 20px;
  text-align: center;
  transition: transform 0.3s;
}

.stat-card:hover {
  transform: translateY(-5px);
}

.stat-card i {
  font-size: 2.5rem;
  margin-bottom: 15px;
  color: var(--primary);
}

.stat-card.income i {
  color: var(--success);
}

.stat-card.expense i {
  color: var(--danger);
}

.stat-card h3 {
  font-size: 1.8rem;
  margin-bottom: 5px;
}

.stat-card p {
  color: var(--text-light);
  font-size: 0.9rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  box-shadow: 0 1px 5px rgba(0,0,0,0.05);
  background-color: white;
  border-radius: 8px;
  overflow: hidden;
}

th {
  background-color: var(--primary-light);
  color: var(--primary);
  padding: 15px;
  text-align: left;
  font-weight: 600;
}

td {
  padding: 15px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background-color: rgba(63, 81, 181, 0.05);
}

.type-badge {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
}

.income {
  background-color: rgba(76, 175, 80, 0.15);
  color: var(--success);
}

.expense {
  background-color: rgba(244, 67, 54, 0.15);
  color: var(--danger);
}

.chart-container {
  position: relative;
  height: 300px;
  margin-top: 20px;
  width: 100% !important;
  max-width: 100%;
}

/* Simplified Tab System */
.tab-buttons {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.tab-btn {
  background: none;
  border: none;
  padding: 12px 20px;
  font-size: 1rem;
  color: var(--text);
  cursor: pointer;
  position: relative;
  margin-right: 4px;
  border-radius: 4px 4px 0 0;
}

.tab-btn.active {
  background-color: white;
  color: var(--primary);
  border-top: 3px solid var(--primary);
  font-weight: 500;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-light);
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 15px;
  opacity: 0.6;
}

.alert {
  padding: 15px;
  border-radius: 4px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 15px;
}

.alert i {
  font-size: 1.5rem;
  margin-top: 2px;
}

.alert-warning {
  background-color: rgba(255, 152, 0, 0.1);
  border-left: 4px solid var(--warning);
  color: #e65100;
}

.alert-info {
  background-color: rgba(33, 150, 243, 0.1);
  border-left: 4px solid #2196f3;
  color: #0d47a1;
}

.data-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

@media (max-width: 768px) {
  .half {
    flex: 1 1 100%;
  }
  
  .data-actions {
    justify-content: center;
  }
}

.hidden-file-input {
  display: none;
}

/* SEO-related styles */
/* Updated condensed horizontal benefits strip */
.benefits-strip {
  margin: 20px 0 30px;
  padding: 15px;
  background-color: var(--primary-light);
  border-radius: 8px;
  overflow: hidden;
}

.benefits-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
}

.benefit-item {
  background: white;
  padding: 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  flex: 1 1 calc(25% - 15px);
  min-width: 200px;
}

.benefit-item i {
  font-size: 1.8rem;
  color: var(--primary);
  margin-right: 12px;
  min-width: 24px;
}

.benefit-item h3 {
  margin: 0 0 4px;
  color: var(--primary);
  font-size: 1rem;
}

.benefit-item p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-light);
}

@media (max-width: 768px) {
  .benefit-item {
    flex: 1 1 100%;
  }
}

footer {
  background-color: #333;
  color: white;
  padding: 20px 0;
  margin-top: 40px;
  text-align: center;
}

footer p {
  margin-top: 10px;
  font-size: 0.9rem;
  opacity: 0.7;
}

footer .links {
  margin-top: 20px;
}

footer .links a {
  color: white;
  margin: 0 10px;
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.3s;
}

footer .links a:hover {
  opacity: 1;
  text-decoration: underline;
}

/* Modal Styles for Privacy Policy and FAQ */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background-color: white;
  padding: 25px;
  border-radius: 8px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  position: relative;
}

.close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  color: var(--text-light);
}

.close-btn:hover {
  color: var(--primary);
}

/* Enhanced Mobile Responsiveness */

/* Base mobile adjustments */
@media (max-width: 992px) {
  .container {
    padding: 15px;
  }
  
  h2 {
    font-size: 1.4rem;
  }
  
  .card {
    padding: 20px;
    margin-bottom: 20px;
  }
  
  .chart-container {
    height: 250px;
  }
}

/* Tablet breakpoint */
@media (max-width: 768px) {
  body {
    font-size: 15px;
  }
  
  header h1 {
    font-size: 1.4rem;
  }
  
  header p {
    font-size: 0.9rem;
  }
  
  .half {
    flex: 1 1 100%;
  }
  
  .data-actions {
    justify-content: center;
  }
  
  .tab-btn {
    padding: 10px 15px;
    font-size: 0.9rem;
  }
  
  h2 {
    font-size: 1.3rem;
  }
  
  h3 {
    font-size: 1.1rem;
  }
  
  .stat-card h3 {
    font-size: 1.5rem;
  }
  
  /* Form elements improvements */
  input, textarea, select {
    padding: 12px;
    min-height: 44px; /* Minimum touch target size */
  }
  
  button {
    padding: 12px 20px;
    min-height: 44px;
  }
  
  /* Table adjustments for tablets */
  table th, table td {
    padding: 12px 8px;
    font-size: 0.9rem;
  }
  
  .modal-content {
    width: 95%;
    padding: 15px;
  }
  
  .dashboard {
    grid-template-columns: 1fr;
  }
  
  .benefit-item {
    padding: 15px;
  }
}

/* Mobile landscape breakpoint */
@media (max-width: 640px) {
  .dashboard {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  
  .stat-card {
    padding: 15px 10px;
  }
  
  .stat-card i {
    font-size: 2rem;
    margin-bottom: 10px;
  }
  
  .stat-card h3 {
    font-size: 1.3rem;
    margin-bottom: 3px;
  }
  
  .stat-card p {
    font-size: 0.8rem;
  }
  
  /* Table to card transformation for smaller screens */
  #entriesTable thead {
    display: none; /* Hide table headers */
  }
  
  #entriesTable, #entriesTable tbody, #entriesTable tr, #entriesTable td {
    display: block;
    width: 100%;
  }
  
  #entriesTable tr {
    margin-bottom: 15px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
    padding: 12px;
  }
  
  #entriesTable td {
    text-align: right;
    padding: 8px 10px;
    position: relative;
    border-bottom: 1px solid var(--border);
  }
  
  #entriesTable td:last-child {
    border-bottom: none;
    text-align: center;
    padding-top: 12px;
  }
  
  /* Add data labels */
  #entriesTable td:nth-of-type(1):before { content: "Date: "; }
  #entriesTable td:nth-of-type(2):before { content: "Type: "; }
  #entriesTable td:nth-of-type(3):before { content: "Category: "; }
  #entriesTable td:nth-of-type(4):before { content: "Description: "; }
  #entriesTable td:nth-of-type(5):before { content: "Amount: "; }
  
  #entriesTable td:before {
    content: attr(data-label);
    float: left;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.7rem;
    color: var(--text-light);
  }
}

/* Mobile portrait breakpoint */
@media (max-width: 480px) {
  .container {
    padding: 10px;
  }
  
  header {
    padding: 15px 0;
  }
  
  .header-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .site-logo {
    margin-bottom: 5px;
    font-size: 1.3rem;
  }
  
  header h1 {
    font-size: 1.2rem;
  }
  
  .card {
    padding: 15px;
    margin-bottom: 15px;
  }
  
  .dashboard {
    gap: 8px;
  }
  
  /* Adjusted touch targets */
  button {
    width: 100%;
    margin-bottom: 10px;
    justify-content: center;
  }
  
  .data-actions {
    flex-direction: column;
  }
  
  /* Chart size adjustments */
  .chart-container {
    height: 200px;
    margin-top: 15px;
    overflow: visible !important;
    width: 100% !important;
    position: relative;
  }
  
  canvas {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
  }
  
  /* More compact benefits */
  .benefits-container {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 5px;
    -webkit-overflow-scrolling: touch;
  }
  
  .benefit-item {
    min-width: 160px;
    flex: 0 0 auto;
  }
  
  .benefit-item i {
    font-size: 1.5rem;
    min-width: 20px;
  }
  
  /* Table/card responsiveness */
  #entriesTable tr {
    padding: 10px;
    margin-bottom: 10px;
  }
  
  #entriesTable td {
    padding: 6px 8px;
    font-size: 0.85rem;
    word-break: break-word;
  }
  
  .type-badge {
    padding: 3px 6px;
    font-size: 0.7rem;
  }
  
  .alert {
    padding: 10px;
    font-size: 0.85rem;
  }
  
  /* Form improvements */
  label {
    font-size: 0.9rem;
    margin-bottom: 3px;
  }
  
  input, textarea, select {
    margin-bottom: 12px;
    font-size: 0.95rem;
  }
  
  /* Footer adjustments */
  footer {
    padding: 15px 0;
    margin-top: 20px;
  }
  
  footer p {
    font-size: 0.8rem;
  }
  
  footer .links a {
    margin: 0 5px;
    font-size: 0.9rem;
  }
}

/* Language Selector Styles */
.language-dropdown {
  position: relative;
  display: inline-block;
  margin-left: 15px;
}

.language-dropdown-toggle {
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  transition: background-color 0.3s;
}

.language-dropdown-toggle:hover {
  background-color: #303f9f;
}

.language-dropdown-toggle i {
  font-size: 0.8rem;
}

.language-dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  background-color: white;
  min-width: 180px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.1);
  z-index: 100;
  border-radius: 4px;
  max-height: 300px;
  overflow-y: auto;
  margin-top: 5px;
}

.language-dropdown-menu.show {
  display: block;
}

.language-option {
  color: var(--text);
  padding: 10px 15px;
  text-decoration: none;
  display: block;
  cursor: pointer;
  transition: background-color 0.2s;
  font-size: 0.9rem;
}

.language-option:hover {
  background-color: var(--primary-light);
}

.language-option.active {
  background-color: var(--primary-light);
  font-weight: 500;
  color: var(--primary);
}

@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .header-actions {
    margin-top: 10px;
    display: flex;
    width: 100%;
  }
  
  .language-dropdown {
    margin-left: 0;
  }
}