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

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

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

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

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

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

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

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

.time-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.time-top-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;
  gap: 5px;
  font-family: inherit;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.time-top-btn:hover {
  background: #f0f4f8;
  border-color: #0b386b;
  color: #0b386b;
}

.time-top-btn svg {
  width: 13px;
  height: 13px;
}

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

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

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

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

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

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

.time-section-heading:first-of-type {
  margin-top: 0;
}

.time-section-subtext {
  font-size: 13px;
  color: #333333;
  margin: 0 0 12px 0;
  line-height: 1.45;
}

.time-section-subtext a {
  color: #0844a4;
  text-decoration: underline;
}

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

/* Mode 1 Table Layout */
.time-mode1-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 480px;
  margin: 0 auto;
}

.time-grid-headers {
  display: grid;
  grid-template-columns: repeat(4, 80px);
  gap: 12px;
  text-align: center;
  font-size: 13px;
  font-weight: bold;
  color: #333333;
  margin-bottom: 6px;
}

.time-grid-row {
  display: grid;
  grid-template-columns: repeat(4, 80px);
  gap: 12px;
}

.time-grid-input {
  width: 100%;
  height: 28px;
  padding: 4px 6px;
  border: 1px solid #7f9db9;
  border-radius: 2px;
  font-size: 14px;
  font-family: Arial, sans-serif;
  text-align: center;
  background-color: #ffffff;
}

.time-grid-input:focus {
  outline: 2px solid #5c9038;
  outline-offset: -1px;
}

.time-grid-input.readonly-output {
  background-color: #f8fafc;
  color: #0b386b;
  font-weight: bold;
  border: 1px solid #94a3b8;
}

.time-radio-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin: 10px 0;
  font-size: 13px;
  color: #333333;
}

.time-radio-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  user-select: none;
}

.time-equal-row {
  font-size: 20px;
  font-weight: bold;
  color: #333333;
  text-align: center;
  margin: 8px 0;
  line-height: 1;
}

