/* Card Component */
.card {
  background-color: #4a5568;
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  border-left: 2px solid #0066b3; /* Capitec blue accent */
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: 0 6px 8px -2px rgba(0, 0, 0, 0.15), 0 3px 6px -2px rgba(0, 0, 0, 0.1);
}

/* Button Components */
.btn { 
  display: inline-flex; 
  align-items: center; 
  justify-content: center; 
  padding: 0.5rem 0.75rem; 
  border-radius: 0.375rem; 
  font-weight: 600; 
  transition: background-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out; 
  cursor: pointer; 
  border: none; 
  gap: 0.35rem; 
  font-size: 0.875rem; 
}

.btn svg { 
  width: 1em; 
  height: 1em; 
}

.btn-primary {
  background-color: #0066b3; /* Capitec blue */
  color: white;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.btn-primary:hover:not(:disabled) {
  background-color: #0055a4; /* Darker Capitec blue */
  box-shadow: 0 0 0 3px rgba(0, 102, 179, 0.3);
  transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(1px);
}

.btn-secondary { 
  background-color: #4a5568; 
  color: #e2e8f0; 
  border: 1px solid #718096; 
}

.btn-secondary:hover:not(:disabled) { 
  background-color: #2d3748; 
  box-shadow: 0 0 0 3px rgba(113, 128, 150, 0.5); 
}

.btn-secondary.active { 
  background-color: #2d3748; 
  box-shadow: 0 0 0 3px rgba(113, 128, 150, 0.5); 
  border-color: #a0aec0; 
}

.btn-danger {
  background-color: #e53e3e;
  color: white;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.btn-danger:hover:not(:disabled) {
  background-color: #c53030;
  box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.5);
  transform: translateY(-1px);
}

.btn-danger:active:not(:disabled) {
  transform: translateY(1px);
}

.btn-danger-sm { 
  background-color: #e53e3e; 
  color: white; 
  padding: 0.2rem 0.4rem; 
  font-size: 0.75rem; 
}

.btn-danger-sm:hover:not(:disabled) { 
  background-color: #c53030; 
}

.btn-info {
  background-color: #00b140; /* Capitec green */
  color: white;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.btn-info:hover:not(:disabled) {
  background-color: #009a38; /* Darker Capitec green */
  box-shadow: 0 0 0 3px rgba(0, 177, 64, 0.5);
  transform: translateY(-1px);
}

.btn-info:active:not(:disabled) {
  transform: translateY(1px);
}

.btn-warning { 
  background-color: #ed8936; 
  color: white; 
}

.btn-warning:hover:not(:disabled) { 
  background-color: #dd6b20; 
  box-shadow: 0 0 0 3px rgba(237, 137, 54, 0.5); 
}

.btn-chart { 
  background-color: #6b46c1; 
  color: white; 
  padding: 0.3rem 0.5rem; 
}

.btn-chart:hover:not(:disabled) { 
  background-color: #553c9a; 
  box-shadow: 0 0 0 3px rgba(107, 70, 193, 0.5); 
}

.btn-chart svg { 
  width: 0.9em; 
  height: 0.9em; 
}

.btn:disabled { 
  opacity: 0.5; 
  cursor: not-allowed; 
}

/* Badge Component */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #e53e3e;
  color: white;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
  height: 1.25rem;
  min-width: 1.25rem;
  padding: 0 0.35rem;
  margin-left: 0.5rem;
}

.badge:empty {
  display: none;
}

/* Input Components */
.input-number {
  padding: 0.35rem 0.7rem;
  border-radius: 0.25rem;
  border: 1px solid #718096 !important; /* Lighter border */
  background-color: #374151 !important; /* Lighter background */
  color: #e2e8f0 !important; /* Slightly darker text */
  text-align: right;
}

.input-number:disabled { 
  opacity: 0.5; 
  background-color: #2d3748; 
}

/* Message Box Component */
#message-box {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #00b140; /* Capitec green */
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 2002;
  opacity: 0;
  transition: opacity 0.5s ease-in-out, top 0.5s ease-in-out, transform 0.3s ease;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-left: 4px solid #009a38; /* Darker Capitec green */
}

