/* ======================================= */
/* WERELDKLOK - MODERN UNIFIED             */
/* ======================================= */

/* ===== COLOR DEFINITIONS ===== */
.world-clock-card {
  --world-clock-bg-card: var(--secondary-bg);
  --world-clock-bg-input: var(--primary-bg);
  --world-clock-bg-form: var(--secondary-bg);
  --world-clock-border: var(--border-color);
  --world-clock-text: var(--text-primary);
  --world-clock-text-secondary: var(--text-secondary);
  --world-clock-button-bg: var(--link-color);
  --world-clock-button-text: var(--text-primary);
  --world-clock-button-border: var(--border-color);
  --world-clock-button-hover-border: var(--link-color);
  --world-clock-button-hover-shadow: rgba(88, 166, 255, 0.2);
  --world-clock-accent-blue: #3b82f6;
  --world-clock-overlay-dark: rgba(255, 255, 255, 0.05);
  --world-clock-overlay-medium: rgba(255, 255, 255, 0.08);
  --world-clock-border-dark: rgba(45, 55, 72, 0.5);
  --world-clock-focus-border: var(--link-color);
  --world-clock-focus-shadow: rgba(88, 166, 255, 0.1);
  --world-clock-dropdown-bg: #1e2736;
  --world-clock-dropdown-hover: rgba(59, 130, 246, 0.15);
  --world-clock-dropdown-active: rgba(59, 130, 246, 0.3);
  --world-clock-night-bg: rgba(30, 40, 70, 0.4);
  --world-clock-day-bg: rgba(250, 200, 60, 0.08);
  --world-clock-dawn-bg: rgba(255, 150, 80, 0.08);
  --world-clock-dusk-bg: rgba(180, 80, 200, 0.08);
  --world-clock-diff-ahead: #10b981;
  --world-clock-diff-behind: #f59e0b;
  --world-clock-diff-same: #6b7280;
}

:root.light-mode .world-clock-card {
  --world-clock-bg-card: #ffffff;
  --world-clock-bg-input: #ffffff;
  --world-clock-bg-form: #f9fafb;
  --world-clock-border: #d0d7de;
  --world-clock-text: #24292f;
  --world-clock-text-secondary: #57606a;
  --world-clock-button-bg: #ffffff;
  --world-clock-button-text: #24292f;
  --world-clock-button-border: #d0d7de;
  --world-clock-button-hover-border: #0969da;
  --world-clock-button-hover-shadow: rgba(9, 105, 218, 0.15);
  --world-clock-accent-blue: #3b82f6;
  --world-clock-overlay-dark: #f9fafb;
  --world-clock-overlay-medium: #f3f4f6;
  --world-clock-border-dark: #d0d7de;
  --world-clock-focus-border: #0969da;
  --world-clock-focus-shadow: rgba(9, 105, 218, 0.1);
  --world-clock-dropdown-bg: #ffffff;
  --world-clock-dropdown-hover: rgba(9, 105, 218, 0.08);
  --world-clock-dropdown-active: rgba(9, 105, 218, 0.18);
  --world-clock-night-bg: rgba(100, 120, 200, 0.08);
  --world-clock-day-bg: rgba(250, 200, 60, 0.1);
  --world-clock-dawn-bg: rgba(255, 150, 80, 0.1);
  --world-clock-dusk-bg: rgba(180, 80, 200, 0.1);
  --world-clock-diff-ahead: #059669;
  --world-clock-diff-behind: #d97706;
  --world-clock-diff-same: #6b7280;
}

/* ===== MAIN CARD ===== */
.world-clock-card {
  max-width: 1000px;
  margin: 0 auto;
  padding: 1.25rem;
  background: var(--world-clock-bg-card);
  border: 1px solid var(--world-clock-border);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  color: var(--world-clock-text);
  position: relative;
  overflow: visible; /* nodig voor dropdown overflow */
  box-sizing: border-box;
}

.world-clock-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--world-clock-accent-blue), #2563eb, var(--world-clock-accent-blue));
  background-size: 200% 100%;
  animation: worldClockGradientShift 3s ease infinite;
  border-radius: 12px 12px 0 0;
}

