/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */
@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@600;700;800&display=swap");

:root {
  --ink: #17233b;
  --muted: #7b8497;
  --navy: #17233b;
  --blue: #3972e7;
  --blue-dark: #275bc2;
  --blue-pale: #edf3ff;
  --line: #e8ecf3;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  font-family: "DM Sans", sans-serif;
  background: #f7f9fc;
}

.travel-app {
  min-height: 100vh;
  padding: 0 3.5vw 40px;
  background:
    radial-gradient(circle at 4% 10%, rgba(79, 132, 230, .055), transparent 20%),
    linear-gradient(135deg, #fafcff 0%, #f5f7fb 100%);
}

.topbar {
  height: 112px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
}

.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: white;
  font-family: "Manrope", sans-serif;
  font-size: 25px;
  font-weight: 800;
  background: linear-gradient(135deg, #397be9, #1e55ba);
  box-shadow: 0 8px 20px rgba(42, 99, 199, .22);
}
.brand p, .brand h1 { margin: 0; }
.brand p {
  color: #98a0af;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.8px;
  text-transform: uppercase;
}
.brand h1 { font-family: "Manrope", sans-serif; font-size: 21px; margin-top: 3px; }

.progress-card {
  width: 230px;
  display: grid;
  grid-template-columns: 1fr 82px;
  align-items: center;
  gap: 16px;
}
.progress-card span { font-size: 15px; }
.progress-card small { display: block; color: var(--muted); margin-top: 3px; }
.progress-track { height: 7px; border-radius: 99px; background: #dfe5ef; overflow: hidden; }
.progress-fill { height: 100%; width: 0; border-radius: 99px; background: var(--blue); transition: width .5s ease; }

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 22px;
  max-width: 1440px;
  margin: 0 auto;
}

.map-card, .roulette-card {
  background: rgba(255,255,255,.92);
  border: 1px solid #edf0f5;
  border-radius: 18px;
  box-shadow: 0 14px 42px rgba(35, 55, 91, .055);
}

.map-card { min-height: 680px; padding: 26px 30px 12px; }
.map-heading { display: flex; align-items: flex-start; justify-content: space-between; }
.map-heading p, .roulette-heading p {
  margin: 0 0 5px;
  color: #98a1b1;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.7px;
}
.map-heading h2, .roulette-heading h2 {
  margin: 0;
  font-family: "Manrope", sans-serif;
  font-size: 20px;
}
.legend { display: flex; gap: 18px; color: var(--muted); font-size: 12px; padding-top: 8px; }
.legend span { display: flex; align-items: center; gap: 7px; }
.legend i { width: 9px; height: 9px; border-radius: 50%; }
.visited-dot { background: var(--blue); }
.unvisited-dot { background: #dfe5ef; }

.map-wrap { height: 610px; display: grid; place-items: center; overflow: hidden; position: relative; }
#department-map { width: 100%; height: 100%; }
.department-map { touch-action: none; }
#department-map.is-dragging { cursor: grabbing; }
#department-map { cursor: grab; }
.map-controls {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(2, 38px);
  gap: 6px;
}
.map-controls button {
  width: 38px;
  height: 38px;
  border: 1px solid #e2e7ef;
  border-radius: 9px;
  background: rgba(255,255,255,.96);
  color: var(--navy);
  font-family: "DM Sans", sans-serif;
  font-size: 21px;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 5px 14px rgba(35,55,91,.10);
}
.map-controls .zoom-reset { grid-column: span 2; width: 82px; }
.zoom-reset svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.department-label {
  fill: #66748a;
  font-family: "DM Sans", sans-serif;
  font-size: 8px;
  font-weight: 800;
  pointer-events: none;
  paint-order: stroke;
  stroke: rgba(255,255,255,.88);
  stroke-width: 2.2px;
  stroke-linejoin: round;
}
.department.is-visited + .department-label { fill: white; stroke: rgba(45,98,190,.72); stroke-width: 1.8px; }
.department {
  fill: #dfe5ef;
  stroke: white;
  stroke-width: 1.2;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
  transition: fill .2s ease, filter .2s ease, transform .2s ease;
  transform-box: fill-box;
  transform-origin: center;
}
.department:hover { fill: #bfcaf0; filter: drop-shadow(0 3px 4px rgba(47,80,150,.16)); }
.department.is-visited { fill: #3e78df; }
.department.is-visited:hover { fill: #2f66c7; }
.department.is-selected { fill: #ffb54a; filter: drop-shadow(0 5px 8px rgba(201,139,48,.35)); transform: scale(1.025); }
.overseas-label { fill: #8390a4; font-size: 9px; font-weight: 700; pointer-events: none; }

.roulette-card {
  min-height: 680px;
  padding: 28px 26px 24px;
  display: flex;
  flex-direction: column;
}
.roulette-heading { margin-bottom: 10px; }
.roulette {
  flex: 1;
  display: grid;
  place-items: center;
  position: relative;
}
.roulette-ring {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  background:
    repeating-conic-gradient(from -10deg, #edf2fb 0deg 8deg, #fff 8deg 16deg),
    #eef2f8;
  border: 10px solid #f1f4f9;
  box-shadow: 0 12px 30px rgba(41,64,106,.12), inset 0 0 0 1px #dfe5ef;
  transition: transform 1.7s cubic-bezier(.12,.78,.18,1);
}
.roulette-ring { transform: rotate(1080deg); }
.roulette-arrow {
  position: absolute;
  z-index: 3;
  top: -18px;
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 16px solid var(--navy);
  filter: drop-shadow(0 3px 3px rgba(23,35,59,.15));
}
.roulette-center {
  width: 136px;
  height: 136px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: white;
  box-shadow: 0 7px 20px rgba(37,58,96,.12);
  text-align: center;
}
.roulette-center small { color: #a4abba; font-size: 8px; font-weight: 800; letter-spacing: 1.4px; }
.roulette-center strong { font-family: "Manrope", sans-serif; font-size: 34px; margin: 3px 0 0; }
.roulette-center span { max-width: 110px; color: var(--muted); font-size: 11px; }
.roulette-button, .save-button {
  border: 0;
  border-radius: 10px;
  color: white;
  background: linear-gradient(135deg, #407fe8, #315fbe);
  font-family: "DM Sans", sans-serif;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(45,102,196,.18);
}
.roulette-button {
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 14px;
}
.roulette-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; }

.department-dialog {
  width: min(820px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 0;
  border-radius: 20px;
  box-shadow: 0 30px 90px rgba(18,34,66,.28);
}
.department-dialog::backdrop { background: rgba(21,31,51,.42); backdrop-filter: blur(5px); }
.dialog-shell { min-height: 470px; display: grid; grid-template-columns: 42% 58%; position: relative; }
.dialog-close {
  position: absolute;
  z-index: 2;
  right: 14px;
  top: 12px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #f1f4f8;
  color: #79849a;
  font-size: 22px;
  cursor: pointer;
}
.dialog-photo { min-height: 470px; background: #eef2f7; overflow: hidden; }
.dialog-photo img { width: 100%; height: 100%; object-fit: cover; }
.photo-placeholder { height: 100%; min-height: 470px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: #98a3b5; font-size: 12px; }
.photo-placeholder svg { width: 38px; height: 38px; fill: none; stroke: #aab4c4; stroke-width: 1.2; }
.dialog-fields { padding: 38px 42px 28px; }
.dialog-code { color: #94a0b3; font-size: 9px; font-weight: 800; letter-spacing: 1.5px; }
.dialog-fields h2 { margin: 3px 0 24px; font-family: "Manrope", sans-serif; font-size: 25px; }
.dialog-fields label { display: block; color: #69758a; font-size: 11px; font-weight: 700; margin-top: 14px; }
.dialog-fields input[type="date"], .dialog-fields textarea {
  width: 100%;
  margin-top: 7px;
  border: 1px solid #e3e7ef;
  border-radius: 9px;
  background: #fafbfc;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  outline: none;
}
.dialog-fields input[type="date"] { height: 42px; padding: 0 12px; }
.dialog-fields textarea { padding: 10px 12px; resize: vertical; }
.dialog-fields input:focus, .dialog-fields textarea:focus { border-color: #87a8ea; box-shadow: 0 0 0 3px rgba(57,114,231,.08); }
.photo-input input { display: block; margin-top: 7px; color: #7d8797; font-size: 11px; }
.save-button { width: 100%; height: 48px; margin-top: 18px; }
.trips-data { display: none; }

@media (max-width: 980px) {
  .travel-app { padding: 0 20px 30px; }
  .content-grid { grid-template-columns: 1fr; }
  .roulette-card { min-height: 520px; }
  .map-card { min-height: 600px; }
  .map-wrap { height: 530px; }
}

@media (max-width: 620px) {
  .topbar { height: 96px; }
  .progress-card { width: 130px; grid-template-columns: 1fr; gap: 5px; }
  .progress-track { width: 130px; }
  .brand h1 { font-size: 17px; }
  .brand-mark { width: 42px; height: 42px; }
  .map-card { padding: 20px 12px 8px; min-height: 490px; }
  .map-wrap { height: 430px; }
  .legend { display: none; }
  .dialog-shell { grid-template-columns: 1fr; }
  .dialog-photo, .photo-placeholder { min-height: 220px; height: 220px; }
  .dialog-fields { padding: 24px; }
}