#message-box.show {
  opacity: 1;
  top: 40px;
  animation: pulse-scale 0.3s ease-in-out;
}

#message-box.error { 
  background-color: #f56565; 
}

#message-box.warning { 
  background-color: #ecc94b; 
  color: #1a202c; 
}

#message-box svg { 
  width: 1.25em; 
  height: 1.25em; 
  flex-shrink: 0; 
}

/* Modal Components */
.modal-overlay { 
  position: fixed; 
  inset: 0; 
  background-color: rgba(0, 0, 0, 0.75); 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  z-index: 50; 
  opacity: 0; 
  transition: opacity 0.3s ease-in-out; 
  pointer-events: none; 
}

.modal-overlay.show { 
  opacity: 1; 
  pointer-events: auto; 
}

.modal-content { 
  background-color: #2d3748; 
  padding: 1.5rem; 
  border-radius: 0.75rem; 
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); 
  max-width: 700px; 
  width: 90%; 
  max-height: 90vh; 
  overflow-y: hidden; 
  position: relative; 
  transform: scale(0.95); 
  transition: transform 0.3s ease-in-out; 
  display: flex; 
  flex-direction: column; 
}

.modal-overlay.show .modal-content { 
  transform: scale(1); 
}

.modal-header { 
  margin-bottom: 1rem; 
  padding-right: 2rem; 
}

.modal-body { 
  flex-grow: 1; 
  overflow-y: auto; 
  padding-right: 0.5rem; 
}

.modal-footer { 
  margin-top: 1rem; 
  display: flex; 
  justify-content: flex-end;
  gap: 1rem; 
  flex-shrink: 0; 
}

.modal-close-button { 
  position: absolute; 
  top: 0.75rem; 
  right: 0.75rem; 
  background: none; 
  border: none; 
  color: #a0aec0; 
  cursor: pointer; 
  padding: 0.25rem; 
  z-index: 10; 
}

.modal-close-button:hover { 
  color: #e2e8f0; 
}

.modal-close-button svg { 
  width: 1.5rem; 
  height: 1.5rem; 
}

/* Action Buttons Layout */
.action-buttons { 
  display: flex; 
  flex-direction: column; 
  gap: 0.25rem; 
  justify-content: center; 
  align-items: center; 
}

.action-row { 
  display: flex; 
  gap: 0.25rem; 
  justify-content: center; 
  flex-wrap: wrap; 
}

/* Settings Modal Styles */
.settings-grid { 
  display: grid; 
  grid-template-columns: auto 1fr; 
  gap: 1rem 0.5rem; 
  align-items: center; 
}

.settings-label { 
  font-weight: 600; 
  text-align: right; 
  color: #a0aec0;
}

.settings-options label { 
  margin-right: 1rem; 
  cursor: pointer; 
  color: #cbd5e0; 
}

.settings-options input[type="radio"] { 
  margin-right: 0.25rem; 
  accent-color: #4299e1; 
}

.custom-item-input { 
  width: 100%; 
}

#custom-items-list { 
  max-height: 150px; 
  overflow-y: auto; 
  background-color: #1a202c; 
  padding: 0.5rem; 
  border-radius: 0.25rem; 
  margin-top: 0.5rem; 
}

.custom-item-entry { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  padding: 0.25rem 0; 
  border-bottom: 1px solid #4a5568; 
  font-size: 0.8rem; 
}

.custom-item-entry:last-child { 
  border-bottom: none; 
}

/* History Chart Styles */
#history-chart-container { 
  width: 100%; 
  height: 350px; 
  background-color: #1a202c; 
  border-radius: 0.25rem; 
  padding: 10px; 
  box-sizing: border-box; 
  position: relative; 
}

#history-chart-svg { 
  display: block; 
  width: 100%; 
  height: 100%; 
  overflow: visible; 
}

.chart-axis { 
  stroke: #4a5568; 
  stroke-width: 1; 
}

