.form-switch {
    position: relative;
    display: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    color: #686868;
    font-size: .8em;
    align-items: center;
    gap: .5em;
    flex-direction: row;
}

.form-switch i {
    position: relative;
    display: inline-block;
    margin-right: 0.5rem;
    width: 46px;
    height: 26px;
    background-color: #e6e6e6;
    border-radius: 23px;
    vertical-align: text-bottom;
    transition: all 0.3s linear;
}

.form-switch i::before {
    content: "";
    position: absolute;
    left: 0;
    width: 42px;
    height: 22px;
    background-color: #fff;
    border-radius: 11px;
    transform: translate3d(2px, 2px, 0) scale3d(1, 1, 1);
    transition: all 0.25s linear;
}

.form-switch i::after {
    content: "";
    position: absolute;
    left: 0;
    width: 22px;
    height: 22px;
    background-color: #fff;
    border-radius: 11px;
    box-shadow: 0 2px 2px rgba(0, 0, 0, 0.24);
    transform: translate3d(2px, 2px, 0);
    transition: all 0.2s ease-in-out;
}

.form-switch:active i::after {
    width: 28px;
    transform: translate3d(2px, 2px, 0);
}

.form-switch:active input:checked + i::after {
    transform: translate3d(16px, 2px, 0);
}

.form-switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.form-switch input:checked + i {
    background-color: var(--success);
}

.form-switch input:checked + i::before {
    transform: translate3d(18px, 2px, 0) scale3d(0, 0, 0);
}

.form-switch input:checked + i::after {
    transform: translate3d(22px, 2px, 0);
}

.duplicate-chart-label {
    padding: 4px 12px;
    border-radius: 50em;
    font-size: 0.7em;
    background-color: var(--base-light-trans-50);
    color: var(--primary);
    text-transform: uppercase;
    white-space: nowrap;
}

.chart-visibility-badge {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: .3em;
  border: 1px solid #000;
  border-radius: 50px;
  padding: 2px 8px;
  background: #fff;
  margin-top: 1em;
  font-size: .8em;
}

/* Cards on the main grid */
.chart-seder {
    display: flex;
    flex-direction: column;
}
.masechtas {
    padding-left: 0px;
}

.masechta {
    list-style: none;
}
.chart-card {
  border: 1px solid var(--primary);
  padding: 1em;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
  transition: all 0.25s ease;
  max-width: 360px;
}
.chart-card:hover {
  box-shadow: 0 12px 30px rgba(0,0,0,0.12);
}
@media (max-width: 767px) {
  .chart-card { max-width: 100%; }
}

.chart-card__title-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1em;
}
.chart-card__title {
  display: flex;
  align-items: end;
  gap: .3em;
}
.chart-card__title h3 {
  margin: 0;
  font-size: 1.2em;
  font-weight: 600;
  color: var(--primary);
}
.chart-card__title-number {
    font-size: 0.85em;
    color: #777;
}

.chart-card__learners {
    font-size: 0.9em;
}
.chart-card__learners span {
  display: block;
  font-weight: 600;
  color: var(--accent);
  font-size: 0.85em;
  margin-bottom: 4px;
}
.chart-card__learners p {
  margin: 4px 0;
  line-height: 1.4;
}

.chart-card__learn-btn {
  width: 100%;
  padding: 14px;
  background: var(--primary-medium);
  color: white;
  border: none;
  border-radius: 30px;
  font-weight: 600;
  font-size: 1.05em;
  cursor: pointer;
  margin-top: 1em;
  text-align: center;
}
.chart-card__learn-btn:hover {
  opacity: 0.92;
}


/* Modal Styles */
.pereks-popup-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: .5em;
    padding: 10px 20px;
}

