/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Light Mode Colors */
  --primary: #0d7377;
  --primary-dark: #0a5c5f;
  --secondary: #e8956f;
  --background: #ffffff;
  --foreground: #0a0a0a;
  --muted: #f5f5f5;
  --muted-foreground: #737373;
  --border: #e5e5e5;
  --card: #ffffff;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
}

[data-theme="dark"] {
  /* Dark Mode Colors */
  --primary: #14b8a6;
  --primary-dark: #0d9488;
  --secondary: #fb923c;
  --background: #0a0a0a;
  --foreground: #fafafa;
  --muted: #262626;
  --muted-foreground: #a3a3a3;
  --border: #404040;
  --card: #171717;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--background);
  color: var(--foreground);
  line-height: 1.6;
  transition: background-color 0.3s, color 0.3s;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header - Redesigned to match image */
.header {
  background-color: var(--primary);
  color: white;
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  font-size: 2rem;
  background: rgba(255, 255, 255, 0.15);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.2;
}

.logo-subtitle {
  font-size: 0.75rem;
  opacity: 0.9;
}

.theme-toggle {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: 0.5rem;
  padding: 0.625rem;
  cursor: pointer;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* FOMO Banner - Redesigned */
.fomo-banner {
  background-color: var(--primary-dark);
  color: white;
  padding: 0.625rem 0;
  text-align: center;
}

.fomo-text {
  font-size: 0.875rem;
  font-weight: 500;
}

/* Main Content */
.main-content {
  padding: 3rem 0;
  min-height: calc(100vh - 200px);
}

.section {
  margin-bottom: 3rem;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--foreground);
}

.section-description {
  color: var(--muted-foreground);
  font-size: 1.125rem;
  line-height: 1.6;
}

.highlight {
  color: var(--primary);
  font-weight: 600;
}

/* Form - Redesigned with two-column layout */
.form {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 2.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2rem;
}

.form-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.column-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border);
}

.column-icon {
  font-size: 1.5rem;
}

.column-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--foreground);
  margin: 0;
}

.column-subtitle {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin: 0;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.input-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.currency-symbol {
  position: absolute;
  left: 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted-foreground);
  pointer-events: none;
}

.input-wrapper input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 3.5rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background-color: var(--background);
  color: var(--foreground);
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-wrapper input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13, 115, 119, 0.1);
}

.btn-add {
  background: none;
  border: 1px dashed var(--border);
  border-radius: 0.5rem;
  padding: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--primary);
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 0.5rem;
}

.btn-add:hover {
  border-color: var(--primary);
  background-color: rgba(13, 115, 119, 0.05);
}

.custom-field {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}

.custom-field input[type="text"] {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background-color: var(--background);
  color: var(--foreground);
  font-size: 1rem;
}

.custom-field .input-wrapper {
  flex: 1;
}

.btn-remove {
  background-color: var(--danger);
  color: white;
  border: none;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: opacity 0.2s;
  white-space: nowrap;
}

.btn-remove:hover {
  opacity: 0.9;
}

/* Currency Selector */
.currency-selector {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  background-color: var(--muted);
  border-radius: 0.75rem;
  margin-bottom: 1.5rem;
}

.currency-selector label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--foreground);
}

.currency-select {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background-color: var(--background);
  color: var(--foreground);
  font-size: 1rem;
  cursor: pointer;
  transition: border-color 0.2s;
}

.currency-select:focus {
  outline: none;
  border-color: var(--primary);
}

.btn-calculate {
  width: 100%;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 0.75rem;
  padding: 1.125rem;
  font-size: 1.125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(13, 115, 119, 0.3);
}

.btn-calculate:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(13, 115, 119, 0.4);
}

/* History Section */
.history-section {
  margin-top: 3rem;
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.5rem;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.history-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--foreground);
}

