/* Clean Calculator Styling */

/* Calculator Section */
.calculator {
  padding: 2rem 0;
  background-color: #f8f9fa;
  min-height: calc(100vh - 200px);
}

.calculator .container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Header */
.calculator-header {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e9ecef;
}

.calculator-header h1 {
  color: #005ea5;
  font-size: 2rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.calculator-header p {
  color: #6c757d;
  font-size: 1rem;
  margin: 0;
}

/* Form */
.calculator-form {
  margin-bottom: 2rem;
}

/* Form Sections */
.form-section {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #dee2e6;
}

.form-section h2 {
  color: #005ea5;
  font-size: 1.25rem;
  margin-bottom: 1rem;
  font-weight: 600;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #005ea5;
}

/* Form Grid */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Form Groups */
.form-group {
  margin-bottom: 1rem;
}

label {
  display: block;
  color: #495057;
  font-weight: 500;
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
}

/* Inputs and Selects */
input, select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 0.95rem;
  background: white;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

input:focus, select:focus {
  outline: 0;
  border-color: #005ea5;
  box-shadow: 0 0 0 0.2rem rgba(0, 94, 165, 0.25);
}

input::placeholder {
  color: #6c757d;
}

/* Custom Dropdown */
.custom-dropdown {
  position: relative;
}

.custom-dropdown-toggle {
  width: 100%;
  padding: 0.75rem;
  background: white;
  border: 1px solid #ced4da;
  border-radius: 4px;
  color: #495057;
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.custom-dropdown-toggle:focus {
  outline: 0;
  border-color: #005ea5;
  box-shadow: 0 0 0 0.2rem rgba(0, 94, 165, 0.25);
}

.dropdown-arrow {
  color: #6c757d;
  font-size: 0.8rem;
}

.custom-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #ced4da;
  border-radius: 4px;
  max-height: 250px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  display: none;
}

.custom-dropdown-menu.show {
  display: block;
}

.custom-dropdown-search {
  padding: 0.5rem;
  border-bottom: 1px solid #dee2e6;
  background: #f8f9fa;
}

.custom-dropdown-search input {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ced4da;
  border-radius: 3px;
  font-size: 0.9rem;
}

.custom-dropdown-search input:focus {
  outline: 0;
  border-color: #005ea5;
}

.custom-dropdown-item {
  padding: 0.75rem 1rem;
  color: #495057;
  cursor: pointer;
  border-bottom: 1px solid #f8f9fa;
  transition: background-color 0.15s ease-in-out;
}

.custom-dropdown-item:hover,
.custom-dropdown-item.selected {
  background: #e9ecef;
}

.custom-dropdown-item:last-child {
  border-bottom: none;
}

/* Status Text */
small {
  display: block;
  color: #6c757d;
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

/* Form Actions */
.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  padding-top: 1rem;
  border-top: 1px solid #dee2e6;
}

.button {
  padding: 0.75rem 2rem;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  text-decoration: none;
  display: inline-block;
}

.button.secondary {
  background: #6c757d;
  color: white;
}

.button.secondary:hover {
  background: #5a6268;
  transform: translateY(-1px);
}

.button.primary {
  background: #005ea5;
  color: white;
}

.button.primary:hover {
  background: #004c8c;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 94, 165, 0.3);
}

/* Results Section */
.results-section {
  margin-top: 2rem;
  padding: 2rem;
  background: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #dee2e6;
}

.results-section h2 {
  color: #005ea5;
  font-size: 1.5rem;
  margin-bottom: 1rem;
  text-align: center;
}

.results-content {
  background: white;
  padding: 1.5rem;
  border-radius: 4px;
  border: 1px solid #dee2e6;
  margin-bottom: 1rem;
}

.results-content p {
  margin: 0.5rem 0;
  color: #495057;
}

.results-content strong {
  color: #005ea5;
}

/* Disclaimer */
.disclaimer {
  text-align: center;
  padding: 1rem;
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 4px;
  color: #856404;
}

.disclaimer p {
  margin: 0;
  font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .calculator .container {
    margin: 0 1rem;
    padding: 1.5rem;
  }

  .calculator-header h1 {
    font-size: 1.5rem;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .form-section {
    padding: 1rem;
  }

  .form-actions {
    flex-direction: column;
  }

  .button {
    width: 100%;
    margin-bottom: 0.5rem;
  }

  .results-section {
    margin: 1rem -1rem 0;
    border-radius: 0;
  }
}





/* Explainer Section */
.explainer {
  margin: 3rem 0;
  padding: 0;
}

.explainer-content {
  max-width: none;
}

.explainer h2 {
  color: #005ea5;
  font-size: 1.75rem;
  margin-bottom: 1rem;
  font-weight: 600;
  border-bottom: 3px solid #005ea5;
  padding-bottom: 0.5rem;
}

.explainer h3 {
  color: #005ea5;
  font-size: 1.25rem;
  margin: 2rem 0 1rem 0;
  font-weight: 600;
}

.explainer p {
  color: #495057;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  font-size: 1rem;
}

.explainer ul {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.explainer li {
  color: #495057;
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.explainer li strong {
  color: #005ea5;
  font-weight: 600;
}

/* Info Grid */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.info-card {
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 1.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.info-card:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.info-card h3 {
  color: #005ea5;
  font-size: 1.1rem;
  margin-bottom: 1rem;
  font-weight: 600;
  border-bottom: 2px solid #e9ecef;
  padding-bottom: 0.5rem;
}

.info-card p {
  color: #495057;
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.info-card ul {
  margin: 1rem 0 0 0;
  padding-left: 1.25rem;
}

.info-card li {
  color: #6c757d;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.info-card li:last-child {
  margin-bottom: 0;
}

/* Callout Box */
.callout-box {
  background: #f8f9fa;
  border: 2px solid #005ea5;
  border-radius: 6px;
  padding: 1.5rem;
  margin: 2rem 0;
}

.callout-box h3 {
  color: #005ea5;
  font-size: 1.2rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

/* Checklist */
.checklist {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.checklist-item {
  color: #495057;
  font-size: 0.95rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  align-items: center;
}

.checklist-item:last-child {
  border-bottom: none;
}

/* US Tax Info */
.us-tax-info {
  background: #f8f9fa;
  border-left: 4px solid #6c757d;
  padding: 1.5rem;
  margin: 2rem 0;
}

.us-tax-info h3 {
  color: #495057;
  font-size: 1.1rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.us-tax-info p {
  color: #6c757d;
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.us-tax-info ul {
  margin: 1rem 0;
  padding-left: 1.25rem;
}

.us-tax-info li {
  color: #6c757d;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

/* Disclaimer Highlight */
.disclaimer-highlight {
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 4px;
  padding: 1rem;
  margin: 1rem 0;
  color: #856404;
  font-size: 0.9rem;
  line-height: 1.4;
}

/* Important Callout */
.important-callout {
  background: #f8d7da;
  border: 2px solid #dc3545;
  border-radius: 6px;
  padding: 1.5rem;
  margin: 2rem 0;
}

.callout-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.callout-icon {
  font-size: 1.5rem;
}

.callout-header h3 {
  color: #721c24;
  font-size: 1.2rem;
  margin: 0;
  font-weight: 600;
}

.important-callout p {
  color: #721c24;
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0.5rem 0;
}

.important-callout strong {
  font-weight: 600;
}

/* Responsive Design for Explainer */
@media (max-width: 768px) {
  .explainer {
    margin: 2rem 0;
  }

  .explainer h2 {
    font-size: 1.5rem;
  }

  .info-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .info-card {
    padding: 1.25rem;
  }

  .callout-box {
    padding: 1.25rem;
  }

  .us-tax-info {
    padding: 1.25rem;
  }

  .important-callout {
    padding: 1.25rem;
  }
}

/* Help Buttons */
.help-btn {
  background: none;
  border: none;
  color: #005ea5;
  font-size: 0.9rem;
  font-weight: bold;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  margin-left: 0.5rem;
  border-radius: 50%;
  width: 1.5rem;
  height: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  vertical-align: middle;
}

.help-btn:hover {
  background: #005ea5;
  color: white;
  transform: scale(1.1);
}

.help-btn:focus {
  outline: 2px solid #005ea5;
  outline-offset: 2px;
}

/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}

.modal-content {
  background: white;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  max-width: 450px;
  width: 85%;
  max-height: 60vh;
  overflow-y: auto;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10001;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #dee2e6;
  background: #f8f9fa;
  border-radius: 8px 8px 0 0;
}

.modal-title {
  margin: 0;
  color: #005ea5;
  font-size: 1.25rem;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #6c757d;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: #dee2e6;
  color: #495057;
}

.modal-body {
  padding: 1rem 1.5rem;
  color: #495057;
  line-height: 1.6;
}

.modal-body p {
  margin-bottom: 1rem;
}

.modal-body ul {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.modal-body li {
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.modal-body strong {
  color: #005ea5;
  font-weight: 600;
}

.modal-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid #dee2e6;
  background: #f8f9fa;
  border-radius: 0 0 8px 8px;
  display: flex;
  justify-content: flex-end;
}

/* Results Modal Specific Styles */
.results-modal-content {
  max-width: 500px;
  width: 80%;
  max-height: 70vh;
}

.results-summary {
  margin-bottom: 1.5rem;
}

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f8f9fa;
}

.result-row:last-child {
  border-bottom: none;
}

.result-label {
  font-weight: 500;
  color: #495057;
  flex: 1;
}

.result-value {
  font-weight: 600;
  color: #005ea5;
  text-align: right;
  flex: 1;
}

.results-divider {
  border: none;
  border-top: 2px solid #005ea5;
  margin: 1.5rem 0;
}

.tax-breakdown h3 {
  color: #005ea5;
  font-size: 1.25rem;
  margin-bottom: 1rem;
  text-align: center;
  font-weight: 600;
}

.result-row.highlight {
  background: #e9ecef;
  padding: 0.75rem;
  border-radius: 4px;
  margin: 0.5rem 0;
}

.result-row.highlight .result-label,
.result-row.highlight .result-value {
  font-size: 1.1rem;
  font-weight: 700;
}

.result-row.final {
  background: #d4edda;
  border: 2px solid #28a745;
  padding: 1rem;
  border-radius: 6px;
  margin-top: 1rem;
}

.result-row.final .result-label,
.result-row.final .result-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: #155724;
}

.disclaimer-modal {
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 4px;
  padding: 1rem;
  margin-top: 1.5rem;
  text-align: center;
}

.disclaimer-modal p {
  margin: 0;
  color: #856404;
  font-size: 0.9rem;
}

/* Responsive Results Modal */
@media (max-width: 768px) {
  .results-modal-content {
    width: 95%;
    max-height: 95vh;
  }

  .result-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .result-value {
    text-align: left;
  }

  .result-row.final .result-label,
  .result-row.final .result-value {
    font-size: 1rem;
  }
}

/* Responsive Modal */
@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    max-height: 90vh;
    margin: 1rem;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 1rem;
  }

  .modal-title {
    font-size: 1.1rem;
  }
}

/* Mobile Header Alignment */
@media (max-width: 768px) {
  .header .container {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }

  .header .nav ul {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }

  .header .nav li {
    margin: 0;
  }

  .header .nav a {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  .button, input, select, .custom-dropdown-item, .info-card, .help-btn, .modal-close {
    transition: none;
  }

  .button:hover, .info-card:hover, .help-btn:hover, .modal-close:hover {
    transform: none;
  }
}
