/* ==========================================================================
   DATE CALCULATOR - STYLES
   Pixel-accurate matching to Calculator Archive, reference images & classic layout
   ========================================================================== */

.date-page-container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 12px 18px 40px;
  font-family: Arial, Helvetica, sans-serif;
  color: #333333;
}

/* Top Bar & Breadcrumbs */
.date-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.date-breadcrumbs {
  font-size: 13px;
  color: #555555;
  margin-bottom: 0;
}

.date-top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.date-top-print-link {
  background: none;
  border: none;
  color: #0844a4;
  font-size: 13px;
  cursor: pointer;
  padding: 2px 6px;
  text-decoration: underline;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  border-radius: 2px;
}

.date-top-print-link:hover {
  color: #0b386b;
  background-color: #f1f5f9;
}

.date-print-link-btn {
  background: #ffffff;
  border: 1px solid #7f9db9;
  color: #0844a4;
  font-size: 12px;
  font-weight: bold;
  padding: 4px 10px;
  border-radius: 3px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  font-family: inherit;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.date-print-link-btn:hover {
  background: #f0f4f8;
  border-color: #0b386b;
  color: #0b386b;
}

.date-breadcrumbs a {
  color: #0844a4;
  text-decoration: none;
}

.date-breadcrumbs a:hover {
  text-decoration: underline;
}

.date-breadcrumbs .sep {
  margin: 0 4px;
  color: #666666;
}

.date-breadcrumbs .current {
  color: #333333;
  font-weight: normal;
}

/* Page Title & Notification Bar */
.date-title {
  font-size: 26px;
  font-weight: bold;
  color: #0b386b;
  margin: 0 0 10px 0;
  line-height: 1.2;
}

.date-instruction-banner {
  background-color: #2b5a88;
  color: #ffffff;
  font-size: 13px;
  font-weight: bold;
  padding: 6px 14px;
  border-radius: 2px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.date-instruction-icon {
  width: 20px;
  height: 20px;
  background-color: #ffffff;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.date-instruction-icon svg {
  width: 11px;
  height: 11px;
  fill: #2b5a88;
}

/* Two-column Layout: Left Content & Right Sidebar */
.date-main-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.date-calc-col {
  flex: 1;
  min-width: 0;
}

.date-sidebar-col {
  width: 290px;
  flex-shrink: 0;
}

@media (max-width: 860px) {
  .date-main-layout {
    flex-direction: column;
  }
  .date-sidebar-col {
    width: 100%;
  }
}

/* Section Headings */
.date-section-heading {
  font-size: 18px;
  font-weight: bold;
  color: #0b386b;
  margin: 0 0 4px 0;
}

.date-section-subtext {
  font-size: 13px;
  color: #333333;
  margin: 0 0 10px 0;
  line-height: 1.4;
}

/* Calculator Form Box */
.date-calc-box {
  background-color: #f2f4f7;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  padding: 16px 20px;
  margin-bottom: 24px;
}

.date-form-row {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.date-form-label {
  width: 100px;
  font-size: 13px;
  font-weight: normal;
  color: #333333;
  text-align: right;
  padding-right: 12px;
  flex-shrink: 0;
}

.date-input-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.date-select {
  height: 28px;
  padding: 2px 6px;
  font-size: 13px;
  border: 1px solid #7f9db9;
  border-radius: 2px;
  background-color: #ffffff;
  color: #222222;
  outline: none;
}

.date-select:focus {
  border-color: #0844a4;
  box-shadow: 0 0 3px rgba(8, 68, 164, 0.3);
}

.date-year-input {
  width: 68px;
  height: 28px;
  padding: 2px 6px;
  font-size: 13px;
  border: 1px solid #7f9db9;
  border-radius: 2px;
  background-color: #ffffff;
  color: #222222;
  text-align: center;
  outline: none;
}

.date-year-input:focus {
  border-color: #0844a4;
  box-shadow: 0 0 3px rgba(8, 68, 164, 0.3);
}

/* Calendar Button with matching red-dot grid */
.date-cal-btn {
  width: 28px;
  height: 28px;
  border: 1px solid #7f9db9;
  border-radius: 2px;
  background: #ffffff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  position: relative;
  transition: background-color 0.15s;
}

.date-cal-btn:hover {
  background-color: #f1f5f9;
}

.date-cal-icon {
  width: 22px;
  height: 22px;
  display: block;
}

.date-native-date {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

/* Checkbox Row */
.date-checkbox-row {
  display: flex;
  align-items: center;
  padding-left: 100px;
  margin-bottom: 12px;
  gap: 6px;
}

.date-checkbox-label {
  font-size: 13px;
  color: #333333;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.date-checkbox {
  margin: 0;
  cursor: pointer;
}

/* Buttons Row */
.date-btn-row {
  display: flex;
  align-items: center;
  padding-left: 100px;
  gap: 12px;
}

.date-calc-btn {
  background-color: #38761d;
  color: #ffffff;
  font-size: 13px;
  font-weight: bold;
  border: 1px solid #274e13;
  border-radius: 2px;
  padding: 6px 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.15s;
}

.date-calc-btn:hover {
  background-color: #274e13;
}

.date-btn-triangle {
  font-size: 10px;
  display: inline-block;
  transform: scale(0.9);
}

.date-settings-link {
  font-size: 13px;
  color: #0844a4;
  text-decoration: underline;
  cursor: pointer;
  font-weight: normal;
  background: none;
  border: none;
  padding: 0;
}

.date-settings-link:hover {
  color: #002277;
}

/* Add / Subtract Inputs Layout */
.date-offset-container {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.date-op-select {
  height: 28px;
  width: 44px;
  padding: 2px 4px;
  font-size: 14px;
  font-weight: bold;
  text-align: center;
  border: 1px solid #7f9db9;
  border-radius: 2px;
  background: #ffffff;
}

.date-offset-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.date-offset-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-offset-input {
  width: 76px;
  height: 26px;
  padding: 2px 6px;
  font-size: 13px;
  border: 1px solid #7f9db9;
  border-radius: 2px;
  background: #ffffff;
  text-align: center;
  outline: none;
}

.date-offset-input:focus {
  border-color: #0844a4;
  box-shadow: 0 0 3px rgba(8, 68, 164, 0.3);
}

.date-offset-unit {
  font-size: 13px;
  color: #333333;
  width: 60px;
}

/* Settings Box */
.date-settings-panel {
  background: #ffffff;
  border: 1px solid #b0c4de;
  border-radius: 4px;
  padding: 14px 16px;
  margin-top: 14px;
  font-size: 12.5px;
  color: #333333;
}

.date-settings-title {
  font-size: 13px;
  font-weight: bold;
  color: #0b386b;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.date-settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 600px) {
  .date-settings-grid {
    grid-template-columns: 1fr;
  }
  .date-form-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .date-form-label {
    text-align: left;
    padding-bottom: 4px;
    width: auto;
  }
  .date-checkbox-row,
  .date-btn-row {
    padding-left: 0;
  }
}

/* ==========================================================================
   RESULTS SECTION & VISUALIZATIONS
   ========================================================================== */

.date-result-card {
  border: 1px solid #b0c4de;
  border-radius: 4px;
  background-color: #ffffff;
  margin-bottom: 24px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.date-result-header {
  background-color: #003366;
  color: #ffffff;
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.date-result-title {
  margin: 0;
  font-size: 15px;
  font-weight: bold;
}

.date-result-body {
  padding: 18px 20px;
}

.date-primary-banner {
  background: #edf7ed;
  border: 1px solid #c8e6c9;
  border-left: 4px solid #2e7d32;
  border-radius: 3px;
  padding: 14px 16px;
  margin-bottom: 18px;
}

.date-primary-text {
  font-size: 20px;
  font-weight: bold;
  color: #1b5e20;
  margin-bottom: 4px;
}

.date-sub-text {
  font-size: 13.5px;
  color: #2e7d32;
}

/* Breakdown Table */
.date-data-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 18px;
  font-size: 13px;
}

.date-data-table th,
.date-data-table td {
  padding: 7px 10px;
  border: 1px solid #cbd5e1;
  text-align: left;
}

.date-data-table th {
  background-color: #f1f5f9;
  font-weight: bold;
  color: #334155;
  width: 40%;
}

.date-data-table td {
  color: #1e293b;
  background-color: #ffffff;
}

.date-data-table tr:hover td {
  background-color: #f8fafc;
}

/* Visual Day Breakdown & Charts */
.date-charts-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 18px;
}

@media (max-width: 680px) {
  .date-charts-container {
    grid-template-columns: 1fr;
  }
}

.date-chart-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.date-chart-title {
  font-size: 12px;
  font-weight: bold;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  align-self: flex-start;
}

.date-timeline-wrapper {
  width: 100%;
  padding: 4px 0 10px;
}

.date-timeline-track {
  height: 16px;
  background: #e2e8f0;
  border-radius: 8px;
  position: relative;
  display: flex;
  overflow: hidden;
}

.date-timeline-seg {
  height: 100%;
  transition: width 0.3s;
}

.date-timeline-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 11px;
  color: #64748b;
}

.date-legend-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 11.5px;
  color: #475569;
  margin-top: 8px;
  justify-content: center;
}

.date-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.date-legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 2px;
}

/* Actions Toolbar */
.date-actions-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
}

.date-action-btn {
  background-color: #ffffff;
  color: #0844a4;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: bold;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s;
}

.date-action-btn:hover {
  background-color: #f1f5f9;
  border-color: #94a3b8;
}

.date-action-btn svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
}

