/**
 * Commissie Calculator Styles - Modern Redesign
 * 
 * @package BuddyBoss_Theme_Child
 * @subpackage React_Commissie_Calculator
 * @since 2.0.0
 */

:root {
  --cc-primary: #fac500;
  --cc-primary-dark: #e5b500;
  --cc-text: #222222;
  --cc-text-muted: #6b7177;
  --cc-bg: #f4f5f7;
  --cc-card-bg: #ffffff;
  --cc-border: #e9e9e9;
  --cc-radius: 12px;
  --cc-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  --cc-font: "DM Sans", sans-serif;
}

/* Main Wrapper */
.commissie-calculator-wrapper {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  font-family: var(--cc-font);
  color: var(--cc-text);
  line-height: 1.6;
  box-sizing: border-box;
}

.commissie-calculator-wrapper * {
  box-sizing: border-box;
}

/* Intro Section */
.calculator-intro-section {
  background: var(--cc-card-bg);
  padding: 40px;
  margin-bottom: 40px;
  border-radius: var(--cc-radius);
  box-shadow: var(--cc-shadow);
}

.intro-title {
  font-size: 32px;
  font-weight: 700;
  margin: 0 0 30px 0;
  color: var(--cc-text);
  text-align: left;
}

.intro-text {
  font-size: 16px;
  line-height: 1.7;
  color: var(--cc-text);
  margin: 0 0 20px 0;
}

.intro-text strong {
  font-weight: 600;
}

