/* DCA and Harvest Page Specific Styles */
/* Note: Common styles are now in styles-common.css */

/* Form Group Spacing */
.form-group {
  margin-bottom: 24px;
}

.form-group:last-child {
  margin-bottom: 0;
}

/* Results Section */
.results, #results {
  padding: 24px;
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  display: none;
  max-width: 950px;
  margin: 0 auto;
}

.result-section {
  margin-bottom: 24px;
  padding: 20px;
  background: var(--bg-light);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.result-section h4 {
  color: #2d3748;
  margin: 0 0 16px 0;
  font-size: 1.1em;
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

.harvest-details {
  margin-top: 24px;
  padding: 20px;
  background: var(--bg-white);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.harvest-details h4 {
  color: #2d3748;
  margin-bottom: 16px;
  font-size: 1.1em;
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

.harvest-note {
  margin-top: 16px;
  padding: 16px;
  background: #fff;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.harvest-note ul {
  margin: 0;
  padding-left: 20px;
}

.harvest-note li {
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 0.9em;
  line-height: 1.5;
}

.missed-harvest-value button {
  background: var(--warning-color);
  color: var(--bg-white);
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition-fast);
}

.missed-harvest-value button:hover {
  background: var(--warning-hover);
  transform: translateY(-1px);
}

.missed-harvest-summary {
  margin-bottom: 16px;
  padding: 12px;
  background: rgba(245, 158, 11, 0.1);
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--warning-color);
}

.missed-harvest-details {
  margin-top: 12px;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 20px;
}

.strategy-result h3 {
  color: #2d3748;
  margin-bottom: 16px;
  font-size: 1.2em;
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

.result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  transition: var(--transition-fast);
  width: 100%;
}

.result-item:hover {
  padding-left: 4px;
  background: rgba(102, 126, 234, 0.02);
  border-radius: 4px;
}

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

.result-item span:first-child {
  color: #718096;
  font-weight: 500;
  flex: 0 0 auto;
  text-align: left;
}

.result-item span:last-child {
  color: #2d3748;
  font-weight: 600;
  white-space: nowrap;
  text-align: right;
  flex: 0 0 auto;
  margin-left: auto;
}

/* Chart Container */
.chart-container {
  background-color: var(--bg-white);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  margin: 16px 0px;
  display: block;
  height: 500px;
  min-height: 400px;
  max-height: 700px;
  transition: height 0.3s ease;
}

/* Tables */
.investment-table-container, .harvest-table-container {
  overflow-x: auto;
  margin: 16px 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.investment-table, .harvest-history-table, .harvest-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-white);
  border: none;
}

.investment-table th, .harvest-history-table th, .harvest-table th {
  background: var(--bg-light);
  color: var(--text-primary);
  font-weight: 600;
  padding: 12px 8px;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.85em;
  white-space: nowrap;
}

.investment-table td, .harvest-history-table td, .harvest-table td {
  padding: 8px 6px;
  text-align: center;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.85em;
}

.investment-table tbody tr:hover, .harvest-history-table tbody tr:hover, .harvest-table tbody tr:hover {
  background-color: var(--bg-light);
  transition: background-color 0.2s ease;
}

/* Asset Selection */
.asset-selection {
  margin-bottom: 20px;
  padding: 16px;
  background: var(--bg-light);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.asset-buttons, .period-buttons {
  display: flex;
  flex-direction: row;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  margin-top: 16px;
  padding: 4px;
}

.asset-btn, .period-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-fast);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  width: 160px;
  min-height: 36px;
  flex-shrink: 0;
  white-space: nowrap;
}

.asset-btn:hover, .period-btn:hover {
  border-color: var(--success-color);
  background: #f8fff8;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.15);
}

.asset-btn.active, .period-btn.active {
  border-color: var(--success-color);
  background: var(--success-color);
  color: var(--bg-white);
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.asset-btn.active:hover, .period-btn.active:hover {
  background: var(--success-hover);
  transform: translateY(-1px);
}

/* Utility Classes */
.hidden {
  display: none !important;
}

/* Additional specific styles for complex components */

/* Chart controls */
.chart-controls {
  padding: 12px;
  background-color: var(--bg-light);
  align-items: center;
}

.chart-toggle {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.toggle-item {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #495057;
  transition: color 0.2s ease;
}

.toggle-item:hover {
  color: var(--primary-color);
}

.toggle-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--primary-color);
  align-items: center;
  margin-top: 0;
}