/* ==========================================================================
   SIDEBAR STYLES (Matching Image 1)
   ========================================================================== */

.date-sidebar-search {
  display: flex;
  margin-bottom: 20px;
}

.date-sidebar-search-wrap {
  position: relative;
  flex: 1;
}

.date-sidebar-search-input {
  width: 100%;
  height: 28px;
  padding: 4px 8px;
  font-size: 13px;
  border: 1px solid #7f9db9;
  border-right: none;
  border-radius: 0;
  outline: none;
  box-sizing: border-box;
}

.date-sidebar-search-input:focus {
  border-color: #0844a4;
}

.date-sidebar-search-btn {
  height: 28px;
  background-color: #2b5a88;
  color: #ffffff;
  border: 1px solid #1f4366;
  padding: 0 14px;
  font-size: 13px;
  font-weight: normal;
  cursor: pointer;
  border-radius: 0;
  white-space: nowrap;
}

.date-sidebar-search-btn:hover {
  background-color: #1f476a;
}

.date-side-card {
  border: 1px solid #2b5a88;
  border-radius: 0;
  background-color: #ffffff;
  margin-bottom: 20px;
}

.date-side-card-title {
  background-color: #2b5a88;
  color: #ffffff;
  font-size: 13px;
  font-weight: bold;
  padding: 5px 8px;
}