.chart-grid { 
  stroke: #4a5568; 
  stroke-width: 0.5; 
  stroke-dasharray: 2,2; 
}

.chart-label { 
  fill: #a0aec0; 
  font-size: 10px; 
}

.chart-line { 
  fill: none; 
  stroke-width: 2; 
  transition: opacity 0.3s; 
}

.chart-point { 
  stroke: #1a202c; 
  stroke-width: 1; 
  transition: opacity 0.3s; 
  cursor: pointer; 
}

.chart-tooltip { 
  position: absolute; 
  background-color: rgba(45, 55, 72, 0.9); 
  color: #e2e8f0; 
  padding: 0.3rem 0.6rem; 
  border-radius: 0.25rem; 
  font-size: 0.8rem; 
  pointer-events: none; 
  opacity: 0; 
  transition: opacity 0.2s; 
  white-space: nowrap; 
  z-index: 10; 
}

.chart-legend { 
  margin-top: 0.5rem; 
  display: flex; 
  flex-wrap: wrap; 
  gap: 0.75rem; 
  justify-content: center; 
}

.legend-item { 
  display: flex; 
  align-items: center; 
  gap: 0.25rem; 
  font-size: 0.8rem; 
  cursor: pointer; 
  padding: 0.2rem 0.4rem; 
  border-radius: 0.25rem; 
  border: 1px solid transparent; 
}

.legend-item:hover { 
  border-color: #718096; 
}

.legend-color-box { 
  width: 12px; 
  height: 12px; 
  border-radius: 2px; 
  flex-shrink: 0; 
}

.legend-item.disabled { 
  opacity: 0.4; 
  text-decoration: line-through; 
}

/* Activity Log Styles */
#activity-log-card { 
  background-color: #4a5568; 
  border-radius: 0.5rem; 
  padding: 1rem; 
}

#activity-log-filters { 
  margin-bottom: 0.75rem; 
  display: flex; 
  gap: 0.5rem; 
  flex-wrap: wrap; 
}

#activity-log { 
  max-height: 250px; 
  overflow-y: auto; 
  background-color: #2d3748; 
  padding: 0.5rem; 
  border-radius: 0.25rem; 
}

.log-entry { 
  font-size: 0.8rem; 
  color: #cbd5e0; 
  margin-bottom: 0.25rem; 
  line-height: 1.4; 
  padding: 0.1rem 0.25rem; 
}

.log-entry .log-day { 
  font-weight: 600; 
  color: #a0aec0; 
  margin-right: 0.5em; 
  display: inline-block; 
  width: 2.5em; 
}

.log-entry-buy { 
  background-color: rgba(104, 211, 145, 0.1); 
  border-left: 3px solid #68d391; 
}

.log-entry-sell { 
  background-color: rgba(252, 129, 129, 0.1); 
  border-left: 3px solid #fc8181; 
}

.log-entry-event { 
  background-color: rgba(246, 173, 85, 0.1); 
  border-left: 3px solid #f6ad55; 
}

.log-entry-debt { 
  background-color: rgba(129, 170, 252, 0.1); 
  border-left: 3px solid #81aaff; 
}

.log-entry-sars { 
  background-color: rgba(183, 148, 244, 0.1); 
  border-left: 3px solid #b794f4; 
}

/* Travel Section Styles */
#travel-section {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  padding: 0.5rem 0;
}

#travel-section .btn {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#travel-section .btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#travel-section .btn:active:not(:disabled) {
  transform: translateY(1px);
}

#travel-section .btn { 
  width: auto; 
}

/* Pending Event Display */
#pending-event-card {
  border: 2px solid #f6ad55;
}

/* Savings Account Styles */
#savings-section {
  margin-top: 1rem;
  transition: transform 0.3s ease;
}

.savings-balance {
  font-size: 1.25rem;
  font-weight: 600;
  color: #0066b3; /* Capitec blue */
  margin-bottom: 0.5rem;
}

.savings-interest-rate {
  font-size: 0.8rem;
  color: #a0aec0;
  margin-bottom: 1rem;
}