.affiliate-link {
  color: var(--cc-primary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.affiliate-link:hover {
  color: var(--cc-primary-dark);
  text-decoration: underline;
}

/* Membership Info Table */
.membership-info-table {
  width: 100%;
  border-collapse: collapse;
  margin: 30px 0;
  font-size: 15px;
  background: #fff;
  border: 1px solid var(--cc-border);
  border-radius: 8px;
  overflow: hidden;
}

.membership-info-table thead {
  background: #f9fafb;
}

.membership-info-table th {
  padding: 15px;
  text-align: left;
  font-weight: 600;
  color: var(--cc-text);
  border-bottom: 2px solid var(--cc-border);
}

.membership-info-table td {
  padding: 12px 15px;
  border-bottom: 1px solid #f0f0f0;
  color: var(--cc-text);
}

.membership-info-table tbody tr:last-child td {
  border-bottom: none;
}

.membership-info-table tbody tr:hover {
  background-color: #fafafa;
}

/* Input Example Box */
.input-example-box {
  background: #fffef5;
  border: 2px solid #ffeaa0;
  border-radius: 8px;
  padding: 20px;
  margin: 30px 0;
}

.input-example-table {
  width: 100%;
  border-collapse: collapse;
}

.input-example-table td {
  padding: 10px;
  font-size: 15px;
  color: var(--cc-text);
}

.input-example-table .example-value {
  text-align: right;
  font-weight: 600;
  color: #007bff;
  min-width: 80px;
}

.input-example-table .highlight-row {
  background: #fff9e6;
}

.input-example-table .highlight-row td {
  padding: 12px 10px;
}

.input-example-table .example-note {
  text-align: left;
  font-size: 14px;
  padding-top: 5px;
  color: var(--cc-text-muted);
}

.input-example-table .example-note strong {
  color: #28a745;
  font-weight: 600;
}

/* Example Platinum Table */
.example-table {
  width: 100%;
  border-collapse: collapse;
  margin: 30px 0;
  font-size: 15px;
  background: #fff;
  border: 1px solid var(--cc-border);
  border-radius: 8px;
  overflow: hidden;
}

.example-table thead {
  background: #f9fafb;
}

.example-table th {
  padding: 15px;
  text-align: left;
  font-weight: 600;
  color: var(--cc-text);
  border-bottom: 2px solid var(--cc-border);
}

.example-table td {
  padding: 12px 15px;
  border-bottom: 1px solid #f0f0f0;
  color: var(--cc-text);
}

.example-table tbody tr:hover {
  background-color: #fafafa;
}

.example-table .total-row {
  background: var(--cc-primary);
  font-weight: 600;
  border-top: 2px solid var(--cc-primary-dark);
}

.example-table .total-row td {
  color: var(--cc-text);
  padding: 15px;
  border-bottom: none;
}

/* Responsive Intro Section */
@media (max-width: 768px) {
  .calculator-intro-section {
    padding: 25px 20px;
  }

  .intro-title {
    font-size: 24px;
    margin-bottom: 20px;
  }

  .intro-text {
    font-size: 15px;
  }

  .membership-info-table,
  .example-table {
    font-size: 13px;
  }

  .membership-info-table th,
  .membership-info-table td,
  .example-table th,
  .example-table td {
    padding: 10px 8px;
  }

  .input-example-box {
    padding: 15px;
  }

  .input-example-table td {
    font-size: 14px;
    padding: 8px;
  }
}

@media (max-width: 480px) {
  .calculator-intro-section {
    padding: 20px 15px;
  }

  .intro-title {
    font-size: 20px;
  }

  .membership-info-table,
  .example-table {
    font-size: 12px;
  }

  .membership-info-table th,
  .membership-info-table td,
  .example-table th,
  .example-table td {
    padding: 8px 5px;
  }
}

/* Main Container */
.react-commissie-calculator-container {
  width: 100%;
  margin: 0 auto;
  font-family: var(--cc-font);
  color: var(--cc-text);
  line-height: 1.5;
  box-sizing: border-box;
}

.react-commissie-calculator-container * {
  box-sizing: border-box;
}

.commissie-calculator-modern {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 0;
}

/* Header */
.calculator-header {
  text-align: center;
  margin-bottom: 40px;
}

.calculator-header h2 {
  font-size: 32px;
  font-weight: 700;
  margin: 0 0 10px 0;
  color: var(--cc-text);
}

.calculator-header .subtitle {
  font-size: 18px;
  color: var(--cc-text-muted);
  margin: 0;
}

/* Layout Grid */
.calculator-layout {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 30px;
  align-items: start;
}

@media (max-width: 900px) {
  .calculator-layout {
    grid-template-columns: 1fr;
  }
}

/* Cards */
.card {
  background: var(--cc-card-bg);
  border-radius: var(--cc-radius);
  padding: 30px;
  box-shadow: var(--cc-shadow);
  border: 1px solid var(--cc-border);
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 25px 0;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--cc-primary);
  display: inline-block;
}

/* Form Controls */
.form-group {
  margin-bottom: 25px;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--cc-text);
}

.form-control {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid var(--cc-border);
  border-radius: 8px;
  font-family: var(--cc-font);
  font-size: 15px;
  transition: all 0.2s ease;
  background-color: #f9f9f9;
}

.form-control:hover {
  border-color: #d0d0d0;
  background-color: #fff;
}

.form-control:focus {
  outline: none;
  border-color: var(--cc-primary);
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(250, 197, 0, 0.1);
}

/* Select Styling - Enhanced */
.membership-selector {
  margin-bottom: 30px;
}

.select-wrapper {
  position: relative;
}

.select-wrapper::after {
  content: "";
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 8px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23fac500' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  pointer-events: none;
  transition: transform 0.2s ease;
}

.select-wrapper:hover::after {
  transform: translateY(-40%);
}

.custom-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  cursor: pointer;
  padding-right: 45px;
  font-weight: 600;
  background: linear-gradient(to bottom, #ffffff 0%, #fafafa 100%);
  border: 2px solid var(--cc-border);
  color: var(--cc-text);
}

.custom-select:hover {
  border-color: var(--cc-primary);
  background: #fff;
}

.custom-select:focus {
  border-color: var(--cc-primary);
  box-shadow: 0 0 0 3px rgba(250, 197, 0, 0.15);
  background: #fff;
}

/* Select Options Styling (limited browser support but adds polish) */
.custom-select option {
  padding: 10px;
  background: #fff;
  color: var(--cc-text);
  font-weight: 500;
}

