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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 900px;
  margin: 0 auto;
}

.header {
  text-align: center;
  color: white;
  margin-bottom: 30px;
}

.header h1 {
  font-size: 2.5rem;
  margin-bottom: 8px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.header p {
  opacity: 0.95;
  font-size: 1.1rem;
}

/* Wizard Styles */
.wizard-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.wizard-modal {
  background: white;
  border-radius: 16px;
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.wizard-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 24px;
  border-radius: 16px 16px 0 0;
}

.wizard-header h2 {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.wizard-progress {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.wizard-progress-dot {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  transition: background 0.3s;
}

.wizard-progress-dot.active {
  background: white;
}

.wizard-content {
  padding: 32px;
}

.wizard-step {
  display: none;
}

.wizard-step.active {
  display: block;
  animation: fadeIn 0.3s;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.wizard-step h3 {
  color: #333;
  font-size: 1.4rem;
  margin-bottom: 16px;
}

.wizard-step p {
  color: #666;
  line-height: 1.6;
  margin-bottom: 20px;
}

.wizard-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.wizard-option {
  padding: 16px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.wizard-option:hover {
  border-color: #667eea;
  background: #f7fafc;
}

.wizard-option.selected {
  border-color: #667eea;
  background: #eef2ff;
}

.wizard-option-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.wizard-option-title {
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
}

.wizard-option-desc {
  font-size: 0.85rem;
  color: #666;
}

.wizard-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
}

.wizard-tip {
  background: #fffbeb;
  border-left: 4px solid #f59e0b;
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.wizard-tip strong {
  color: #b45309;
}

.info-panel {
  background: rgba(255, 255, 255, 0.95);
  border-left: 4px solid #667eea;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.info-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
}

.info-content {
  font-size: 0.9rem;
  color: #333;
  line-height: 1.6;
}

.info-content strong {
  color: #667eea;
}

.info-content ul {
  margin: 12px 0 0 20px;
}

.info-content li {
  margin-bottom: 8px;
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  line-height: 20px;
}

.close-btn:hover {
  color: #666;
}

.actions {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  align-items: center;
}

.view-toggle {
  margin-left: auto;
  display: flex;
  gap: 4px;
  background: white;
  padding: 4px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.view-toggle button {
  padding: 6px 12px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
  color: #666;
}

.view-toggle button.active {
  background: #667eea;
  color: white;
}

.view-toggle button:hover:not(.active) {
  background: #f7f7f7;
}

.btn {
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-primary {
  background: #667eea;
  color: white;
}

.btn-primary:hover {
  background: #5568d3;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-primary:disabled {
  background: #cbd5e0;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: white;
  color: #667eea;
}

.btn-secondary:hover {
  background: #f7f7f7;
}

.btn-danger {
  background: #fee;
  color: #c53030;
}

.btn-danger:hover {
  background: #fdd;
}

.empty-state {
  background: white;
  border-radius: 12px;
  padding: 60px 20px;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 15px;
  opacity: 0.3;
}

.buckets-container {
  position: relative;
}

.bucket {
  background: white;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s;
  cursor: move;
}

.bucket:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.bucket.dragging {
  opacity: 0.5;
}

.bucket-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.bucket-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.2rem;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.2s;
  position: relative;
}

.bucket-number:hover {
  transform: scale(1.1);
}

.bucket-type-selector {
  position: absolute;
  top: 50px;
  left: 0;
  background: white;
  border: 2px solid #667eea;
  border-radius: 8px;
  padding: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 100;
  display: none;
  min-width: 200px;
}

.bucket-type-selector.active {
  display: block;
}

.bucket-type-option {
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s;
}

.bucket-type-option:hover {
  background: #f7fafc;
}

.bucket-type-option.selected {
  background: #eef2ff;
}

.bucket-inputs {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 8px;
  flex: 1;
}

.input-group {
  position: relative;
}

.input-with-tooltip {
  position: relative;
  display: flex;
  align-items: center;
}

.tooltip-icon {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #667eea;
  color: white;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: help;
  font-weight: bold;
}

.tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 8px;
  background: #333;
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  white-space: nowrap;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #333;
}

.tooltip-icon:hover + .tooltip {
  opacity: 1;
}

input,
textarea {
  width: 100%;
  padding: 8px 10px;
  border: 2px solid #e2e8f0;
  border-radius: 6px;
  font-size: 0.9rem;
  transition: border-color 0.2s;
  font-family: inherit;
}

textarea {
  resize: vertical;
  min-height: 60px;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: #667eea;
}

.description-field {
  margin-top: 8px;
  grid-column: 1 / -1;
}

.delete-btn {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s;
}

.delete-btn:hover {
  color: #e53e3e;
}

.progress-section {
  margin-top: 10px;
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #666;
  margin-bottom: 4px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #48bb78, #38a169);
  border-radius: 10px;
  transition: width 0.5s ease;
  position: relative;
  overflow: hidden;
}

.progress-fill.debt {
  background: linear-gradient(90deg, #f56565, #e53e3e);
}

.progress-fill::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.action-badge {
  background: #f0fdf4;
  border: 1px solid #86efac;
  color: #166534;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  margin-top: 8px;
  font-weight: 500;
}

.action-badge::before {
  content: "💧 ";
}

.flow-arrow {
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.5rem;
  margin: -6px 0;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

.summary {
  background: white;
  border-radius: 12px;
  padding: 20px;
  margin-top: 30px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.summary h3 {
  color: #333;
  margin-bottom: 15px;
  font-size: 1.2rem;
}

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

.summary-item {
  padding: 15px;
  background: linear-gradient(135deg, #667eea15, #764ba215);
  border-radius: 8px;
  border-left: 4px solid #667eea;
}

.summary-label {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 4px;
}

.summary-value {
  font-size: 1.5rem;
  font-weight: bold;
  color: #333;
}

/* Visual Summary Styles */
.visual-summary {
  background: white;
  border-radius: 12px;
  padding: 24px;
  margin-top: 30px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.waterfall-viz {
  margin-top: 20px;
}

.waterfall-bucket {
  margin-bottom: 20px;
  padding: 16px;
  background: #f7fafc;
  border-radius: 8px;
  border-left: 4px solid #667eea;
}

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

.waterfall-name {
  font-weight: 600;
  color: #333;
  display: flex;
  align-items: center;
  gap: 8px;
}

.waterfall-amount {
  font-size: 1.1rem;
  font-weight: bold;
  color: #667eea;
}

.waterfall-bar-container {
  position: relative;
  height: 40px;
  background: #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
}

.waterfall-bar {
  height: 100%;
  background: linear-gradient(90deg, #48bb78, #38a169);
  display: flex;
  align-items: center;
  padding: 0 12px;
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  transition: width 0.5s ease;
  position: relative;
}

.waterfall-bar.debt {
  background: linear-gradient(90deg, #f56565, #e53e3e);
}

.waterfall-bar.incomplete {
  background: linear-gradient(90deg, #667eea, #764ba2);
}

.waterfall-bar::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  animation: shimmer 2s infinite;
}

.waterfall-flow-arrow {
  text-align: center;
  color: #667eea;
  font-size: 1.8rem;
  margin: 8px 0;
  animation: bounceDown 2s infinite;
}

@keyframes bounceDown {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.6;
  }
  50% {
    transform: translateY(8px);
    opacity: 1;
  }
}

.completion-ring {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 20px 0;
}

.ring-container {
  position: relative;
  width: 150px;
  height: 150px;
}

.ring-background {
  fill: none;
  stroke: #e2e8f0;
  stroke-width: 12;
}

.ring-progress {
  fill: none;
  stroke: url(#gradient);
  stroke-width: 12;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  transition: stroke-dashoffset 1s ease;
}

.ring-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.ring-percentage {
  font-size: 2rem;
  font-weight: bold;
  color: #333;
}

.ring-label {
  font-size: 0.8rem;
  color: #666;
}

.category-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.category-card {
  padding: 12px;
  background: #f7fafc;
  border-radius: 8px;
  text-align: center;
  border: 2px solid #e2e8f0;
}

.category-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.category-label {
  font-size: 0.8rem;
  color: #666;
  margin-bottom: 4px;
}

.category-value {
  font-size: 1.2rem;
  font-weight: bold;
  color: #333;
}

.export-dropdown {
  position: relative;
  display: inline-block;
}

.export-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  background: white;
  border: 2px solid #667eea;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 100;
  min-width: 180px;
}

.export-menu.active {
  display: block;
}

.export-option {
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.export-option:first-child {
  border-radius: 6px 6px 0 0;
}

.export-option:last-child {
  border-radius: 0 0 6px 6px;
}

.export-option:hover {
  background: #f7fafc;
}

.footer {
  text-align: center;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.85rem;
  margin-top: 30px;
}
.footer a {
  color: rgba(255, 255, 255, 0.9);
}
.drag-handle {
  color: #ccc;
  cursor: move;
  font-size: 1.2rem;
}

@media (max-width: 768px) {
  .bucket-inputs {
    grid-template-columns: 1fr;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .wizard-content {
    padding: 20px;
  }
}
