/* ─────────────────────────────────────────────
   Time Zone Converter & Meeting Planner — Custom Styles
   Matches everyutil.com design system
   ───────────────────────────────────────────── */

/* ── Tab Navigation ── */
.tab-nav {
  display: flex;
  gap: 6px;
  background: rgba(31, 41, 55, 0.6);
  border: 1px solid rgba(75, 85, 99, 0.5);
  border-radius: 0.875rem;
  padding: 8px;
  max-width: 520px;
  margin: 0 auto;
}

.tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 20px;
  border-radius: 0.625rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: #9ca3af;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tab-btn:hover {
  color: #e5e7eb;
  background: rgba(55, 65, 81, 0.6);
}

.tab-btn.active {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 12px rgba(102, 126, 234, 0.4);
}

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

/* ── Tab Content ── */
.tab-content {
  display: none;
  animation: fadeIn 0.25s ease;
}

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

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Format Toggle ── */
.format-btn,
.mp-format-btn {
  flex: 1;
  padding: 10px 16px;
  border-radius: 0.5rem;
  border: none;
  background: transparent;
  color: #9ca3af;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 70px;
  min-height: 44px;
  touch-action: manipulation;
}

.format-btn.active,
.mp-format-btn.active {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.format-btn:hover:not(.active),
.mp-format-btn:hover:not(.active) {
  color: #e5e7eb;
  background: rgba(107, 114, 128, 0.4);
}

.format-btn:active,
.mp-format-btn:active {
  transform: scale(0.97);
}

/* ── Timezone Search ── */
.tz-search-wrapper {
  position: relative;
}

.tz-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #d1d5db;
  font-size: 0.85rem;
  pointer-events: none;
  z-index: 2;
}

.tz-search-wrapper .input-field {
  padding-left: 36px !important;
}

.tz-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 0.5rem;
  max-height: 220px;
  overflow-y: auto;
  z-index: 100;
  display: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

.tz-dropdown.open {
  display: block;
}

/* Custom scrollbar for dropdown */
.tz-dropdown::-webkit-scrollbar {
  width: 6px;
}
.tz-dropdown::-webkit-scrollbar-track {
  background: #1f2937;
  border-radius: 3px;
}
.tz-dropdown::-webkit-scrollbar-thumb {
  background: #4b5563;
  border-radius: 3px;
}

.tz-option {
  padding: 9px 14px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.1s ease;
  border-bottom: 1px solid rgba(55, 65, 81, 0.5);
}

.tz-option:last-child {
  border-bottom: none;
}

.tz-option:hover,
.tz-option.highlighted {
  background: rgba(102, 126, 234, 0.2);
}

.tz-option-city {
  font-size: 0.9rem;
  color: #e5e7eb;
  font-weight: 500;
}

.tz-option-country {
  font-size: 0.75rem;
  color: #6b7280;
}

.tz-option-tz {
  font-size: 0.75rem;
  color: #9ca3af;
  margin-left: auto;
  padding-left: 12px;
  white-space: nowrap;
}

.tz-option-offset {
  font-size: 0.75rem;
  color: #60a5fa;
  font-weight: 600;
  min-width: 48px;
  text-align: right;
}

.tz-no-results {
  padding: 12px 14px;
  color: #6b7280;
  font-size: 0.875rem;
  text-align: center;
}

/* ── Selected Timezone Display ── */
.selected-tz {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 0.5rem;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.selected-label {
  color: #6b7280;
}

.selected-city {
  color: #e5e7eb;
}

.selected-offset {
  color: #60a5fa;
}

/* ── Results Table ── */
.results-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.result-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: rgba(31, 41, 55, 0.6);
  border: 1px solid rgba(75, 85, 99, 0.4);
  border-radius: 0.75rem;
  transition: all 0.2s ease;
}

.result-row:hover {
  background: rgba(55, 65, 81, 0.5);
  border-color: rgba(102, 126, 234, 0.3);
}

.result-row-base {
  background: rgba(102, 126, 234, 0.12);
  border-color: rgba(102, 126, 234, 0.4);
}

.result-row-base:hover {
  background: rgba(102, 126, 234, 0.18);
}

.result-location {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.result-city {
  font-size: 1.1rem;
  font-weight: 600;
  color: #f3f4f6;
  display: flex;
  align-items: center;
}

.result-city i {
  color: #60a5fa;
}

.result-tz {
  font-size: 0.85rem;
  color: #9ca3af;
  font-variant-numeric: tabular-nums;
}

.utc-offset {
  color: #60a5fa;
  font-weight: 600;
}

.result-time-block {
  text-align: center;
  min-width: 100px;
}

.result-time {
  font-size: 1.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #ffffff;
  line-height: 1.2;
}

.result-date {
  font-size: 0.8rem;
  color: #9ca3af;
  margin-top: 2px;
}

.result-dst {
  display: flex;
  align-items: center;
}

.dst-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}

.dst-badge.dst {
  background: rgba(234, 179, 8, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(234, 179, 8, 0.4);
}

.dst-badge.no-dst {
  background: rgba(107, 114, 128, 0.15);
  color: #9ca3af;
  border: 1px solid rgba(107, 114, 128, 0.3);
}

/* ── Legacy Results Table (fallback) ── */
.results-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 4px;
}

.results-table th {
  text-align: left;
  padding: 8px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid rgba(75, 85, 99, 0.5);
}

.results-table td {
  padding: 10px 12px;
  font-size: 0.9rem;
  color: #e5e7eb;
  border-bottom: 1px solid rgba(55, 65, 81, 0.3);
  vertical-align: middle;
}

.results-table tr:last-child td {
  border-bottom: none;
}

.results-table tr.base-row td {
  background: rgba(102, 126, 234, 0.08);
  border-radius: 4px;
}