/* Range Slider & Inputs */
.control-group {
  margin-bottom: 30px;
}

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

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

.label-row label {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.number-input-wrapper {
  width: 70px;
}

.small-input {
  padding: 8px;
  text-align: center;
  font-weight: 600;
}

/* Range Slider Customization */
.range-slider {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: #e9e9e9;
  border-radius: 3px;
  outline: none;
  padding: 0;
  margin: 0;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--cc-primary);
  cursor: pointer;
  transition: transform 0.1s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  border: 2px solid #fff;
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

.range-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--cc-primary);
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Result Summary */
.result-summary-card {
  background: linear-gradient(135deg, #fdfbf0 0%, #fff 100%);
  border: 2px solid rgba(250, 197, 0, 0.1);
  border-radius: 12px;
  padding: 25px;
  text-align: center;
  margin-bottom: 30px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.summary-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.summary-divider {
  width: 1px;
  height: 50px;
  background: #e9e9e9;
}

.summary-label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--cc-text-muted);
  margin-bottom: 8px;
  font-weight: 600;
}

.summary-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--cc-text);
}

.summary-value.highlight {
  font-size: 36px;
  color: var(--cc-text);
  /* Text gradient effect slightly */
  background: linear-gradient(45deg, #222, #444);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  /* Fallback */
  color: #222;
}

.vat-notice {
  width: 100%;
  text-align: center;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid rgba(250, 197, 0, 0.2);
  font-size: 13px;
  color: #666;
  font-style: italic;
}

@media (max-width: 600px) {
  .summary-divider {
    display: none;
  }
  .result-summary-card {
    flex-direction: column;
    gap: 15px;
  }
}

/* View Toggles */
.display-mode-toggle {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 25px;
}

.mode-btn {
  padding: 10px 25px;
  background: transparent;
  border: 2px solid var(--cc-border);
  border-radius: 25px;
  font-family: var(--cc-font);
  font-weight: 600;
  font-size: 14px;
  color: var(--cc-text-muted);
  cursor: pointer;
  transition: all 0.3s ease;
}

.mode-btn:hover {
  border-color: var(--cc-primary);
  color: var(--cc-text);
}

.mode-btn.active {
  background: var(--cc-primary);
  border-color: var(--cc-primary);
  color: #fff;
}

/* Table Styles */
.calculation-table-wrapper {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid #f0f0f0;
}

.calculation-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.calculation-table th {
  background: #f9fafb;
  padding: 15px;
  text-align: left;
  font-weight: 600;
  color: var(--cc-text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--cc-border);
}

.calculation-table td {
  padding: 15px;
  border-bottom: 1px solid #f0f0f0;
  color: var(--cc-text);
}

.calculation-table tr:last-child td {
  border-bottom: none;
}

.calculation-table tr:hover {
  background-color: #fafafa;
}

.level-badge {
  display: inline-block;
  width: 24px;
  height: 24px;
  line-height: 24px;
  text-align: center;
  background: var(--cc-text);
  color: #fff;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 600;
}

.col-currency {
  font-weight: 600;
  color: var(--cc-text);
}

/* Comparison View */
.comparison-view {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
}

.comparison-card {
  background: #f9fafb;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  border: 1px solid var(--cc-border);
  transition: transform 0.2s ease;
}

.comparison-card:hover {
  transform: translateY(-2px);
  border-color: var(--cc-primary);
}

.comparison-header h4 {
  margin: 0 0 15px 0;
  font-size: 16px;
  color: var(--cc-text);
}

.comparison-stat {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.stat-label {
  font-size: 11px;
  color: var(--cc-text-muted);
  text-transform: uppercase;
}

.stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--cc-text);
}

.stat-members-count {
  font-size: 12px;
  color: var(--cc-text-muted);
  margin-top: 6px;
}