@keyframes worldClockGradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ===== HEADER ===== */
.world-clock-card h1 {
  color: var(--world-clock-text);
  font-size: 1.6rem;
  margin-bottom: 1rem;
  text-align: center;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.world-clock-card .intro {
  text-align: center;
  color: var(--world-clock-text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  line-height: 1.6;
  font-weight: 400;
}

/* ===== CITY SELECTION WRAPPER ===== */
.world-clock-card .city-selection-wrapper {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  align-items: center;
  gap: 15px;
  background: var(--world-clock-bg-form);
  border: 1px solid var(--world-clock-border);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 0.75rem;
  transition: border-color 0.3s ease;
  position: relative;
  z-index: 10;
}

.world-clock-card .city-selection-wrapper:hover {
  border-color: var(--world-clock-button-hover-border);
}

.world-clock-card .city-selection-wrapper label {
  font-weight: 600;
  color: var(--world-clock-text);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  white-space: nowrap;
}

/* ===== ZOEKGROEP + DROPDOWN ===== */
.world-clock-card .city-search-group {
  flex: 1 1 280px;
  position: relative;
}

.world-clock-card .city-search-input {
  width: 100%;
  background: var(--world-clock-bg-input);
  border: 2px solid var(--world-clock-border);
  border-radius: 8px;
  color: var(--world-clock-text);
  font-size: 0.9rem;
  padding: 0.6rem 0.8rem;
  cursor: text;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
  box-sizing: border-box;
}

.world-clock-card .city-search-input:hover {
  border-color: var(--world-clock-button-hover-border);
}

.world-clock-card .city-search-input:focus {
  outline: none;
  border-color: var(--world-clock-focus-border);
  box-shadow: 0 0 0 3px var(--world-clock-focus-shadow);
}

.world-clock-card .city-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--world-clock-dropdown-bg);
  border: 1px solid var(--world-clock-border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  max-height: 220px;
  overflow-y: auto;
  z-index: 999;
  scrollbar-width: thin;
}

.world-clock-card .city-dropdown.open {
  display: block;
}

.world-clock-card .city-dropdown-item {
  padding: 0.55rem 0.8rem;
  font-size: 0.875rem;
  color: var(--world-clock-text);
  cursor: pointer;
  transition: background 0.15s ease;
  border-radius: 4px;
  margin: 2px 4px;
}

.world-clock-card .city-dropdown-item:hover,
.world-clock-card .city-dropdown-item.active {
  background: var(--world-clock-dropdown-active);
  color: var(--world-clock-accent-blue);
}

.world-clock-card .city-dropdown-empty {
  padding: 0.75rem;
  text-align: center;
  color: var(--world-clock-text-secondary);
  font-size: 0.875rem;
  font-style: italic;
}

/* ===== TOEVOEG-KNOP ===== */
.world-clock-card #addCityBtn {
  padding: 0.6rem 1.4rem;
  border: 2px solid var(--world-clock-accent-blue);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--world-clock-accent-blue);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.world-clock-card #addCityBtn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
  pointer-events: none;
}

.world-clock-card #addCityBtn:hover::before {
  width: 300px;
  height: 300px;
}

.world-clock-card #addCityBtn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
  opacity: 0.9;
}

.world-clock-card #addCityBtn:active {
  transform: translateY(0);
}

/* ===== 12/24U TOGGLE BAR ===== */
.world-clock-card .time-format-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-right: 0.25rem;
}

.world-clock-card .toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--world-clock-text-secondary);
  user-select: none;
}

.world-clock-card .toggle-switch {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.world-clock-card .toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.world-clock-card .toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--world-clock-border);
  border-radius: 22px;
  transition: background 0.25s ease;
  cursor: pointer;
}

.world-clock-card .toggle-slider::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.25s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.world-clock-card .toggle-switch input:checked + .toggle-slider {
  background: var(--world-clock-accent-blue);
}

.world-clock-card .toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(18px);
}

/* ===== KLOKKEN CONTAINER ===== */
.world-clock-card .clocks-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.world-clock-card .no-clocks-message {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--world-clock-text-secondary);
  font-style: italic;
  background: var(--world-clock-bg-form);
  border: 2px dashed var(--world-clock-border);
  border-radius: 12px;
  padding: 1rem;
}

/* ===== KLOK ITEM ===== */
.world-clock-card .clock-item {
  position: relative;
  background: var(--world-clock-bg-form);
  border: 2px solid var(--world-clock-border);
  border-radius: 12px;
  padding: 1.25rem 1rem 1rem;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
  cursor: default;
}

.world-clock-card .clock-item:hover {
  border-color: var(--world-clock-button-hover-border);
  box-shadow: 0 4px 12px var(--world-clock-button-hover-shadow);
  transform: translateY(-2px);
}

/* Dag/nacht kleur-tinting per kaart */
.world-clock-card .clock-item:has(.day-night-indicator.night) {
  background: color-mix(in srgb, var(--world-clock-bg-form) 85%, var(--world-clock-night-bg));
}
.world-clock-card .clock-item:has(.day-night-indicator.day) {
  background: color-mix(in srgb, var(--world-clock-bg-form) 92%, var(--world-clock-day-bg));
}
.world-clock-card .clock-item:has(.day-night-indicator.dawn) {
  background: color-mix(in srgb, var(--world-clock-bg-form) 92%, var(--world-clock-dawn-bg));
}
.world-clock-card .clock-item:has(.day-night-indicator.dusk) {
  background: color-mix(in srgb, var(--world-clock-bg-form) 92%, var(--world-clock-dusk-bg));
}

/* ===== DRAG HANDLE ===== */
.world-clock-card .drag-handle {
  position: absolute;
  top: 8px;
  left: 10px;
  font-size: 1.1rem;
  color: var(--world-clock-text-secondary);
  cursor: grab;
  opacity: 0.35;
  transition: opacity 0.2s ease;
  line-height: 1;
  user-select: none;
}

.world-clock-card .clock-item:hover .drag-handle {
  opacity: 0.75;
}

.world-clock-card .drag-handle:active {
  cursor: grabbing;
}