.perek-popup {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  background: #e0e0e0;
  color: #666;
  font-weight: bold;
  font-size: 1.15em;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.25s ease;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.perek-popup.available {
  background: var(--success,#4caf50);
  color: white;
  cursor: pointer;
}
.perek-popup.in-progress,
.perek-popup.complete {
  background: #e0e0e0;
  color: #999;
  cursor: not-allowed;
}
.perek-popup.selected {
  background: var(--primary,#2b6cb0);
  transform: scale(1.12);
  box-shadow: 0 8px 20px rgba(43,108,176,0.5);
}
.perek-popup .checkmark {
  position: absolute;
  font-size: 32px;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.perek-popup.selected .checkmark {
  opacity: 1;
  color: #4caf50;
}

/* Select All button */
.select-all-wrapper {
  text-align: center;
  margin: 15px 0 10px;
}
.select-all-btn {
  padding: 10px 24px;
  border: 2px solid var(--primary);
  background: transparent;
  color: var(--primary);
  border-radius: 30px;
  font-weight: 600;
  cursor: pointer;
}
.select-all-btn:hover {
  background: var(--primary);
  color: white;
}

/* Form fields */
.popup-form-wrapper form {
    max-width: 350px;
    margin: 0px auto;
}
.popup-form-wrapper input[type="text"],
.popup-form-wrapper input[type="tel"],
.popup-form-wrapper input[type="email"] {
  width: 100%;
  margin: 10px auto;
  padding: 8px;
  border: 2px solid #ddd;
  border-radius: 14px;
  font-size: 1em;
  line-height: 1;
  transition: all 0.3s;
  display: block;
  text-align: left;
}
.popup-form-wrapper input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(43,108,176,0.2);
}

/* Cancel / Submit buttons */
.pledge-buttons {
    display: flex;
    gap: 14px;
    justify-content: center;
    padding-top: 1em;
    border-top: 1px solid #c7c7c7;
}
.pledge-cancel,
.pledge-submit {
  padding: 12px 26px;
  border-radius: 30px;
  font-weight: 600;
  font-size: 1em;
  min-width: 110px;
  transition: all 0.2s;
}
.pledge-cancel {
  background: white;
  color: #555;
  border: 2px solid #ccc;
}
.pledge-cancel:hover { background: #f0f0f0; }
.pledge-submit {
  background: var(--primary-medium);
  color: white;
  border: none;
}
.pledge-submit:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* Titles */
.popup-title {
  color: var(--primary);
  font-size: 1.7em !important;
  margin: 0 0 8px 0 !important;
  font-weight: 600;
}
.popup-subtitle {
  color: #555;
  margin-bottom: 20px;
  font-size: 1.05em;
}

/* SweetAlert2 & Plainsheet */
.mishnah-swal-popup,
.plainsheet {
  border-radius: 20px !important;
}
@media (max-width: 768px) {
  .swal2-popup,
  .plainsheet {
    margin: 8px !important;
    border-radius: 20px !important;
  }
  .swal2-html-container { padding: 20px !important; }
}

/* Grid */
.grid--auto-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2em;
}
@media (max-width: 480px) {
  .grid--auto-3 { grid-template-columns: 1fr; }
}

.pbs-container {
  padding: 1em;
  width: 100% !important;
  border-radius: 20px 20px 0 0;
  background: #ffffff;
}

.pledge-submit {
    position: relative;
    min-width: 140px;
    padding: 12px 28px;
    font-weight: 600;
    display: inline-flex;
    text-align: center;
    background: var(--primary-medium);
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.2s;
}

.pledge-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.pledge-submit .btn-spinner {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

/* Hide text when spinner is visible */
.pledge-submit.loading {
    color: transparent !important;
}

.spinner {
    animation: rotate 1s linear infinite;
}

@keyframes rotate {
    100% { transform: rotate(360deg); }
}

.path {
    stroke: white;
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

@keyframes dash {
    0% { stroke-dasharray: 1, 150; stroke-dashoffset: 0; }
    50% { stroke-dasharray: 90, 150; stroke-dashoffset: -35; }
    100% { stroke-dasharray: 90, 150; stroke-dashoffset: -124; }
}

.form-error {
    color: #d93025;
    font-size: 14px;
    margin-top: 12px;
    text-align: center;
    font-weight: 500;
}