.toggle-label {
  user-select: none;
}

/* Dual chart container */
.dual-chart-container {
  display: block;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 16px 0px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.dual-chart-container .chart-container {
  margin: 0;
}

/* Chart legend */
.chart-legend {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85em;
  color: var(--text-secondary);
}

.legend-color {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  display: inline-block;
}

/* Sell dates container */
.sell-dates-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: right;
}

.sell-dates-container .date-row {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}

.sell-dates-container .date-item {
  white-space: nowrap;
  color: #2d3748 !important;
  font-weight: 600 !important;
  font-size: inherit !important;
}

.sell-dates-container * {
  color: #2d3748 !important;
  font-weight: 600 !important;
  font-size: inherit !important;
}

/* Asset comparison section */
.asset-comparison-section {
  background: var(--bg-white);
  padding: 24px;
  margin: 20px 0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.asset-comparison-section h3 {
  color: #2d3748;
  margin-bottom: 20px;
  font-size: 1.4em;
  font-weight: 600;
  text-align: center;
}

.comparison-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.comparison-item {
  background: var(--bg-light);
  border-radius: var(--radius-md);
  padding: 16px;
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.comparison-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.comparison-item.crypto { border-left: 4px solid #f7931a; }
.comparison-item.nasdaq { border-left: 4px solid #0066cc; }
.comparison-item.gold { border-left: 4px solid #ffd700; }
.comparison-item.ethereum { border-left: 4px solid #627eea; }

.comparison-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.comparison-name {
  font-weight: 600;
  font-size: 1.1em;
  color: #2d3748;
}

.comparison-return {
  font-weight: 700;
  font-size: 1.2em;
  padding: 4px 8px;
  border-radius: 4px;
}

.comparison-return.positive {
  color: #38a169;
  background: #f0fff4;
}

.comparison-return.negative {
  color: #e53e3e;
  background: #fff5f5;
}

.comparison-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.9em;
  color: var(--text-secondary);
}

.comparison-details span {
  display: flex;
  justify-content: space-between;
}

/* Main page styles */
.main-content {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px 0 0 0;
}

.welcome-section {
  text-align: center;
  margin-bottom: 40px;
  padding: 40px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: var(--radius-lg);
  color: var(--bg-white);
}

.welcome-section h2 {
  font-size: 2.5em;
  margin-bottom: 16px;
  font-weight: 700;
}

.welcome-section p {
  font-size: 1.2em;
  opacity: 0.9;
  margin: 0;
}

.strategy-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 40px auto;
  max-width: 1400px;
  width: 100%;
  box-sizing: border-box;
  align-items: stretch;
}

.strategy-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  border: 1px solid var(--border-color);
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card-header {
  padding: 24px 24px 16px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
}

.card-header h3 {
  margin: 0;
  font-size: 1.5em;
  color: var(--text-primary);
  font-weight: 600;
}

.card-badge {
  background-color: rgba(102, 126, 234, 0.1);
  color: var(--primary-color);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.8em;
  font-weight: 500;
}

.card-content {
  padding: 20px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-content p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
}

.card-content ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.card-content li {
  padding: 8px 0;
  color: var(--text-secondary);
  position: relative;
  padding-left: 20px;
}

.card-content li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--success-color);
  font-weight: bold;
}

.card-footer {
  padding: 16px 16px 24px 24px;
  border-top: 1px solid var(--border-light);
  margin-top: auto;
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}

.strategy-btn {
  display: inline-block;
  background: var(--success-color);
  color: var(--bg-white);
  padding: 12px 24px;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
  text-align: center;
  width: 100%;
  box-sizing: border-box;
}

.strategy-btn:hover {
  background: var(--success-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

/* Features section */
.features-section {
  margin-top: 60px;
}

.features-section h3 {
  text-align: center;
  font-size: 2em;
  margin-bottom: 40px;
  color: var(--text-primary);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
}

.feature-item {
  text-align: center;
  padding: 24px;
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.feature-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.feature-icon {
  font-size: 3em;
  margin-bottom: 16px;
}

.feature-item h4 {
  margin: 0 0 12px 0;
  color: var(--text-primary);
  font-size: 1.2em;
  font-weight: 600;
}

.feature-item p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Growth rate options */
.growth-rate-options {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.radio-option {
  flex: 1;
  cursor: pointer;
  position: relative;
}

.radio-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.radio-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-white);
  transition: var(--transition);
  text-align: center;
}

.radio-option input[type="radio"]:checked + .radio-label {
  border-color: var(--success-color);
  background: #f0f9f0;
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.2);
}

.radio-option:hover .radio-label {
  border-color: var(--success-color);
  transform: translateY(-1px);
}

.option-name {
  font-weight: 600;
  color: #4a5568;
  margin-bottom: 4px;
  font-size: 14px;
}

.option-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--success-color);
}

.radio-option input[type="radio"]:checked + .radio-label .option-value {
  color: #2e7d32;
}

/* Section styles */
.age-settings-section,
.investment-settings-section,
.growth-rate-settings-section,
.expense-settings-section,
.withdrawal-age-settings-section {
  margin-bottom: 20px;
  padding: 16px;
  background: var(--bg-light);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.age-settings-section > h3,
.expense-settings-section > h3,
.withdrawal-age-settings-section > h3 {
  display: block;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 12px 0;
}

.withdrawal-age-settings-section > h3 {
  font-size: 16px;
}

.age-settings {
  display: flex;
  gap: 16px;
}

.age-settings .form-group {
  flex: 1;
  margin-bottom: 0;
}

.growth-rate-settings {
  margin-bottom: 0;
}

/* Chart tooltip */
.chartjs-tooltip {
  background: rgba(0, 0, 0, 0.8) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: var(--radius-md) !important;
  color: var(--bg-white) !important;
  font-size: 12px !important;
  padding: 8px 12px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

.chartjs-tooltip .chartjs-tooltip-title {
  color: var(--bg-white) !important;
  font-weight: bold !important;
  margin-bottom: 4px !important;
}

.chartjs-tooltip .chartjs-tooltip-body {
  color: var(--bg-white) !important;
}

/* Harvest table specific column widths*/
.harvest-table th:nth-child(1),
.harvest-table td:nth-child(1) {
  min-width: 30px;
}

.harvest-table th:nth-child(2),
.harvest-table td:nth-child(2) {
  min-width: 50px;
  white-space: nowrap;
}

.harvest-table th:nth-child(3),
.harvest-table td:nth-child(3) {
  min-width: 50px;
  white-space: nowrap;
}

.harvest-table th:nth-child(4),
.harvest-table td:nth-child(4) {
  min-width: 50px;
  white-space: nowrap;
}

.harvest-table th:nth-child(5),
.harvest-table td:nth-child(5) {
  min-width: 50px;
  white-space: nowrap;
}

.harvest-table th:nth-child(6),
.harvest-table td:nth-child(6) {
  min-width: 50px;
  white-space: nowrap;
}

.harvest-table th:nth-child(7),
.harvest-table td:nth-child(7) {
  min-width: 50px;
  white-space: nowrap;
}

.harvest-table th:nth-child(8),
.harvest-table td:nth-child(8) {
  min-width: 50px;
  white-space: nowrap;
}

.harvest-table th:nth-child(9),
.harvest-table td:nth-child(9) {
  min-width: 50px;
  white-space: nowrap;
}

.harvest-table th:nth-child(10),
.harvest-table td:nth-child(10) {
  min-width: 120px;
  white-space: nowrap;
}

.harvest-table th:nth-child(11),
.harvest-table td:nth-child(11) {
  min-width: 15px;
  white-space: nowrap;
}

/* Profit/Loss styles */
.profit { color: #28a745; font-weight: 600; }
.loss { color: #dc3545; font-weight: 600; }

/* ===========================================
   RESPONSIVE DESIGN - SIMPLIFIED
   =========================================== */

/* Tablet and smaller */
@media (max-width: 768px) {
  /* Logo responsive sizing */
  :root {
    --logo-height: 28px;
    --logo-width: 105px;
  }
  
  .quick-date-buttons {
    gap: 6px;
  }
  
  .quick-date-btn, .market-btn {
    width: 100px;
    padding: 6px 10px;
    font-size: 13px;
    min-height: 32px;
  }
  
  .asset-buttons, .period-buttons {
    gap: 8px;
  }
  
  .asset-btn, .period-btn {
    width: 140px;
    padding: 8px 12px;
    font-size: 13px;
  }
  
  .strategy-cards {
    grid-template-columns: 1fr;
    margin: 30px auto;
  }
  
  .welcome-section {
    padding: 30px 16px;
  }
  
  .welcome-section h2 {
    font-size: 2em;
  }
  
  .welcome-section p {
    font-size: 1.1em;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .feature-item {
    padding: 20px;
  }
  
  .growth-rate-options {
    flex-direction: column;
    gap: 8px;
  }
  
  .radio-label {
    padding: 12px 8px;
  }
  
  .option-name {
    font-size: 13px;
  }
  
  .option-value {
    font-size: 16px;
  }
  
  .age-settings {
    flex-direction: column;
    gap: 12px;
  }
  
  .chart-container {
    height: 450px;
  }
  
  .dual-chart-container {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* Mobile */
@media (max-width: 480px) {
  /* Logo responsive sizing for mobile */
  :root {
    --logo-height: 24px;
    --logo-width: 90px;
  }
  
  .header-section {
    margin-bottom: 24px;
    padding: 16px;
    border-radius: var(--radius-md);
  }
  
  .header-top {
    flex-direction: row;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
  }
  
  .menu-container {
    display: flex;
    align-items: center;
    gap: 4px;
    position: relative;
  }
  
  .menu-dropdown {
    position: fixed;
    top: 70px;
    left: 16px;
    right: 16px;
    width: auto;
    max-width: none;
    border-radius: var(--radius-lg);
    margin-top: 0;
  }
  
  .hamburger-menu {
    width: 21px;
    height: 21px;
    padding: 8px;
  }

  .hamburger-check:checked ~ .hamburger-line:nth-child(2) {
    transform: translate(0, 7px) rotate(45deg);
  }
  
  .hamburger-check:checked ~ .hamburger-line:nth-child(3) {
    transform: scale(0);
    opacity: 0;
  }
  
  .hamburger-check:checked ~ .hamburger-line:nth-child(4) {
    transform: translate(0, -7px) rotate(-45deg);
  }
  
  .logo {
    height: 28px;
  }
  
  .bitsaving-btn {
    font-size: 12px;
    padding: 8px 14px;
  }
  
  h1 {
    font-size: 1.8em;
    margin-top: 24px;
    margin-bottom: 20px;
  }
  
  .settings-section {
    padding: 16px;
    border-radius: var(--radius-md);
  }
  
  .strategy-section {
    padding: 16px;
    border-radius: var(--radius-sm);
  }
  
  .chart-container {
    height: 350px;
  }
  
  .investment-table th,
  .investment-table td,
  .harvest-history-table th,
  .harvest-history-table td,
  .harvest-table th,
  .harvest-table td {
    padding: 6px 4px;
    font-size: 0.75em;
  }
  .investment-table th:nth-child(1),
  .investment-table td:nth-child(3),
  .investment-table td:nth-child(7) {
    white-space: nowrap;
    min-width: 100px;
  }
  
  .quick-date-buttons {
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  
  .quick-date-buttons::-webkit-scrollbar {
    display: none;
  }
  
  .quick-date-btn, .market-btn {
    width: 80px;
    flex-shrink: 0;
    padding: 8px 10px;
    font-size: 12px;
  }
  
  .asset-buttons, .period-buttons {
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  
  .asset-buttons::-webkit-scrollbar,
  .period-buttons::-webkit-scrollbar {
    display: none;
  }
  
  .asset-btn, .period-btn {
    width: 120px;
    flex-shrink: 0;
    padding: 8px 12px;
    font-size: 12px;
  }
}
