/*
 * Design System - Modals
 *
 * Modal overlays and content
 */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(58, 58, 58, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: var(--paper-bg);
  border: 2px solid var(--parchment-dark);
  border-radius: var(--border-radius);
  padding: var(--space-lg);
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  position: relative;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-base);
  padding-bottom: var(--space-base);
  border-bottom: 1px solid var(--parchment);
}

.modal-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  margin: 0;
}

.modal-body {
  margin-bottom: var(--space-base);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  padding-top: var(--space-base);
  border-top: 1px solid var(--parchment);
}

/* ============================================
   Inbox Modal - Day Block Aesthetic
   ============================================ */

.inbox-modal-content {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(250, 245, 237, 0.9) 100%);
  border: 2px solid var(--parchment);
  border-radius: 12px;
  padding: var(--space-xl);
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  position: relative;
}

/* Close button positioned in top-right corner */
.inbox-modal-content .btn-close {
  position: absolute;
  top: var(--space-base);
  right: var(--space-base);
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--parchment);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  line-height: 1;
  padding: 0;
  color: var(--ink-medium);
  cursor: pointer;
  transition: all 0.2s ease;
}

.inbox-modal-content .btn-close:hover {
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink-dark);
  transform: scale(1.05);
}

.inbox-modal-title {
  font-family: var(--font-accent);
  font-size: 36px;
  color: var(--ink-dark);
  margin: 0 0 var(--space-lg) 0;
  letter-spacing: 0.5px;
}

.inbox-title-input {
  width: 100%;
  padding: var(--space-base);
  border: 2px solid var(--parchment);
  border-radius: 8px;
  font-size: var(--font-size-lg);
  font-family: var(--font-body);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink-dark);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.inbox-title-input:focus {
  outline: none;
  border-color: var(--parchment-dark);
  background: rgba(255, 255, 255, 1);
}

.inbox-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  padding-top: var(--space-lg);
  margin-top: var(--space-lg);
  border-top: 2px solid rgba(255, 255, 255, 0.5);
}

/* ============================================
   Time Estimate Slider - Chunky & Fun
   ============================================ */

.time-estimate-slider-container {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-base);
  background: rgba(255, 255, 255, 0.6);
  border-radius: 12px;
  border: 2px solid var(--parchment-light);
}

.time-estimate-slider {
  flex: 1;
  height: 24px;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  outline: none;
  cursor: pointer;
}

/* Track */
.time-estimate-slider::-webkit-slider-runnable-track {
  width: 100%;
  height: 24px;
  background: linear-gradient(
    to right,
    var(--slider-fill-color, var(--upcoming-3)) 0%,
    var(--slider-fill-color, var(--upcoming-3)) calc(var(--slider-fill-percentage, 50%) + 1px),
    rgba(255, 255, 255, 0.8) calc(var(--slider-fill-percentage, 50%) + 1px),
    rgba(255, 255, 255, 0.8) 100%
  );
  border: 2px solid var(--slider-fill-color, var(--upcoming-3));
  border-radius: 12px;
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.1),
    0 1px 0 rgba(255, 255, 255, 0.5);
  transition: border-color 0.2s ease;
}

.time-estimate-slider::-moz-range-track {
  width: 100%;
  height: 24px;
  background: rgba(255, 255, 255, 0.8);
  border: 2px solid var(--slider-fill-color, var(--upcoming-3));
  border-radius: 12px;
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.1),
    0 1px 0 rgba(255, 255, 255, 0.5);
  transition: border-color 0.2s ease;
}

.time-estimate-slider::-moz-range-progress {
  height: 24px;
  background: var(--slider-fill-color, var(--upcoming-3));
  border-radius: 12px 0 0 12px;
}

/* Thumb */
.time-estimate-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 40px;
  height: 40px;
  background: var(--slider-fill-color, var(--upcoming-3));
  border: none;
  border-radius: 50%;
  cursor: grab;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  margin-top: -8px;
  transition: transform 0.1s ease, background 0.2s ease;
}

.time-estimate-slider::-moz-range-thumb {
  width: 40px;
  height: 40px;
  background: var(--slider-fill-color, var(--upcoming-3));
  border: none;
  border-radius: 50%;
  cursor: grab;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: transform 0.1s ease, background 0.2s ease;
}

.time-estimate-slider:active::-webkit-slider-thumb {
  cursor: grabbing;
  transform: scale(1.1);
}

.time-estimate-slider:active::-moz-range-thumb {
  cursor: grabbing;
  transform: scale(1.1);
}

/* Display label */
.time-estimate-display {
  min-width: 120px;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--ink-dark);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
