/**
 * Quartz Scheduler Cron Expression Tool Styles
 * Matches the warm, developer-focused theme used by all tools (same as cron-tool).
 */

/* Page Layout */
.quartz-page-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 15px 40px;
  background: #faf8f5;
  min-height: 100vh;
}

/* ==========================================================================
   Ad Sections (reused)
   ========================================================================== */

.dedicated-ad-section {
  margin: 32px 0;
  padding: 16px 0;
}

.ad-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
}

.ad-label::before,
.ad-label::after {
  content: '';
  flex: 1;
  max-width: 120px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #d1d5db, transparent);
}

.ad-label-text {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #9ca3af;
}

.bottom-ad-section {
  margin: 40px 0 20px 0;
  padding: 16px 0;
}

.top-ad-section {
  margin: 0 0 24px 0;
}

/* ==========================================================================
   Layout & Container
   ========================================================================== */

.quartz-tool {
  max-width: 1200px;
  width: 100%;
  padding: 0;
  background: #faf8f5;
}

body:has(.quartz-tool) {
  background: #faf8f5 !important;
}

.quartz-tool .main-content {
  background: #faf8f5;
}

/* ==========================================================================
   Header
   ========================================================================== */

.tool-header {
  text-align: center;
  margin-bottom: 20px;
  padding: 40px 30px;
  background: linear-gradient(135deg, #292524 0%, #44403c 100%);
  border-radius: 16px;
  color: #faf8f5;
  box-shadow: 0 4px 20px rgba(41, 37, 36, 0.2);
}

.tool-intro {
  text-align: center;
  color: #57534e;
  font-size: 0.95rem;
  line-height: 1.7;
  margin: 0 auto 24px;
  padding: 0 16px;
}

.tool-intro strong {
  color: #44403c;
}

.tool-title {
  font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 2rem;
  font-weight: 800;
  margin: 0 0 8px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.tool-title i {
  font-size: 1.6rem;
  color: #fef3c7;
}

.tool-subtitle {
  font-size: 1rem;
  margin: 0;
  opacity: 0.75;
  font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 400;
  color: #d6d3d1;
}

/* ==========================================================================
   Cross-tool Link Banner
   ========================================================================== */

.cross-tool-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  margin-bottom: 24px;
  background: #f5f0e8;
  border: 2px solid #e7e0d5;
  border-radius: 10px;
  font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.9rem;
  color: #44403c;
  line-height: 1.5;
}

.cross-tool-banner i {
  color: #78716c;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.cross-tool-banner a {
  color: #44403c;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: #d6cfc4;
  text-underline-offset: 2px;
}

.cross-tool-banner a:hover {
  color: #292524;
  text-decoration-color: #292524;
}


/* ==========================================================================
   Mode Tabs
   ========================================================================== */

.mode-tabs {
  display: flex;
  margin-bottom: 24px;
  background: #f5f0e8;
  border-radius: 8px;
  padding: 4px;
}

.mode-tab {
  flex: 1;
  padding: 10px 20px;
  border: none;
  background: transparent;
  font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: #78716c;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 6px;
}

.mode-tab:hover {
  color: #44403c;
}

.mode-tab.active {
  background: #fffdf9;
  color: #292524;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.mode-tab i {
  font-size: 0.85rem;
}

/* ==========================================================================
   Mode Content
   ========================================================================== */

.mode-content {
  display: none;
}

.mode-content.active {
  display: block;
}

/* ==========================================================================
   Input Section (Parse Mode)
   ========================================================================== */

.input-section {
  margin-bottom: 24px;
}

.input-section label {
  display: block;
  font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.input-wrapper {
  display: flex;
  gap: 10px;
}

.input-wrapper input {
  flex: 1;
  padding: 12px 16px;
  font-size: 1.1rem;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
  color: #1c1917;
  border: 2px solid #e7e0d5;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s ease;
  background: #fffdf9;
}

.input-wrapper input:focus {
  border-color: #a8a29e;
}

.input-wrapper input::placeholder {
  color: #a8a29e;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn-primary,
.btn-secondary {
  padding: 12px 24px;
  font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: #292524;
  color: #faf8f5;
  box-shadow: 0 2px 8px rgba(41, 37, 36, 0.2);
}

.btn-primary:hover {
  background: #44403c;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(41, 37, 36, 0.25);
}

.btn-secondary {
  background: #fffdf9;
  color: #44403c;
  border: 2px solid #e7e0d5;
}

.btn-secondary:hover {
  background: #f5f0e8;
  border-color: #d6cfc4;
}

.btn-secondary.copied {
  background: #166534;
  color: white;
  border-color: #166534;
}

/* ==========================================================================
   Quartz Fields Breakdown (Parse Mode) — 6 columns + optional year
   ========================================================================== */

.breakdown-section {
  margin-bottom: 24px;
}

.quartz-fields-compact {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  background: #f5f0e8 !important;
  border: 2px solid #e7e0d5;
  border-radius: 8px;
  padding: 8px 4px;
}

.quartz-fields-compact.has-year {
  grid-template-columns: repeat(7, 1fr);
}

.quartz-fields-compact .quartz-field {
  text-align: center;
  padding: 4px 2px;
  background: transparent !important;
}

.quartz-fields-compact .field-value {
  display: block;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
  font-size: 1.15rem;
  font-weight: 600;
  color: #292524 !important;
  background: transparent !important;
  line-height: 1;
}

.quartz-fields-compact .field-label {
  display: block;
  font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.55rem;
  font-weight: 600;
  color: #78716c !important;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-top: 2px;
}

/* ==========================================================================
   Result Cards
   ========================================================================== */

.result-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.result-card {
  background: #fffdf9;
  border: 2px solid #e7e0d5;
  border-radius: 12px;
  padding: 20px;
}

.result-card h3 {
  font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  color: #78716c;
  margin: 0 0 12px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.result-card h3 i {
  color: #78716c;
}

.result-card.human-readable p {
  font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: #292524;
  margin: 0;
  line-height: 1.4;
}

.result-card.human-readable p.valid {
  color: #166534;
}

.result-card.human-readable p.valid .valid-icon {
  color: #16a34a;
  margin-right: 6px;
  font-size: 0.95rem;
}

.result-card.human-readable p.error {
  color: #991b1b;
}

.result-card.human-readable p a {
  color: #44403c;
  font-weight: 600;
}

/* Quartz description + warning formatting */
.quartz-description {
  display: block;
}

.quartz-warning {
  display: block;
  margin-top: 10px;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 500;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 6px;
  line-height: 1.5;
}

.quartz-warning i {
  color: #b45309;
  margin-right: 4px;
  font-size: 0.78rem;
}

.quartz-warning code {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
  background: #292524;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.78rem;
  color: #fef3c7;
  font-weight: 600;
}

.result-card.next-runs ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.result-card.next-runs li {
  padding: 8px 0;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
  font-size: 0.85rem;
  color: #44403c;
  border-bottom: 1px solid #f5f0e8;
  display: flex;
  align-items: center;
  gap: 8px;
}

.result-card.next-runs li:last-child {
  border-bottom: none;
}

.result-card.next-runs li i {
  color: #166534;
  font-size: 0.75rem;
}

.result-card.next-runs li.placeholder {
  color: #a8a29e;
  font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-style: italic;
}

/* ==========================================================================
   Builder Section — 6 columns
   ========================================================================== */

.builder-compact {
  margin-bottom: 24px;
}

.builder-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  padding: 20px;
  background: #f5f0e8;
  border: 2px solid #e7e0d5;
  border-radius: 12px;
}

.builder-col {
  text-align: center;
}

.builder-col label {
  display: block;
  font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.6rem;
  font-weight: 700;
  color: #78716c;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.builder-col select {
  width: 100%;
  padding: 10px 6px;
  font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  border: 2px solid #e7e0d5;
  border-radius: 8px;
  background: #fffdf9;
  color: #292524;
  cursor: pointer;
  text-align: center;
  text-align-last: center;
  transition: all 0.2s ease;
}

.builder-col select:focus {
  outline: none;
  border-color: #a8a29e;
}

.builder-col select:hover {
  border-color: #d6cfc4;
}

/* ==========================================================================
   Generated Expression
   ========================================================================== */

.generated-section {
  margin-bottom: 24px;
}

.generated-output {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: #292524;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(41, 37, 36, 0.2);
}

.generated-output code {
  flex: 1;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
  font-size: 1.25rem;
  font-weight: 500;
  color: #fef3c7;
  background: none;
  border: none;
  padding: 0;
}

/* ==========================================================================
   Quick Reference
   ========================================================================== */

.reference-section {
  margin-bottom: 32px;
}

.reference-section h3 {
  font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #44403c;
  margin: 0 0 16px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.reference-section h3 i {
  color: #78716c;
}

.reference-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.reference-card {
  background: #fffdf9;
  border: 2px solid #e7e0d5;
  border-radius: 10px;
  padding: 16px 20px;
}

.reference-card h4 {
  font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  color: #78716c;
  margin: 0 0 12px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e7e0d5;
}

.reference-card table {
  width: 100%;
  font-size: 0.85rem;
  border-collapse: collapse;
  background: transparent;
}

.reference-card tr {
  border: none;
  background: transparent;
}

.reference-card td {
  padding: 6px 0;
  color: #44403c;
  font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  border: none;
  background: transparent;
}

.reference-card td:first-child {
  font-weight: 600;
  color: #292524;
}

.reference-card td:last-child {
  text-align: right;
  color: #78716c;
  font-size: 0.8rem;
}

.reference-card code {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
  background: #f5f0e8;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.9rem;
  color: #44403c;
  font-weight: 600;
  border: 1px solid #e7e0d5;
}

/* ==========================================================================
   Examples Table
   ========================================================================== */

.examples-table-section {
  margin-bottom: 32px;
}

.examples-table-section h3 i.fa-lightbulb {
  color: #b45309;
}

.examples-intro {
  font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.9rem;
  color: #78716c;
  margin: 0 0 16px 0;
  line-height: 1.5;
}

.quartz-examples-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fffdf9;
  border: 2px solid #e7e0d5;
  border-radius: 12px;
  overflow: hidden;
  font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.quartz-examples-table thead tr {
  background: #292524 !important;
}

.quartz-examples-table th {
  padding: 14px 16px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #faf8f5 !important;
  background: #292524 !important;
  border: none !important;
}

.quartz-examples-table tbody tr {
  border-bottom: 1px solid #e7e0d5;
  cursor: pointer;
  transition: all 0.15s ease;
  background: #fffdf9;
}

.quartz-examples-table tbody tr:nth-child(even) {
  background: #faf8f5;
}

.quartz-examples-table tbody tr:last-child {
  border-bottom: none;
}

.quartz-examples-table tbody tr:hover {
  background: #f5f0e8 !important;
}

.quartz-examples-table tbody tr:active {
  background: #e7e0d5 !important;
}

.quartz-examples-table td {
  padding: 10px 16px;
  font-size: 0.9rem;
  color: #44403c;
  vertical-align: middle;
  border: none !important;
  background: transparent !important;
}

.quartz-examples-table td:first-child {
  width: 200px;
}

.quartz-examples-table td:first-child code {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
  background: #292524 !important;
  color: #fef3c7 !important;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  display: inline-block;
  border: none !important;
  font-weight: 500;
}

.quartz-examples-table td:nth-child(2) {
  font-weight: 500;
  color: #292524;
}

.quartz-examples-table td:last-child {
  color: #a8a29e;
  font-size: 0.75rem;
  width: 90px;
  text-align: right;
}

/* ==========================================================================
   Syntax Guide Section
   ========================================================================== */

.syntax-guide-section {
  margin-bottom: 32px;
}

.syntax-guide-section > h3 {
  font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #44403c;
  margin: 0 0 16px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.syntax-guide-section > h3 i.fa-graduation-cap {
  color: #7c3aed;
}

.syntax-guide-content {
  background: #fffdf9;
  border: 2px solid #e7e0d5;
  border-radius: 12px;
  overflow: hidden;
}

.guide-article {
  padding: 24px 28px;
  border-bottom: 1px solid #e7e0d5;
}

.guide-article:last-child {
  border-bottom: none;
}

.guide-article h2 {
  font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #292524;
  margin: 0 0 12px 0;
}

.guide-article h3 {
  font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #44403c;
  margin: 16px 0 8px 0;
}

.guide-article h3:first-of-type {
  margin-top: 0;
}

.guide-article p {
  font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.9rem;
  color: #57534e;
  margin: 0 0 12px 0;
  line-height: 1.7;
}

.guide-article p:last-child {
  margin-bottom: 0;
}

.guide-article ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.guide-article ul li {
  font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.9rem;
  color: #57534e;
  line-height: 1.7;
  padding: 8px 0 8px 20px;
  position: relative;
  border-bottom: 1px solid #f5f0e8;
}

.guide-article ul li:last-child {
  border-bottom: none;
}

.guide-article ul li::before {
  content: "•";
  color: #7c3aed;
  font-weight: bold;
  position: absolute;
  left: 0;
}

.guide-article code {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
  background: #292524;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85rem;
  color: #fef3c7;
}

.syntax-diagram {
  background: #292524;
  color: #a8a29e;
  padding: 20px;
  border-radius: 8px;
  margin: 16px 0;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
  font-size: 0.8rem;
  line-height: 1.6;
  overflow-x: auto;
}

.syntax-diagram code {
  background: transparent;
  padding: 0;
  color: inherit;
  display: block;
}

/* ==========================================================================
   FAQ Section
   ========================================================================== */

.faq-section {
  margin-bottom: 40px;
  padding: 30px;
  background: #f5f0e8;
  border-radius: 16px;
  border: 2px solid #e7e0d5;
}

.faq-section h2 {
  font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: #44403c;
  margin: 0 0 24px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.faq-section h2 i {
  color: #78716c;
}

.faq-item {
  background: #fffdf9;
  border: 2px solid #e7e0d5;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 12px;
}

.faq-item:last-child {
  margin-bottom: 0;
}

.faq-item h3 {
  font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #292524;
  margin: 0 0 10px 0;
}

.faq-item p {
  font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.9rem;
  color: #78716c;
  margin: 0;
  line-height: 1.6;
}

.faq-item code {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
  background: #292524;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85rem;
  color: #fef3c7;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
  .quartz-page-wrapper {
    padding: 15px 12px 30px;
  }

  .tool-header {
    padding: 30px 20px;
    border-radius: 12px;
  }

  .tool-title {
    font-size: 1.5rem;
  }

  .input-wrapper {
    flex-direction: column;
  }

  .btn-primary {
    justify-content: center;
  }

  .quartz-fields-compact {
    grid-template-columns: repeat(3, 1fr);
    padding: 12px 4px;
    gap: 4px;
  }

  .quartz-fields-compact .field-value {
    font-size: 1rem;
  }

  .result-section {
    grid-template-columns: 1fr;
  }

  .builder-row {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 16px;
  }

  .reference-grid {
    grid-template-columns: 1fr;
  }

  .quartz-examples-table td:last-child,
  .quartz-examples-table th:last-child {
    display: none;
  }

  .quartz-examples-table td {
    padding: 8px 12px;
    font-size: 0.85rem;
  }

  .quartz-examples-table th {
    padding: 10px 12px;
    font-size: 0.7rem;
  }

  .quartz-examples-table td:first-child {
    width: 160px;
  }

  .quartz-examples-table td:first-child code {
    font-size: 0.68rem;
    padding: 5px 8px;
  }

  .generated-output {
    flex-direction: column;
    text-align: center;
  }

  .generated-output code {
    width: 100%;
    text-align: center;
  }

  .faq-section {
    padding: 20px;
  }

  .guide-article {
    padding: 20px;
  }

  .syntax-diagram {
    font-size: 0.65rem;
    padding: 15px;
  }

  .cross-tool-banner {
    font-size: 0.85rem;
    padding: 10px 14px;
  }
}

@media (max-width: 480px) {
  .tool-title {
    font-size: 1.3rem;
  }

  .mode-tab {
    padding: 10px 12px;
    font-size: 0.85rem;
  }

  .quartz-fields-compact {
    grid-template-columns: repeat(3, 1fr);
  }

  .quartz-fields-compact .field-value {
    font-size: 0.9rem;
  }

  .quartz-fields-compact .field-label {
    font-size: 0.5rem;
  }

  .builder-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .builder-col select {
    font-size: 0.78rem;
    padding: 8px 4px;
  }

  .quartz-examples-table td:first-child {
    width: 130px;
  }

  .quartz-examples-table td:first-child code {
    font-size: 0.62rem;
    padding: 4px 6px;
  }

  .quartz-examples-table td:nth-child(2) {
    font-size: 0.8rem;
  }
}