.btn-clear {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-clear:hover {
  opacity: 0.8;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background-color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
}

.history-item:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.history-item-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.history-item-date {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.history-item-amount {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--foreground);
}

.history-item-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-view {
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 0.375rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-view:hover {
  opacity: 0.9;
}

.btn-delete {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  padding: 0.5rem;
  transition: opacity 0.2s;
}

.btn-delete:hover {
  opacity: 0.8;
}

.history-empty {
  text-align: center;
  padding: 2rem;
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

/* Results Section - Redesigned */
.results-header {
  margin-bottom: 1.5rem;
}

.btn-back {
  background: none;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.625rem 1.25rem;
  cursor: pointer;
  color: var(--foreground);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-back:hover {
  background-color: var(--muted);
}

.results-title {
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.5rem;
  color: var(--foreground);
}

.results-subtitle {
  text-align: center;
  color: var(--muted-foreground);
  font-size: 1rem;
  margin-bottom: 2rem;
}

/* Net Worth Display - Redesigned */
.net-worth-display {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border-radius: 1rem;
  padding: 3rem 2rem;
  text-align: center;
  margin-bottom: 2rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.net-worth-label {
  font-size: 1rem;
  opacity: 0.95;
  margin-bottom: 0.75rem;
  font-weight: 500;
}

.net-worth-amount {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1;
}

.net-worth-details {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  font-size: 0.875rem;
  opacity: 0.9;
}

.divider {
  opacity: 0.5;
}

/* Wealth Badge Card */
.wealth-badge-card {
  background-color: rgba(13, 115, 119, 0.05);
  border: 2px solid var(--primary);
  border-radius: 1rem;
  padding: 1.5rem;
  text-align: center;
  margin-bottom: 2rem;
}

.badge-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.badge-icon-large {
  font-size: 3rem;
}

.badge-info {
  text-align: left;
}

.badge-status {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.badge-title-large {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: 0.25rem;
}

.badge-description {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.5rem;
}

.stat-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--foreground);
}

.stat-subtitle {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin-bottom: 1.5rem;
}

.chart-container {
  max-width: 300px;
  margin: 0 auto;
}

/* Progress Circle */
.progress-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.progress-circle {
  position: relative;
  width: 120px;
  height: 120px;
}

.progress-ring {
  transform: rotate(-90deg);
}

.progress-ring-circle-bg {
  fill: none;
  stroke: var(--muted);
  stroke-width: 8;
}

.progress-ring-circle {
  fill: none;
  stroke: var(--primary);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 326.73;
  stroke-dashoffset: 326.73;
  transition: stroke-dashoffset 1s ease-out;
}

.progress-percent {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.progress-message {
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  line-height: 1.5;
}

/* Comparison Card */
.comparison-card {
  background-color: rgba(34, 197, 94, 0.05);
  border: 2px solid var(--success);
  border-radius: 1rem;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.comparison-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.comparison-icon-large {
  font-size: 2.5rem;
}

.comparison-text-large {
  font-size: 1rem;
  color: var(--foreground);
  line-height: 1.6;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}

.btn-secondary {
  flex: 1;
  background-color: var(--card);
  color: var(--foreground);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background-color: var(--muted);
  border-color: var(--primary);
}

.btn-share-main {
  flex: 1;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 0.75rem;
  padding: 1rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(13, 115, 119, 0.3);
}

.btn-share-main:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(13, 115, 119, 0.4);
}

/* Challenge Banner */
.challenge-banner {
  background: linear-gradient(135deg, rgba(13, 115, 119, 0.1), rgba(232, 149, 111, 0.1));
  border: 2px solid var(--primary);
  border-radius: 1rem;
  padding: 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.challenge-icon {
  font-size: 3rem;
}

.challenge-content {
  flex: 1;
}

.challenge-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: 0.5rem;
}

.challenge-text {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  line-height: 1.6;
}

/* Modal - Redesigned */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.open {
  display: flex;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background-color: var(--card);
  border-radius: 1.5rem;
  padding: 2rem;
  max-width: 700px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.modal-header h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--foreground);
}

.btn-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted-foreground);
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.btn-close:hover {
  color: var(--foreground);
}

.modal-description {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin-bottom: 1.5rem;
}

/* Template Selector */
.template-selector {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.template-btn {
  background-color: var(--muted);
  border: 2px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.template-btn:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.template-btn.active {
  border-color: var(--primary);
  background-color: rgba(13, 115, 119, 0.1);
}

.template-preview {
  width: 100%;
  height: 60px;
  border-radius: 0.5rem;
}

.template-1-preview {
  background: linear-gradient(135deg, #0d7377, #14b8a6, #e8956f);
}

.template-2-preview {
  background: linear-gradient(135deg, #6b21a8, #9333ea, #d97706);
}

.template-3-preview {
  background: linear-gradient(180deg, #059669 0%, #10b981 40%, #ffffff 40%);
}

.template-4-preview {
  background: linear-gradient(135deg, #dc2626, #ef4444, #f97316, #fb923c);
}

.template-btn span {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--foreground);
}

/* Share Card Wrapper */
.share-card-wrapper {
  position: relative;
  width: 100%;
  height: 400px;
  margin-bottom: 1.5rem;
  border-radius: 1rem;
  overflow: hidden;
}

.share-card {
  display: none;
  width: 100%;
  height: 100%;
}

.share-card.active-card {
  display: block;
}

/* Share Actions */
.share-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.btn-download {
  width: 100%;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 0.75rem;
  padding: 1rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(13, 115, 119, 0.3);
}

.btn-download:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(13, 115, 119, 0.4);
}

.social-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.btn-social {
  background-color: var(--card);
  color: var(--foreground);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.875rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s;
}

.btn-social:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-whatsapp:hover {
  background-color: #25d366;
  color: white;
  border-color: #25d366;
}

.btn-twitter:hover {
  background-color: #000000;
  color: white;
  border-color: #000000;
}

.btn-facebook:hover {
  background-color: #1877f2;
  color: white;
  border-color: #1877f2;
}

.btn-linkedin:hover {
  background-color: #0a66c2;
  color: white;
  border-color: #0a66c2;
}

.btn-more {
  width: 100%;
  background: none;
  color: var(--foreground);
  border: 1px dashed var(--border);
  border-radius: 0.5rem;
  padding: 0.875rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s;
}

.btn-more:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Responsive */
@media (max-width: 768px) {
  .section-title {
    font-size: 1.75rem;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .action-buttons {
    flex-direction: column;
  }

  .template-selector {
    grid-template-columns: repeat(2, 1fr);
  }

  .social-buttons {
    grid-template-columns: 1fr;
  }

  .net-worth-amount {
    font-size: 2.5rem;
  }

  .challenge-banner {
    flex-direction: column;
    text-align: center;
  }
}