/* Error State */
.error-message {
  text-align: center;
  padding: 40px;
  color: #e74c3c;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* ============================================
   Help Button & Modal Styles
   ============================================ */

/* Help Button - Exact same style as mode-btn */
.cc-help-button {
  display: none; /* Hidden until positioned by JS */
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 10px 25px;
  background: transparent;
  border: 2px solid var(--cc-border);
  border-radius: 25px;
  font-family: var(--cc-font);
  font-weight: 600;
  font-size: 14px;
  color: var(--cc-text-muted);
  cursor: pointer;
  transition: all 0.3s ease;
}

.cc-help-button:hover {
  border-color: var(--cc-primary);
  color: var(--cc-text);
}

.cc-help-button:focus {
  outline: none;
  border-color: var(--cc-primary);
  color: var(--cc-text);
}

.cc-help-button svg {
  flex-shrink: 0;
}

/* Modal Overlay */
.cc-help-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  padding: 20px;
}

.cc-help-modal-overlay.cc-help-modal-active {
  opacity: 1;
  visibility: visible;
}

/* Modal Content - Matching card style */
.cc-help-modal {
  position: relative;
  background: var(--cc-card-bg);
  border-radius: var(--cc-radius);
  box-shadow: var(--cc-shadow);
  border: 1px solid var(--cc-border);
  max-width: 520px;
  width: 100%;
  padding: 30px;
  transform: translateY(20px) scale(0.95);
  transition: transform 0.25s ease;
}

.cc-help-modal-overlay.cc-help-modal-active .cc-help-modal {
  transform: translateY(0) scale(1);
}

/* Modal Close Button */
.cc-help-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.05);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: var(--cc-text-muted);
  transition: all 0.2s ease;
  z-index: 2;
}

.cc-help-modal-close:hover {
  background: rgba(0, 0, 0, 0.1);
  color: var(--cc-text);
}

.cc-help-modal-close:active {
  background: rgba(0, 0, 0, 0.15);
  transform: scale(0.95);
}

.cc-help-modal-close:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(250, 197, 0, 0.2);
}

.cc-help-modal-close svg {
  flex-shrink: 0;
}

/* Modal Title - Matching card-title style */
.cc-help-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--cc-text);
  margin: 0 0 25px 0;
  padding-bottom: 15px;
  padding-right: 45px;
  border-bottom: 2px solid var(--cc-primary);
  display: block;
}

/* Steps Container */
.cc-help-steps {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 20px;
}

/* Individual Step */
.cc-help-step {
  display: flex;
  gap: 15px;
  align-items: flex-start;
}

.cc-help-step-number {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cc-primary);
  color: var(--cc-text);
  font-weight: 700;
  font-size: 14px;
  border-radius: 50%;
}

.cc-help-step-content {
  flex: 1;
  padding-top: 4px;
}

.cc-help-step-content strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--cc-text);
  margin-bottom: 4px;
}

.cc-help-step-content p {
  font-size: 14px;
  color: var(--cc-text-muted);
  margin: 0;
  line-height: 1.6;
}

/* Help Note */
.cc-help-note {
  font-size: 13px;
  color: var(--cc-text-muted);
  margin: 20px 0 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--cc-border);
  line-height: 1.6;
}

/* Responsive Modal */
@media (max-width: 600px) {
  .cc-help-modal {
    padding: 25px 20px;
  }

  .cc-help-modal-title {
    font-size: 16px;
    margin-bottom: 20px;
    padding-bottom: 12px;
  }

  .cc-help-modal-close {
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
  }

  .cc-help-modal-close svg {
    width: 18px;
    height: 18px;
  }

  .cc-help-steps {
    gap: 16px;
  }

  .cc-help-step {
    gap: 12px;
  }

  .cc-help-step-number {
    width: 28px;
    height: 28px;
    font-size: 13px;
  }

  .cc-help-step-content strong {
    font-size: 14px;
  }

  .cc-help-step-content p {
    font-size: 13px;
  }

  .cc-help-note {
    font-size: 12px;
    margin-top: 16px;
    padding-top: 16px;
  }

  .cc-help-button {
    font-size: 13px;
    padding: 9px 20px;
  }
}
