/* ── Cron Expression Tester ──────────────────────────────────────────── */

/* Form */
.cron-form .form-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.cron-form .input-wrap { position: relative; }
.cron-form .input-wrap--expr { flex: 2; }
.cron-form .input-wrap--tz { flex: 1; min-width: 180px; }
.cron-form .input-label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 6px;
  font-weight: 500;
}
.cron-form .input {
  width: 100%;
  height: 44px;
  padding: 12px 16px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
  font-family: var(--mono);
  transition: border-color .2s, box-shadow .2s;
  appearance: none;
  -webkit-appearance: none;
}
.cron-form select.input {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236b7280'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 32px;
  font-size: 13px;
}
.cron-form .input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(91,138,248,.3);
}
.cron-form .btn-primary {
  min-height: 44px;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: var(--white);
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .2s, transform .15s, filter .2s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cron-form .btn-primary:hover { transform: scale(1.02); filter: brightness(1.1); }
.cron-form .btn-primary:active { transform: scale(0.98); }

/* Animations */
@keyframes cronFadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Results wrapper (combines description + runs into one block) ──── */
.cron-results {
  margin-top: 16px;
  animation: cronFadeInUp .4s ease-out;
}
.cron-results > .card {
  border: 1px solid rgba(91,138,248,.25);
  box-shadow: 0 0 20px rgba(91,138,248,.08);
}

/* Flash effect on parse */
@keyframes cronResultFlash {
  0%   { border-color: rgba(91,138,248,.6); box-shadow: 0 0 24px 4px rgba(91,138,248,.2); }
  100% { border-color: rgba(91,138,248,.25); box-shadow: 0 0 20px rgba(91,138,248,.08); }
}
.cron-results.is-flash > .card {
  animation: cronResultFlash .8s ease-out;
}

/* Status badge */
.cron-result-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--green, #34d399);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 12px;
}
.cron-result-status::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green, #34d399);
}

/* Description inside results */
.cron-results .cron-description-inner {
  margin-bottom: 20px;
}
.cron-results .cron-description-inner .result-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 8px;
  padding-bottom: 0;
  border-bottom: none;
}
.cron-human {
  font-size: 18px;
  font-weight: 600;
  color: var(--accent);
  line-height: 1.6;
  padding: 16px 20px;
  background: rgba(91,138,248,.06);
  border: 1px solid rgba(91,138,248,.15);
  border-radius: 12px;
  margin: 0;
}

/* Divider between description and runs */
.cron-results-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0 0 20px 0;
}

/* Runs section inside results */
.cron-results .cron-runs-inner .result-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 12px;
  padding-bottom: 0;
  border-bottom: none;
}

/* Results title (reused pattern) — keep for presets */
.cron-presets .result-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid rgba(91,138,248,.15);
}

/* Runs table */
.cron-table-wrap { overflow-x: auto; }
.cron-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.cron-table thead th {
  text-align: left;
  padding: 12px 14px;
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.02);
}
.cron-table thead th:first-child { width: 50px; }
.cron-table tbody td {
  padding: 12px 14px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 13px;
}
.cron-table tbody tr:nth-child(even) td { background: rgba(255,255,255,.02); }
.cron-table tbody tr:hover td { background: rgba(255,255,255,.04); }
.cron-table tbody tr:last-child td { border-bottom: none; }
.cron-table .run-number {
  color: var(--muted);
  font-weight: 500;
}
.cron-table .run-relative {
  color: var(--muted2);
  font-size: 12px;
}

/* Error */
.cron-error {
  margin-top: 16px;
  animation: cronFadeInUp .3s ease-out;
}
.card-error {
  border-color: rgba(248,113,113,.3);
}
.card-error p {
  color: var(--red);
  font-size: 14px;
  margin: 0;
}

/* Presets */
.cron-presets {
  margin-top: 24px;
}
.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.preset-chip {
  padding: 8px 16px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 20px;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.preset-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(91,138,248,.08);
  transform: translateY(-1px);
}
.preset-chip:active {
  transform: translateY(0);
}
.preset-chip.active {
  background: rgba(91,138,248,.15);
  border-color: var(--accent);
  color: var(--accent);
}

/* Cron syntax diagram */
.cron-diagram {
  display: flex;
  gap: 8px;
  margin: 24px 0;
  justify-content: center;
}
.cron-field {
  flex: 1;
  max-width: 120px;
  text-align: center;
  padding: 16px 12px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 12px;
  transition: border-color .2s, transform .15s;
}
.cron-field:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.cron-field-value {
  display: block;
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 8px;
}
.cron-field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.cron-field-range {
  display: block;
  font-size: 11px;
  color: var(--muted);
  font-family: var(--mono);
}

/* Syntax table */
.syntax-table-wrap {
  overflow-x: auto;
  margin-top: 12px;
}
.syntax-table {
  width: 100%;
  max-width: 500px;
  border-collapse: collapse;
}
.syntax-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--muted2);
}
.syntax-table td:first-child {
  width: 80px;
}
.syntax-table code {
  padding: 2px 8px;
  background: var(--surface2);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}
.syntax-table tr:last-child td { border-bottom: none; }

/* Info section */
.info-section {
  margin-top: 32px;
}
.info-section h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid rgba(91,138,248,.15);
}
.info-section h3 {
  font-size: 15px;
  font-weight: 600;
  margin-top: 16px;
  margin-bottom: 8px;
}
.info-section p {
  font-size: 14px;
  color: var(--muted2);
  line-height: 1.7;
}

/* Responsive */
@media (max-width: 700px) {
  .cron-form .form-row {
    flex-direction: column;
  }
  .cron-form .input-wrap--tz { min-width: 0; }
  .cron-form .btn-primary { width: 100%; justify-content: center; }
  .cron-diagram {
    gap: 4px;
  }
  .cron-field {
    padding: 12px 6px;
  }
  .cron-field-value {
    font-size: 18px;
  }
  .cron-field-label {
    font-size: 11px;
  }
  .cron-field-range {
    font-size: 10px;
  }
  .cron-human {
    font-size: 15px;
    padding: 12px 14px;
  }
}
@media (max-width: 400px) {
  .cron-diagram {
    flex-wrap: wrap;
    justify-content: center;
  }
  .cron-field {
    min-width: 70px;
    max-width: none;
    flex: 0 0 calc(33% - 4px);
  }
}