/* Button Group */
.time-button-group {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.time-calc-btn {
  background: linear-gradient(to bottom, #5c9038 0%, #4a7c2d 100%);
  color: #ffffff;
  border: 1px solid #3d6923;
  border-radius: 3px;
  font-size: 13px;
  font-weight: bold;
  padding: 6px 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.time-calc-btn:hover {
  background: linear-gradient(to bottom, #4f802f 0%, #3d6923 100%);
}

.time-calc-btn svg, .time-calc-btn .play-icon {
  font-size: 11px;
  line-height: 1;
}

.time-clear-btn {
  background: linear-gradient(to bottom, #f0f0f0 0%, #e0e0e0 100%);
  color: #444444;
  border: 1px solid #b0b0b0;
  border-radius: 3px;
  font-size: 13px;
  font-weight: normal;
  padding: 6px 14px;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.time-clear-btn:hover {
  background: linear-gradient(to bottom, #e4e4e4 0%, #d4d4d4 100%);
  color: #222222;
}

.time-print-btn {
  background: #ffffff;
  color: #0844a4;
  border: 1px solid #7f9db9;
  border-radius: 3px;
  font-size: 13px;
  font-weight: bold;
  padding: 6px 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: inherit;
}

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

/* Mode 2 (Date + Time) Form */
.time-date-form {
  max-width: 520px;
  margin: 0 auto;
}

.time-start-row {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.time-start-label {
  width: 90px;
  font-size: 13px;
  color: #333333;
  text-align: right;
  padding-right: 10px;
  flex-shrink: 0;
}

.time-date-inputs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.time-select {
  height: 28px;
  padding: 2px 4px;
  border: 1px solid #7f9db9;
  border-radius: 2px;
  font-size: 13px;
  background-color: #ffffff;
}

.time-year-input {
  width: 60px;
  height: 28px;
  padding: 2px 6px;
  border: 1px solid #7f9db9;
  border-radius: 2px;
  font-size: 13px;
  text-align: center;
}

.time-cal-btn {
  background: #ffffff;
  border: 1px solid #7f9db9;
  border-radius: 2px;
  padding: 3px 6px;
  height: 28px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.time-cal-btn:hover {
  background: #f0f4f8;
}

.time-clock-inputs {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 13px;
}

.time-small-input {
  width: 36px;
  height: 28px;
  padding: 2px;
  border: 1px solid #7f9db9;
  border-radius: 2px;
  font-size: 13px;
  text-align: center;
}

.time-now-link {
  color: #0844a4;
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
  margin-left: 6px;
}

.time-now-link:hover {
  color: #0b386b;
}

/* Mode 3 (Expression) */
.time-expr-box {
  max-width: 520px;
  margin: 0 auto;
}

.time-expr-textarea {
  width: 100%;
  height: 80px;
  padding: 8px 10px;
  border: 1px solid #7f9db9;
  border-radius: 2px;
  font-family: "Courier New", Courier, monospace, Arial;
  font-size: 14px;
  line-height: 1.4;
  resize: vertical;
  background-color: #ffffff;
}

.time-expr-textarea:focus {
  outline: 2px solid #5c9038;
  outline-offset: -1px;
}

/* Results Display Container */
.time-result-panel {
  display: none;
  background-color: #ffffff;
  border: 1px solid #b4cee8;
  border-radius: 4px;
  padding: 16px 20px;
  margin-bottom: 24px;
  box-shadow: 0 2px 6px rgba(11, 56, 107, 0.08);
}

.time-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #003366;
  padding-bottom: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.time-result-title {
  font-size: 18px;
  font-weight: bold;
  color: #003366;
  margin: 0;
}

.time-result-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.time-result-banner {
  background-color: #eaf2fa;
  border-left: 4px solid #2b5a88;
  padding: 12px 16px;
  margin-bottom: 16px;
  border-radius: 0 4px 4px 0;
}

.time-result-primary {
  font-size: 22px;
  font-weight: bold;
  color: #0b386b;
  margin: 0 0 4px 0;
}

.time-result-secondary {
  font-size: 14px;
  color: #475569;
  margin: 0;
}

.time-data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 13px;
}

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

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

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

/* Visual Charts & Visualizers */
.time-visual-card {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 14px;
  margin: 16px 0;
}

.time-visual-title {
  font-size: 14px;
  font-weight: bold;
  color: #0b386b;
  margin: 0 0 10px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.time-chart-svg {
  width: 100%;
  max-width: 480px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.time-timeline-bar {
  display: flex;
  height: 24px;
  border-radius: 4px;
  overflow: hidden;
  margin: 10px 0;
  border: 1px solid #cbd5e1;
}

.time-timeline-segment {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: bold;
  color: #ffffff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.4);
  transition: width 0.3s ease;
}

.time-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  font-size: 12px;
  margin-top: 8px;
}

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

.time-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

/* Related Calculators Bar */
.time-related-bar {
  background-color: #e6ebf0;
  border-radius: 3px;
  padding: 10px 16px;
  margin: 24px 0 28px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.time-related-title {
  font-size: 13px;
  font-weight: bold;
  color: #333333;
  margin: 0;
}

.time-related-btn {
  background-color: #2b5a88;
  color: #ffffff;
  border: 1px solid #1b4772;
  border-radius: 3px;
  font-size: 12px;
  font-weight: normal;
  padding: 5px 12px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: background-color 0.15s ease;
}

.time-related-btn:hover {
  background-color: #1b4772;
  color: #ffffff;
  text-decoration: none;
}

/* Common Units of Time Table (Pixel Clone) */
.time-units-table-container {
  margin: 16px 0 32px 0;
  overflow-x: auto;
}

.time-units-table {
  width: 100%;
  max-width: 550px;
  border-collapse: collapse;
  font-size: 12px;
  color: #333333;
}

.time-units-table th, .time-units-table td {
  border: 1px solid #b0b0b0;
  padding: 5px 8px;
  vertical-align: top;
}

.time-units-table th {
  background-color: #2b5a88;
  color: #ffffff;
  font-weight: bold;
  text-align: left;
}

.time-units-table th:first-child {
  width: 130px;
}

.time-units-table tr:nth-child(even) {
  background-color: #f7f9fb;
}

/* Sidebar Styling */
.time-sidebar-card {
  border: 1px solid #9bb5cf;
  border-radius: 3px;
  margin-bottom: 20px;
  overflow: hidden;
  background-color: #ffffff;
}

.time-sidebar-header {
  background-color: #2b5a88;
  color: #ffffff;
  font-size: 13px;
  font-weight: bold;
  padding: 6px 12px;
}

.time-sidebar-search-box {
  display: flex;
  margin-bottom: 16px;
}

.time-sidebar-search-input {
  flex: 1;
  height: 28px;
  padding: 4px 8px;
  border: 1px solid #7f9db9;
  border-right: none;
  font-size: 13px;
}

.time-sidebar-search-btn {
  background-color: #2b5a88;
  color: #ffffff;
  border: 1px solid #2b5a88;
  padding: 0 12px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
}

.time-sidebar-search-btn:hover {
  background-color: #1f4366;
}

.time-sidebar-links-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 10px 14px;
  gap: 6px 14px;
  font-size: 12px;
}

.time-sidebar-links-grid a {
  color: #0844a4;
  text-decoration: underline;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.time-sidebar-links-grid a:hover {
  color: #0b386b;
}

.time-sidebar-links-grid a.active {
  font-weight: bold;
  color: #0b386b;
  text-decoration: none;
}

.time-sidebar-footer-links {
  border-top: 1px solid #e2e8f0;
  padding: 8px 12px;
  font-size: 11px;
  text-align: center;
  color: #64748b;
  background-color: #f8fafc;
}

.time-sidebar-footer-links a {
  color: #0844a4;
  text-decoration: none;
}

.time-sidebar-footer-links a:hover {
  text-decoration: underline;
}

/* Welcome Modal (Image 1 Clone) */
.time-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.time-modal-dialog {
  background: #ffffff;
  width: 100%;
  max-width: 520px;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  animation: timeFadeIn 0.2s ease-out;
}

@keyframes timeFadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

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

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

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

.time-modal-close-btn:hover {
  opacity: 0.8;
}

.time-modal-body {
  padding: 20px 24px;
  font-size: 14px;
  line-height: 1.5;
  color: #333333;
}

.time-modal-welcome-card {
  background-color: #f0f7ff;
  border: 1px solid #cfe2ff;
  border-radius: 4px;
  padding: 14px 18px;
  margin: 16px 0;
  color: #1e3a8a;
  font-size: 13.5px;
  line-height: 1.5;
}

.time-modal-footer {
  padding: 0 24px 20px;
  text-align: center;
}

.time-modal-action-btn {
  width: 100%;
  background-color: #2b7d2b;
  color: #ffffff;
  font-size: 15px;
  font-weight: bold;
  padding: 10px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.time-modal-action-btn:hover {
  background-color: #236823;
}

/* History Drawer / Panel */
.time-history-panel {
  display: none;
  background-color: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 16px;
  margin-bottom: 24px;
}

.time-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 6px;
}

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

.time-history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 12.5px;
}

.time-history-item:hover {
  background-color: #f1f5f9;
}

/* Toast Notifications */
.time-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #1e293b;
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.time-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Print Media Queries */
@media print {
  body.time-printing-modal .site-header,
  body.time-printing-modal .site-footer,
  body.time-printing-modal .time-top-bar,
  body.time-printing-modal .time-instruction-banner,
  body.time-printing-modal .time-calc-col,
  body.time-printing-modal .time-sidebar-col,
  body.time-printing-modal .time-related-bar,
  body.time-printing-modal .time-units-table-container,
  body.time-printing-modal .time-seo-article,
  body.time-printing-modal .time-modal-header,
  body.time-printing-modal .no-print {
    display: none !important;
  }

  body.time-printing-modal .time-modal-overlay {
    position: static !important;
    background: transparent !important;
    padding: 0 !important;
    display: block !important;
  }

  body.time-printing-modal .time-modal-dialog {
    max-width: 100% !important;
    box-shadow: none !important;
    border: none !important;
  }

  @page {
    size: portrait;
    margin: 12mm;
  }
}