.date-side-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 8px 10px;
  gap: 4px 12px;
  font-size: 12px;
}

.date-side-card-grid a {
  color: #0844a4;
  text-decoration: underline;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.date-side-card-grid a:hover {
  color: #002277;
}

.date-side-card-grid a.active-link {
  font-weight: bold;
  color: #000000;
  text-decoration: none;
}

.date-side-card-footer {
  border-top: 1px solid #d0d0d0;
  padding: 6px 8px;
  font-size: 11.5px;
  color: #555555;
  background-color: #f1f1f1;
  text-align: center;
}

.date-side-card-footer a {
  color: #0844a4;
  text-decoration: none;
  margin: 0 2px;
}

.date-side-card-footer a:hover {
  text-decoration: underline;
}

.date-side-card-footer .active-cat {
  font-weight: bold;
  color: #000000;
}

/* History / Saved Drawer */
.date-history-panel {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 14px 16px;
  margin-top: 20px;
}

.date-history-title {
  font-size: 13.5px;
  font-weight: bold;
  color: #0b386b;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.date-history-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 240px;
  overflow-y: auto;
  font-size: 12px;
}

.date-history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px;
  border-bottom: 1px solid #e2e8f0;
}

.date-history-item:hover {
  background-color: #f8fafc;
}

/* ==========================================================================
   MODALS (Welcome Modal matching Image 2, Print Modal, Share Modal)
   ========================================================================== */

.date-modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 16px;
}

.date-modal-content {
  background: #ffffff;
  border-radius: 4px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #cbd5e1;
}

.date-modal-header {
  background-color: #003366;
  color: #ffffff;
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.date-modal-title {
  margin: 0;
  font-size: 15px;
  font-weight: bold;
  color: #ffffff;
}

.date-modal-close {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}

.date-modal-close:hover {
  opacity: 0.8;
}

.date-modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  flex: 1;
  background: #ffffff;
  font-size: 13.5px;
  color: #333333;
  line-height: 1.5;
}

/* Blue info box matching Image 2 */
.date-modal-info-box {
  background-color: #f0f7ff;
  border: 1px solid #b8daff;
  border-radius: 4px;
  padding: 14px 16px;
  margin: 16px 0;
  color: #1e3a8a;
  font-size: 13.5px;
  line-height: 1.5;
}

.date-modal-primary-btn {
  background-color: #2e7d32;
  color: #ffffff;
  font-size: 14px;
  font-weight: bold;
  border: 1px solid #1b5e20;
  border-radius: 4px;
  padding: 8px 16px;
  cursor: pointer;
  width: 100%;
  text-align: center;
  transition: background-color 0.15s;
}

.date-modal-primary-btn:hover {
  background-color: #1b5e20;
}