.results-table tr:hover td {
  background: rgba(75, 85, 99, 0.15);
}

.tz-name-cell {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.tz-city-name {
  font-weight: 600;
  color: #e5e7eb;
}

.tz-tz-name {
  font-size: 0.7rem;
  color: #6b7280;
  font-family: monospace;
}

.time-cell {
  font-size: 1.05rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.date-cell {
  font-size: 0.8rem;
  color: #9ca3af;
}

/* ── Meeting Planner Timeline ── */
.timeline-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.timeline-table th {
  padding: 8px 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
  border-bottom: 1px solid rgba(75, 85, 99, 0.5);
  white-space: nowrap;
}

.timeline-table th:first-child {
  text-align: left;
  padding-left: 0;
}

.timeline-table td {
  padding: 5px 6px;
  text-align: center;
  border-bottom: 1px solid rgba(55, 65, 81, 0.25);
  vertical-align: middle;
}

.timeline-table td:first-child {
  text-align: left;
  padding-left: 0;
  color: #9ca3af;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  min-width: 60px;
}

.timeline-table tr:last-child td {
  border-bottom: none;
}

/* Hour cell states */
.hour-cell {
  width: 44px;
  height: 32px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 600;
}

.hour-all-green {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.hour-mostly-green {
  background: rgba(34, 197, 94, 0.12);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.hour-some-yellow {
  background: rgba(234, 179, 8, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(234, 179, 8, 0.3);
}

.hour-some-red {
  background: rgba(249, 115, 22, 0.15);
  color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.3);
}

.hour-all-red {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.hour-na {
  background: rgba(107, 114, 128, 0.1);
  color: #6b7280;
  border: 1px solid rgba(107, 114, 128, 0.2);
  font-size: 0.65rem;
}

/* Per-participant status dot */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 3px;
}

.dot-green  { background: #4ade80; }
.dot-yellow { background: #fbbf24; }
.dot-red    { background: #f87171; }

/* ── Meeting Summary ── */
.summary-grid {
  display: grid;
  gap: 10px;
}

.summary-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(31, 41, 55, 0.6);
  border-radius: 0.5rem;
  border: 1px solid rgba(75, 85, 99, 0.4);
}

.summary-item.best {
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.08);
}

.summary-time {
  font-size: 1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.summary-label {
  font-size: 0.8rem;
  color: #9ca3af;
  margin-left: auto;
}

.summary-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tag-best {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.tag-ok {
  background: rgba(234, 179, 8, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(234, 179, 8, 0.3);
}

/* ── Details Grid ── */
.details-grid {
  display: grid;
  gap: 8px;
}

.detail-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(31, 41, 55, 0.6);
  border-radius: 0.5rem;
  border: 1px solid rgba(75, 85, 99, 0.4);
}

.detail-card-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.detail-info {
  flex: 1;
}

.detail-city {
  font-weight: 600;
  font-size: 0.95rem;
  color: #e5e7eb;
}

.detail-tz {
  font-size: 0.72rem;
  color: #6b7280;
  font-family: monospace;
}

.detail-time-wrap {
  text-align: right;
}

.detail-time {
  font-size: 1.1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #f3f4f6;
}

.detail-date {
  font-size: 0.75rem;
  color: #9ca3af;
}

/* ── Meeting Date — white calendar picker icon ── */
#mp-date::-webkit-calendar-picker-indicator {
  filter: invert(1);
  cursor: pointer;
}

/* ── Save to Calendar Button ── */
#mp-save-calendar-btn {
  transition: all 0.2s ease;
}

#mp-save-calendar-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* ── Responsive tweaks ── */
@media (max-width: 640px) {
  /* Stack Now button below date/time on mobile so native pickers have room */
  .tc-now-wrapper {
    width: 100%;
    flex-shrink: unset;
    flex-basis: 100%;
  }

  .tc-now-wrapper .btn-secondary {
    width: 100%;
    justify-content: center;
  }

  .tab-nav {
    max-width: 100%;
    gap: 4px;
    padding: 6px;
  }

  .tab-btn {
    padding: 12px 8px;
    font-size: 0.8rem;
    gap: 6px;
    flex-direction: column;
  }

  .tab-btn i {
    font-size: 1.1rem;
    display: block;
  }

  .tab-btn span {
    display: block;
    font-size: 0.75rem;
  }

  .format-btn,
  .mp-format-btn {
    padding: 12px 12px;
    font-size: 0.9rem;
    min-width: 60px;
  }

  .results-table th:nth-child(3),
  .results-table td:nth-child(3) {
    display: none;
  }

  .result-row {
    grid-template-columns: 1fr auto;
    gap: 10px;
    text-align: left;
    padding: 14px 16px;
  }

  .result-location {
    align-items: flex-start;
    grid-column: 1;
  }

  .result-time-block {
    grid-column: 2;
    grid-row: 1;
    min-width: auto;
    text-align: right;
  }

  .result-time {
    font-size: 1.5rem;
  }

  .result-dst {
    grid-column: 1 / -1;
    justify-content: flex-start;
    padding-top: 8px;
    border-top: 1px solid rgba(75, 85, 99, 0.3);
    margin-top: 8px;
  }

  .detail-card {
    flex-wrap: wrap;
    gap: 10px;
  }

  .detail-time-wrap {
    width: 100%;
    text-align: left;
    padding-left: 40px;
  }

  .summary-item {
    flex-wrap: wrap;
    gap: 8px;
  }

  .summary-time {
    font-size: 0.9rem;
  }

  .summary-label {
    width: 100%;
    margin-left: 0;
    font-size: 0.75rem;
  }

  .timeline-table {
    font-size: 0.7rem;
  }

  .hour-cell {
    width: 36px;
    height: 28px;
  }
}