.savings-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.log-entry-savings {
  background-color: rgba(0, 102, 179, 0.1); /* Capitec blue */
  border-left: 3px solid #0066b3;
}

/* Inventory Upgrades Styles */
.tooltip-icon {
  color: #e2e8f0;
}
.upgrade-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid #4a5568;
  background-color: #2d3748;
  margin-bottom: 0.5rem;
  border-radius: 0.25rem;
}

.upgrade-item.purchased {
  opacity: 0.7;
  background-color: rgba(104, 211, 145, 0.1);
}

.upgrade-details {
  flex: 1;
}

.upgrade-name {
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.upgrade-description {
  color: #a0aec0;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.upgrade-cost {
  font-weight: 600;
  color: #fc8181;
}

.upgrade-action {
  margin-left: 1rem;
}
.log-entry-upgrade {
  background-color: rgba(104, 211, 145, 0.1);
  border-left: 3px solid #68d391;
}

.log-entry-investment {
  background-color: rgba(56, 178, 172, 0.1);
  border-left: 3px solid #38b2ac;
}

/* Loan Shark Styles */
.debt-ratio-bar {
  height: 8px;
  background-color: #2d3748;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.debt-ratio-fill {
  height: 100%;
  background-color: #0066b3; /* Capitec blue */
  border-radius: 4px;
  transition: width 0.3s ease, background-color 0.3s ease;
}

.debt-ratio-warning .debt-ratio-fill {
  background-color: #f6ad55;
}

.debt-ratio-danger .debt-ratio-fill {
  background-color: #fc8181;
}

.debt-ratio-critical .debt-ratio-fill {
  background-color: #e53e3e;
  animation: pulse 1.5s infinite;
}

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

.loan-options {
  margin-bottom: 1rem;
}

.loan-option {
  background-color: #2d3748;
  border-radius: 0.25rem;
  padding: 0.75rem;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.loan-option:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.loan-option-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.loan-amount {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0066b3; /* Capitec blue */
  margin-bottom: 0.25rem;
}

.loan-interest {
  font-size: 0.8rem;
  color: #fc8181;
  margin-bottom: 0.5rem;
}

.loan-take-btn {
  width: 100%;
}

/* Special Orders/Missions Styles */
.missions-container {
  margin-top: 1rem;
}

.mission-card {
  background-color: #2d3748;
  border-radius: 0.25rem;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  border-left: 3px solid #6b46c1;
}

.mission-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.mission-title {
  font-weight: 600;
  color: #6b46c1;
}

.mission-deadline {
  font-size: 0.8rem;
  color: #f6ad55;
}

.mission-details {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.mission-reward {
  font-weight: 600;
  color: #68d391;
}

.mission-progress {
  height: 6px;
  background-color: #4a5568;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.mission-progress-fill {
  height: 100%;
  background-color: #6b46c1;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.mission-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.log-entry-mission {
  background-color: rgba(107, 70, 193, 0.1);
  border-left: 3px solid #6b46c1;
}

/* Sound toggle styles */
#sound-toggle {
  accent-color: #0066b3; /* Capitec blue */
  width: 16px;
  height: 16px;
}

/* Capitec branding elements */
.capitec-logo-small {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 80px;
  height: auto;
  opacity: 0.7;
}

/* Add subtle animations to various interactions */
.btn-primary, .btn-secondary, .btn-info, .btn-danger, .btn-warning {
  position: relative;
  overflow: hidden;
}

.btn-primary::after, .btn-secondary::after, .btn-info::after, .btn-danger::after, .btn-warning::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.5);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1, 1) translate(-50%, -50%);
  transform-origin: 50% 50%;
}

.btn-primary:focus:not(:active)::after,
.btn-secondary:focus:not(:active)::after,
.btn-info:focus:not(:active)::after,
.btn-danger:focus:not(:active)::after,
.btn-warning:focus:not(:active)::after {
  animation: ripple 0.5s ease-out;
}

@keyframes ripple {
  0% {
    transform: scale(0, 0);
    opacity: 0.5;
  }
  100% {
    transform: scale(20, 20);
    opacity: 0;
  }
}