/* Drag-states */
.world-clock-card .clock-item.dragging {
  opacity: 0.45;
  transform: scale(0.97);
  border-color: var(--world-clock-accent-blue);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.3);
}

.world-clock-card .clock-item.drag-over {
  border-color: var(--world-clock-accent-blue);
  background: color-mix(in srgb, var(--world-clock-bg-form) 80%, rgba(59, 130, 246, 0.15));
}

/* ===== DAG/NACHT INDICATOR ===== */
.world-clock-card .day-night-indicator {
  font-size: 1.4rem;
  margin-bottom: 0.35rem;
  line-height: 1;
  display: block;
}

/* ===== STADSNAAM ===== */
.world-clock-card .city-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--world-clock-accent-blue);
  margin-bottom: 0.4rem;
  padding: 0 32px;
  line-height: 1.3;
}

/* ===== TIJD ===== */
.world-clock-card .current-time {
  font-family: 'Courier New', monospace;
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--world-clock-text);
  margin-bottom: 0.4rem;
  letter-spacing: 1px;
}

/* ===== TIMEZONE INFO (UTC offset) ===== */
.world-clock-card .timezone-info {
  font-size: 0.8rem;
  color: var(--world-clock-text-secondary);
  margin-bottom: 0.2rem;
  font-variant-numeric: tabular-nums;
}

/* ===== DATUM ===== */
.world-clock-card .date-info {
  font-size: 0.88rem;
  color: var(--world-clock-text);
  margin-bottom: 0.4rem;
}

/* ===== TIJDSVERSCHIL ===== */
.world-clock-card .time-diff {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  display: inline-block;
  margin-top: 0.15rem;
}

.world-clock-card .time-diff.diff-ahead {
  background: rgba(16, 185, 129, 0.12);
  color: var(--world-clock-diff-ahead);
}

.world-clock-card .time-diff.diff-behind {
  background: rgba(245, 158, 11, 0.12);
  color: var(--world-clock-diff-behind);
}

.world-clock-card .time-diff.diff-same {
  background: rgba(107, 114, 128, 0.12);
  color: var(--world-clock-diff-same);
}

/* ===== VERWIJDER-KNOP ===== */
.world-clock-card .remove-clock-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  border: 2px solid var(--world-clock-border);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  background: var(--world-clock-button-bg);
  color: var(--world-clock-button-text);
  font-size: 1.2rem;
  line-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
  padding: 0;
}

.world-clock-card .remove-clock-btn:hover {
  background: #ef4444;
  border-color: #ef4444;
  color: #ffffff;
  transform: scale(1.1);
}

/* ===== FEEDBACK ===== */
.world-clock-card .feedback {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  text-align: center;
  font-weight: 600;
  font-size: 0.875rem;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  margin-bottom: 1rem;
  pointer-events: none;
}

.world-clock-card .feedback.visible {
  opacity: 1;
  transform: translateY(0);
}

.world-clock-card .feedback.feedback--success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.world-clock-card .feedback.feedback--error {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

/* ===== INFO SECTIE ===== */
.world-clock-card .info-section {
  background: var(--world-clock-bg-form);
  border: 1px solid var(--world-clock-border);
  border-radius: 12px;
  padding: 1rem;
  line-height: 1.6;
  color: var(--world-clock-text-secondary);
  font-size: 0.9rem;
  transition: border-color 0.3s ease;
}

.world-clock-card .info-section:hover {
  border-color: var(--world-clock-button-hover-border);
}

.world-clock-card .info-section h3 {
  color: var(--world-clock-accent-blue);
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.75rem;
}

.world-clock-card .info-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.world-clock-card .info-section li {
  margin-bottom: 0.5rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.world-clock-card .info-section li::before {
  content: "•";
  color: var(--world-clock-accent-blue);
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 991px) {
  .world-clock-card {
    padding: 1rem;
  }

  .world-clock-card h1 {
    font-size: 1.5rem;
  }

  .world-clock-card .city-selection-wrapper {
    gap: 0.75rem;
  }
}

@media (max-width: 768px) {
  .world-clock-card {
    padding: 1rem;
    border-radius: 12px;
  }

  .world-clock-card h1 {
    font-size: 1.35rem;
    margin-bottom: 1rem;
  }

  .world-clock-card .intro {
    font-size: 0.88rem;
  }

  .world-clock-card .city-selection-wrapper {
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
  }

  .world-clock-card .city-search-group {
    width: 100%;
  }

  .world-clock-card .city-search-input {
    width: 100%;
  }

  .world-clock-card #addCityBtn {
    width: 100%;
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
  }

  .world-clock-card .clocks-container {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .world-clock-card .city-name {
    font-size: 1rem;
  }

  .world-clock-card .current-time {
    font-size: 1.8rem;
  }

  .world-clock-card .info-section {
    padding: 1rem;
  }
}

@media (max-width: 576px) {
  .world-clock-card {
    padding: 1rem;
  }

  .world-clock-card h1 {
    font-size: 1.3rem;
  }

  .world-clock-card .current-time {
    font-size: 1.6rem;
  }
}
