/* ===== Wizard / stages (shared visual language with nemala-meshakefet) ===== */
.guide-container {
  direction: rtl;
}

.stage {
  display: none;
}

.stage.active {
  display: block;
}

.stage h2 {
  color: #007BFF;
  margin-bottom: 0.5rem;
}

.step {
  margin: 0.5rem 0;
  padding-right: 1rem;
  position: relative;
  font-size: large;
}

.step::before {
  content: "\2714";
  position: relative;
  right: -1rem;
  color: green;
}

.nav-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  flex-direction: row-reverse;
}

.nav-buttons button {
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
  border: none;
  border-radius: 5px;
  background-color: #007BFF;
  color: white;
  cursor: pointer;
}

.nav-buttons button:disabled {
  background-color: #ccc;
  cursor: default;
}

.downloads {
  margin-top: 0.5rem;
  padding-right: 1rem;
  padding-top: 0.3rem;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.downloads a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #2f8e95;
  color: white;
  padding: 0.4rem 1rem;
  border-radius: 10px;
  text-decoration: none;
  font-size: 1rem;
  min-width: 100px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  transition: all 0.3s ease;
  font-weight: bold;
}

.downloads a:hover {
  background-color: #4c9499;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.downloads a span {
  margin-left: 0.5rem;
  font-size: 1.2rem;
}

/* ===== Guide screenshot ===== */
.guide-screenshot {
  margin: 1rem auto;
  max-width: 320px;
  text-align: center;
}

.guide-screenshot img {
  width: 100%;
  height: auto;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.guide-screenshot figcaption {
  margin-top: 0.6rem;
  font-size: 0.9rem;
  color: #666;
  line-height: 1.4;
}

/* ===== File upload ===== */
input[type="file"] {
  display: none;
}

.upload-controls {
  background: #fafafa;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.custom-upload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #4caf50;
  color: white;
  border: none;
  border-radius: 5px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease;
  margin: 0.5rem 0;
  padding: 0.5rem 1rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.custom-upload:hover {
  background-color: #388e3c;
}

.file-list {
  margin: 0;
  padding: 0;
  list-style: none;
  direction: rtl;
}

.file-list li {
  background: #f1f1f1;
  padding: 10px 15px;
  border-radius: 6px;
  margin-bottom: 10px;
  font-size: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.file-actions {
  display: flex;
  gap: 10px;
}

.file-actions button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0 5px;
}

.file-actions button:hover {
  color: #c62828;
}

#submitBtn {
  display: block;
  margin: 2rem auto;
  background-color: #9c27b0;
  color: white;
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  text-align: center;
  transition: background-color 0.3s ease;
}

#submitBtn:hover {
  background-color: #7b1fa2;
}

/* ===== Plan editor ===== */
.plan-editor {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1rem 0;
}

.plan-card {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.6rem 0.85rem;
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 0.85rem 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.plan-field {
  display: flex;
  flex-direction: column;
}

.plan-field label {
  font-weight: 600;
  font-size: 0.8rem;
  color: #666;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.plan-field--name {
  flex: 1 1 160px;
}

.plan-field--days {
  align-self: flex-end;
}

.plan-field__inline {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.plan-field input[type="text"],
.plan-field input[type="number"] {
  padding: 7px 9px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
}

.plan-field--name input[type="text"] {
  width: 100%;
  box-sizing: border-box;
}

.plan-field--discount input[type="number"] {
  width: 64px;
}

.plan-field__suffix {
  font-weight: 700;
  color: #444;
}

.plan-remove-btn {
  align-self: flex-end;
  background: #fdecea;
  color: #c62828;
  border: 1px solid #f5c6c0;
  border-radius: 6px;
  width: 34px;
  height: 34px;
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
  flex: 0 0 auto;
}

.plan-remove-btn:hover {
  background: #f9d6d2;
}

.day-toggle {
  border: 1px solid #c4c4c4;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.day-toggle__btn {
  border: none;
  background: #fff;
  color: #555;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0.45rem 0.9rem;
  transition: all 0.15s ease;
}

.day-toggle__btn + .day-toggle__btn {
  border-right: 1px solid #c4c4c4;
}

.day-toggle__btn--active {
  background: #2f8e95;
  color: #fff;
}

.plan-field select {
  padding: 7px 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
  cursor: pointer;
}

.plan-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.5rem;
}

.plan-reset-btn {
  background: #fff;
  border: 1px solid #9c27b0;
  color: #9c27b0;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
}

.plan-reset-btn:hover {
  background: #f7e9fa;
}

.price-control {
  margin-top: 1.25rem;
  padding: 1rem;
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
}

.price-control label {
  font-weight: 600;
  display: block;
  margin-bottom: 0.4rem;
}

.price-control input[type="number"] {
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
  width: 140px;
  font-family: inherit;
}

.price-hint {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: #666;
}

/* ===== Loading message ===== */
#loadingMessage {
  font-size: 1.05rem;
}