.date-modal-footer {
  padding: 12px 16px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* Printable Sheet */
.date-print-sheet {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 20px;
  font-family: Arial, sans-serif;
  color: #1e293b;
  font-size: 13px;
  line-height: 1.5;
}

.date-print-header {
  border-bottom: 2px solid #003366;
  padding-bottom: 10px;
  margin-bottom: 14px;
}

.date-print-brand {
  font-size: 18px;
  font-weight: bold;
  color: #003366;
  margin: 0 0 2px;
}

.date-print-meta {
  font-size: 11px;
  color: #64748b;
}

/* Toast */
.date-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e293b;
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  z-index: 100000;
  transition: opacity 0.2s;
  pointer-events: none;
}

/* SEO / Educational Content Styling */
.date-content-article {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid #cbd5e1;
  font-size: 13.5px;
  line-height: 1.6;
  color: #333333;
}

.date-content-article h2 {
  font-size: 18px;
  color: #0b386b;
  margin: 24px 0 10px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 4px;
}

.date-content-article h3 {
  font-size: 15px;
  color: #2b5a88;
  margin: 18px 0 6px;
}

.date-content-article p {
  margin: 0 0 12px;
}

.date-content-article ul,
.date-content-article ol {
  margin: 0 0 14px 20px;
  padding: 0;
}

.date-content-article li {
  margin-bottom: 6px;
}

/* FAQ Accordion */
.date-faq-list {
  margin-top: 14px;
}

.date-faq-item {
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  margin-bottom: 8px;
  overflow: hidden;
}

.date-faq-question {
  background-color: #f1f5f9;
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: bold;
  color: #0b386b;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.date-faq-question:hover {
  background-color: #e2e8f0;
}

.date-faq-arrow {
  transition: transform 0.2s;
  font-size: 11px;
}

.date-faq-item.open .date-faq-arrow {
  transform: rotate(180deg);
}

.date-faq-answer {
  display: none;
  padding: 12px 14px;
  background-color: #ffffff;
  font-size: 13px;
  line-height: 1.55;
  color: #334155;
  border-top: 1px solid #e2e8f0;
}

.date-faq-item.open .date-faq-answer {
  display: block;
}

/* Print Optimization */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 10pt !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* When printing from modal */
  body.date-printing-modal .site-header,
  body.date-printing-modal .site-footer,
  body.date-printing-modal .date-top-bar,
  body.date-printing-modal .date-title,
  body.date-printing-modal .date-instruction-banner,
  body.date-printing-modal .date-sidebar-col,
  body.date-printing-modal .date-btn-row,
  body.date-printing-modal .date-form-actions,
  body.date-printing-modal .date-history-panel,
  body.date-printing-modal .date-content-article,
  body.date-printing-modal .date-toast,
  body.date-printing-modal .date-modal-header,
  body.date-printing-modal .date-modal-footer,
  body.date-printing-modal .date-print-modal-tip,
  body.date-printing-modal .date-modal-close,
  body.date-printing-modal .date-calc-col,
  body.date-printing-modal #date-welcome-modal,
  body.date-printing-modal #date-share-modal {
    display: none !important;
  }

  body.date-printing-modal #date-print-modal {
    display: block !important;
    position: static !important;
    background: transparent !important;
    width: 100% !important;
    max-width: 100% !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  body.date-printing-modal .date-modal-content {
    max-width: 100% !important;
    width: 100% !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  body.date-printing-modal .date-modal-body {
    max-height: none !important;
    overflow: visible !important;
    padding: 0 !important;
  }

  body.date-printing-modal .date-print-sheet {
    padding: 0 !important;
  }

  /* When printing directly from page */
  body:not(.date-printing-modal) .site-header,
  body:not(.date-printing-modal) .date-breadcrumbs,
  body:not(.date-printing-modal) .date-top-bar,
  body:not(.date-printing-modal) .date-instruction-banner,
  body:not(.date-printing-modal) .date-sidebar-col,
  body:not(.date-printing-modal) .date-actions-toolbar,
  body:not(.date-printing-modal) .date-btn-row,
  body:not(.date-printing-modal) .date-top-actions,
  body:not(.date-printing-modal) .site-footer,
  body:not(.date-printing-modal) .date-modal-backdrop,
  body:not(.date-printing-modal) .date-toast,
  body:not(.date-printing-modal) .date-content-article {
    display: none !important;
  }

  .date-page-container {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .date-main-layout {
    display: block !important;
  }
  .date-calc-col {
    width: 100% !important;
  }
  .date-result-card {
    border: 1px solid #cccccc !important;
    box-shadow: none !important;
    page-break-inside: avoid !important;
  }
  .date-card {
    border: 1px solid #cccccc !important;
    box-shadow: none !important;
    page-break-inside: avoid !important;
  }
}