/* ===== Results ===== */
.period-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin: 1rem 0 1.5rem;
}

.summary-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 1rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.summary-card__label {
  font-size: 0.85rem;
  color: #777;
  margin-bottom: 0.35rem;
}

.summary-card__value {
  font-size: 1.15rem;
  font-weight: 700;
  color: #222;
}

.best-plan-callout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  background: linear-gradient(135deg, #e8f5e9 0%, #f3e8ff 100%);
  border: 1px solid #81c784;
  border-radius: 12px;
  padding: 1.25rem;
  margin: 0 auto 1.5rem;
  max-width: 640px;
}

.best-plan-callout__badge {
  background: #2e7d32;
  color: #fff;
  padding: 0.25rem 0.85rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
}

.best-plan-callout__name {
  font-size: 1.4rem;
  color: #222;
}

.best-plan-callout__savings {
  font-size: 1.05rem;
  color: #2e7d32;
  font-weight: 600;
}

.plans-result-table-wrapper {
  overflow-x: auto;
}

.plans-result-table {
  width: 100%;
  margin: 0 auto 2rem;
  border-collapse: collapse;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  background-color: white;
  min-width: 640px;
}

.plans-result-table th,
.plans-result-table td {
  padding: 0.85rem 0.6rem;
  text-align: center;
  border-bottom: 1px solid #eee;
}

.plans-result-table th {
  background-color: #80cbc4;
  color: #333;
  font-weight: bold;
}

.plans-result-table tr:hover {
  background-color: #f5f5f5;
}

.plans-result-table .plan-name-cell {
  font-weight: 600;
  text-align: right;
}

.plans-result-table .savings-cell {
  color: #2e7d32;
  font-weight: 700;
}

.plans-result-table .best-row {
  background-color: #e8f5e9;
}

.plans-result-table .best-row:hover {
  background-color: #d9f0db;
}

.plans-result-table .best-row .plan-name-cell::before {
  content: "★ ";
  color: #f9a825;
}

.chart-container {
  position: relative;
  width: 100%;
  height: 320px;
  margin-top: 1rem;
}

.chart-container canvas {
  width: 100% !important;
  height: 100% !important;
}

/* ===== Conversion banners & CTAs (shared with nemala-meshakefet) ===== */
.tool-conversion-banner {
  margin: 1.25rem auto;
  max-width: 720px;
  padding: 1.25rem 1.5rem;
  border-radius: 12px;
  text-align: right;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.tool-conversion-banner--primary {
  background: linear-gradient(135deg, #f3e8ff 0%, #e8f5e9 100%);
  border: 1px solid #c5b3e6;
}

.tool-conversion-banner--success {
  background: #e8f5e9;
  border: 1px solid #81c784;
}

.tool-conversion-banner .guest-line {
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
  color: #555;
}

.tool-conversion-banner__title {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: #4a148c;
}

.tool-conversion-banner__text {
  margin: 0 0 0.75rem;
  color: #333;
  line-height: 1.5;
}

.tool-conversion-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-start;
}

.tool-conversion-btn {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  border: none;
  font-family: inherit;
}

.tool-conversion-btn--primary {
  background-color: #7851a9;
  color: #fff;
}

.tool-conversion-btn--primary:hover {
  background-color: #5f3d87;
  color: #fff;
}

.tool-conversion-btn--secondary {
  background-color: #fff;
  color: #7851a9;
  border: 1px solid #7851a9;
}

.tool-conversion-btn--secondary:hover {
  background-color: #f3e8ff;
}

.post-results-actions {
  display: flex;
  justify-content: center;
  margin: 1.5rem 0 0;
}

.tool-conversion-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: #2e7d32;
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  z-index: 9999;
  transition: transform 0.25s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.tool-conversion-toast.show {
  transform: translateX(-50%) translateY(0);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .plan-field--name {
    flex: 1 1 100%;
  }

  .plans-result-table th,
  .plans-result-table td {
    font-size: 0.8rem;
    padding: 0.5rem 0.35rem;
  }
}
