
:root {
  --navy: #12375b;
  --blue: #1685b5;
  --teal: #21b6a8;
  --background: #f3f7fb;
  --white: #ffffff;
  --text: #243746;
  --muted: #687b8c;
  --border: #e0e9f0;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.6;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  padding: 22px 6%;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}

.brand h1 {
  margin: 0;
  color: var(--navy);
  font-size: 28px;
}

.brand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

nav a {
  color: var(--navy);
  text-decoration: none;
  font-weight: 600;
}

nav a:hover {
  color: var(--blue);
}

main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 36px 24px;
}

section {
  margin-bottom: 36px;
}

section h2 {
  color: var(--navy);
  font-size: 23px;
}

.welcome {
  padding: 48px 42px;
  border-radius: 20px;
  background: linear-gradient(120deg, var(--navy), var(--blue));
  color: var(--white);
}

.welcome h2 {
  color: var(--white);
  font-size: 34px;
  margin: 0 0 8px;
}

.welcome p {
  margin: 0;
  font-size: 17px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 26px;
  box-shadow: 0 5px 18px rgba(18, 55, 91, 0.05);
}

.stat-card h3 {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.stat-card p {
  margin: 12px 0 0;
  color: var(--navy);
  font-size: 32px;
  font-weight: 700;
}

#journeys {
  padding: 30px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
}

#journeys p {
  color: var(--muted);
}

button {
  padding: 13px 22px;
  border: none;
  border-radius: 9px;
  background: var(--teal);
  color: var(--white);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

footer {
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid var(--border);
}

@media (max-width: 900px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  header {
    padding: 20px;
  }

  nav {
    gap: 14px;
  }

  main {
    padding: 20px 14px;
  }

  .welcome {
    padding: 32px 24px;
  }

  .welcome h2 {
    font-size: 27px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stat-card {
    padding: 20px;
  }
}

/* ===================================
   THE GLOBAL TRIPS - HEADER LOGO
   =================================== */

.brand {
  display: flex;
  align-items: center;
}

.brand a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: 75px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

/* Mobile logo adjustment */
@media (max-width: 600px) {
  .brand-logo {
    width: 75px;
  }
}

/* ===================================
   TRAVEL MODES - DASHBOARD CARDS
   =================================== */

.travel-modes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.travel-mode-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 20px;
  text-align: center;
  box-shadow: 0 5px 18px rgba(18, 55, 91, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.travel-mode-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(18, 55, 91, 0.10);
}

.travel-mode-icon {
  display: block;
  font-size: 34px;
  line-height: 1.4;
  margin-bottom: 10px;
}

.travel-mode-card h3 {
  color: var(--navy);
  font-size: 18px;
  margin: 0 0 6px;
}

.travel-mode-card p {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

/* Tablet */
@media (max-width: 900px) {
  .travel-modes-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Mobile */
@media (max-width: 600px) {
  .travel-modes-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .travel-mode-card {
    padding: 20px 10px;
  }

  .travel-mode-icon {
    font-size: 28px;
  }

  .travel-mode-card h3 {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .travel-mode-card {
    transition: none;
  }

  .travel-mode-card:hover {
    transform: none;
  }
}

/* ===================================
   THE GLOBAL TRIPS - TRAVEL MAP
   =================================== */

#travel-map {
  margin-bottom: 36px;
}

.map-section-header {
  margin-bottom: 20px;
}

.map-section-header h2 {
  margin-bottom: 6px;
}

.map-section-header p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.travel-map-container {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  min-height: 380px;
  box-shadow: 0 5px 18px rgba(18, 55, 91, 0.05);
}

.map-placeholder {
  min-height: 380px;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(
    135deg,
    #eaf5fa 0%,
    #f5fbfd 50%,
    #e8f4f3 100%
  );
}

.map-placeholder-icon {
  font-size: 60px;
  line-height: 1.2;
  margin-bottom: 12px;
}

.map-placeholder h3 {
  margin: 10px 0;
  color: var(--navy);
  font-size: 23px;
}

.map-placeholder p {
  max-width: 380px;
  margin: 8px 0 20px;
  color: var(--muted);
  font-size: 15px;
}

.map-status {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 30px;
  background: rgba(22, 133, 181, 0.1);
  color: var(--blue);
  font-size: 12px;
  font-weight: 600;
}

@media (max-width: 600px) {
  .travel-map-container,
  .map-placeholder {
    min-height: 300px;
  }

  .map-placeholder-icon {
    font-size: 46px;
  }

  .map-placeholder h3 {
    font-size: 20px;
  }
}

/* ===================================
   INTERACTIVE WORLD MAP
   =================================== */

#world-map {
  width: 100%;
  height: 480px;
  min-height: 480px;
  background: #eaf5fa;
  z-index: 0;
}

/* Leaflet map appearance */
#world-map .leaflet-container {
  font-family: Arial, Helvetica, sans-serif;
}

/* Tablet */
@media (max-width: 900px) {
  #world-map {
    height: 400px;
    min-height: 400px;
  }
}

/* Mobile */
@media (max-width: 600px) {
  #world-map {
    height: 320px;
    min-height: 320px;
  }
}

/* ===================================
   2D / 3D MAP VIEW SWITCH
   =================================== */

.map-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.map-view-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  background: #e4edf4;
  border-radius: 12px;
}

.map-view-btn {
  padding: 10px 18px;
  border-radius: 9px;
  background: transparent;
  color: var(--navy);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.map-view-btn.active {
  background: var(--white);
  color: var(--navy);
  box-shadow: 0 2px 6px rgba(18, 55, 91, 0.1);
}

.map-view-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.map-view-btn:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

/* Mobile */
@media (max-width: 600px) {
  .map-section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .map-view-switch {
    width: 100%;
  }

  .map-view-btn {
    flex: 1;
    padding: 10px 12px;
  }
}

/* ===================================
   THE GLOBAL TRIPS - 3D GLOBE
   =================================== */

#world-globe {
  position: relative;
  width: 100%;
  height: 480px;
  overflow: hidden;
  background: radial-gradient(
    circle at center,
    #183f67 0%,
    #0b203b 65%,
    #061426 100%
  );
}

/* Keep inactive map views hidden */
#world-map[hidden],
#world-globe[hidden] {
  display: none !important;
}

/* Globe canvas */
#world-globe canvas {
  display: block;
  max-width: 100%;
}

/* Tablet */
@media (max-width: 900px) {
  #world-globe {
    height: 400px;
  }
}

/* Mobile */
@media (max-width: 600px) {
  #world-globe {
    height: 320px;
  }
}

/* STEP 053 - Selected country information panel */

.travel-map-container {
    position: relative;
}

.selected-country-info {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 1000;

    display: flex;
    flex-direction: column;
    gap: 5px;

    min-width: 170px;
    max-width: calc(100% - 32px);
    padding: 14px 18px;

    background: rgba(11, 32, 59, 0.94);
    color: #ffffff;
    border: 1px solid rgba(99, 217, 232, 0.35);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);

    pointer-events: auto;
}

.selected-country-info[hidden] {
    display: none !important;
}

.selected-country-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #9eb5cb;
}

#selected-country-name {
    font-size: 19px;
    font-weight: 600;
    line-height: 1.3;
    color: #ffffff;
}

/* STEP 087/C - Visited Countries toggle */

.visited-countries-control {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #173b56;
  user-select: none;
}

.visited-countries-control input {
  appearance: none;
  -webkit-appearance: none;
  width: 46px;
  height: 26px;
  background: #cbd5e1;
  border: none;
  border-radius: 20px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.visited-countries-control input::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s ease;
}

.visited-countries-control input:checked {
  background: #0dafa9;
}

.visited-countries-control input:checked::before {
  transform: translateX(20px);
}

.visited-countries-control input:focus-visible {
  outline: 3px solid #63d9e8;
  outline-offset: 3px;
}

@media (max-width: 700px) {
  .visited-countries-control {
    font-size: 13px;
    gap: 8px;
  }
}

/* STEP 087/D - Visited Countries LED button */

.visited-countries-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 16px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #ffffff;
  color: #173b56;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.visited-countries-btn:hover {
  background: #f0fdfa;
  border-color: #0dafa9;
}

.visited-countries-btn:focus-visible {
  outline: 3px solid #63d9e8;
  outline-offset: 3px;
}

.visited-led {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

/* Green LED - ON */
.visited-countries-btn[aria-pressed="true"] .visited-led {
  background: #16a34a;
  box-shadow:
    0 0 0 2px #bbf7d0,
    0 0 8px rgba(22, 163, 74, 0.55);
}

/* Red LED - OFF */
.visited-countries-btn[aria-pressed="false"] .visited-led {
  background: #dc2626;
  box-shadow:
    0 0 0 2px #fecaca,
    0 0 8px rgba(220, 38, 38, 0.45);
}

@media (max-width: 700px) {
  .visited-countries-btn {
    font-size: 13px;
    padding: 9px 12px;
    gap: 9px;
  }
}

/* STEP 089/F - 3D globe country tooltip */

.travel-map-container {
  position: relative;
}

.globe-country-tooltip {
  position: absolute;
  z-index: 1000;
  padding: 8px 13px;
  border: 1px solid #63d9e8;
  border-radius: 8px;
  background: rgba(6, 20, 38, 0.94);
  color: #ffffff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.globe-country-tooltip[hidden] {
  display: none !important;
}


/* STEP 089/X - Custom outlined turquoise cursor */

#world-globe,
#world-globe canvas,
#world-globe canvas:hover,
#world-globe canvas:active {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M4 3 L15 9 L9 11 L7 17 Z' fill='none' stroke='%2363d9e8' stroke-width='1.5' stroke-linejoin='round' stroke-linecap='round'/%3E%3C/svg%3E") 4 3, default !important;
}
/* STEP 100/168 - Premium country visit status selector */

.country-visit-status {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
    padding-top: 14px;
    border-top: 1px solid rgba(99, 217, 232, 0.2);
}

.country-visit-status label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #9eb5cb;
}

#country-visit-status-select {
    width: 100%;
    min-height: 42px;
    padding: 10px 36px 10px 14px;

    background-color: #132f50;
    color: #ffffff;

    border: 1px solid rgba(99, 217, 232, 0.45);
    border-radius: 9px;

    font-family: inherit;
    font-size: 13px;
    font-weight: 600;

    cursor: pointer;
    outline: none;

    appearance: none;
    -webkit-appearance: none;

    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2363d9e8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");

    background-repeat: no-repeat;
    background-position: right 12px center;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease;
}

#country-visit-status-select:hover {
    background-color: #1a3b60;
    border-color: #63d9e8;
}

#country-visit-status-select:focus {
    border-color: #63d9e8;
    box-shadow: 0 0 0 3px rgba(99, 217, 232, 0.15);
}

#country-visit-status-select option {
    background-color: #132f50;
    color: #ffffff;
}



/* THE GLOBAL TRIPS - QUICK ADD JOURNEY */

#quick-add-journey:not([hidden]) {
  display: block;
  box-sizing: border-box;
  width: calc(100% - 44px);
  max-width: 768px;
  margin: 14px auto;
  padding: 12px;
  background: #0b2035;
  border: none;
  border-radius: 18px;
}

#quick-add-journey[hidden] {
  display: none !important;
}

#quick-add-title {
  margin: 4px 0 14px;
  color: #ffffff;
  font-size: 18px;
  font-weight: 700;
}

/* Main layout - one vertical column */

#quick-add-journey-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#quick-add-journey-form > * {
  min-width: 0;
}

/* From/To and Start/End date */

#quick-add-journey .journey-form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

/* Field labels and inputs */

#quick-add-journey .journey-form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

#quick-add-journey .journey-form-field > label {
  color: #a7bfd1;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
}

#quick-add-journey .journey-form-field > input:not([type="hidden"]),
#quick-add-journey .journey-form-field > textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 52px;
  padding: 12px;
  background: #102c46;
  border: 1px solid #326585;
  border-radius: 9px;
  color: #ffffff;
  font-family: inherit;
  font-size: 15px;
}

#quick-add-journey input::placeholder,
#quick-add-journey textarea::placeholder {
  color: #a7c2e0;
  opacity: 1;
}

#quick-add-journey .journey-form-field > textarea {
  min-height: 66px;
  resize: vertical;
}

#quick-add-journey .journey-form-field > input:focus,
#quick-add-journey .journey-form-field > textarea:focus {
  outline: none;
  border-color: #7ed5d0;
}

/* Travel mode - 3 columns, 2 rows */

#quick-add-journey .journey-travel-modes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 6px;
}

#quick-add-journey .journey-mode-option {
  position: relative;
  display: block;
  cursor: pointer;
}

#quick-add-journey .journey-mode-option input[type="radio"] {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  padding: 0;
  opacity: 0;
}

#quick-add-journey .journey-mode-option span {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 46px;
  padding: 10px;
  background: #102c46;
  border: 1px solid #326585;
  border-radius: 9px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 500;
}

#quick-add-journey .journey-mode-option:hover span {
  border-color: #7ed5d0;
}

#quick-add-journey .journey-mode-option input:checked + span {
  background: #17475b;
  border: 2px solid #7ed5d0;
  color: #7ed5d0;
}

#quick-add-journey .journey-mode-option input:focus-visible + span {
  outline: 2px solid #7ed5d0;
  outline-offset: 2px;
}

/* Action buttons */

#quick-add-journey .journey-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin-top: 0;
}

#quick-add-journey .journey-form-actions button {
  min-height: 52px;
  padding: 12px;
  border-radius: 9px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

#save-journey-button {
  background: #7ed5d0;
  color: #0b2035;
  border: 1px solid #7ed5d0;
}

#save-journey-button:hover {
  background: #9be5df;
}

#cancel-journey-button {
  background: transparent;
  color: #ffffff;
  border: 1px solid #326585;
}

#cancel-journey-button:hover {
  background: rgba(255, 255, 255, 0.1);
}

#journey-form-message {
  margin: 0;
  color: #e4f1f8;
}

#journey-form-message:empty {
  display: none;
}

/* Mobile */

@media (max-width: 640px) {
  #quick-add-journey:not([hidden]) {
    width: calc(100% - 24px);
    padding: 12px;
  }

  #quick-add-journey .journey-form-row {
    grid-template-columns: 1fr;
  }

  #quick-add-journey .journey-travel-modes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}



/* STEP 119/A - My Journeys List Cards */

#journeys-list {
  display: grid;
  grid-template-columns: repeat(
    auto-fit,
    minmax(min(100%, 280px), 1fr)
  );
  gap: 18px;
  margin-top: 24px;
}

#journeys-list .journey-card {
  padding: 22px 24px;
  background: #0b2035;
  border: 1px solid #275775;
  border-radius: 16px;
  box-shadow: 0 8px 22px rgba(6, 24, 40, 0.12);
}

#journeys-list .journey-card h3 {
  margin: 0 0 14px;
  color: #ffffff;
  font-size: 18px;
  font-weight: 700;
}

#journeys-list .journey-card p {
  margin: 8px 0 0;
  color: #a7bfd1;
  font-size: 14px;
  line-height: 1.6;
}

#journeys-list .journey-card:hover {
  border-color: #63d9e8;
  box-shadow: 0 10px 26px rgba(6, 24, 40, 0.18);
}

@media (max-width: 640px) {
  #journeys-list {
    grid-template-columns: 1fr;
  }

  #journeys-list .journey-card {
    padding: 20px;
  }
}

/* STEP 121/F - Journey Card Locations */

#journeys-list .journey-card-locations {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid #275775;
}

#journeys-list .journey-card-location {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

#journeys-list .journey-card-location .journey-date-value {
  overflow-wrap: anywhere;
}

#journeys-list .journey-card-locations + .journey-card-dates {
  margin-top: 18px;
}

/* STEP 119/B - Journey Card Dates */

#journeys-list .journey-card-dates {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 18px 0;
}

#journeys-list .journey-card-date {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

#journeys-list .journey-date-label {
  color: #a7bfd1;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
}

#journeys-list .journey-date-value {
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
}

#journeys-list .journey-card-purpose {
  padding-top: 12px;
  border-top: 1px solid #275775;
  color: #a7bfd1;
}

/* STEP 120/B - Journey Date Picker Popup */

#journey-date-picker {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  z-index: 99999 !important;

  box-sizing: border-box;
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;

  padding: 24px;
  background: #0b2035;
  border: 1px solid #326585;
  border-radius: 16px;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.55);

  color: #ffffff;
}

#journey-date-picker[hidden] {
  display: none !important;
}

#journey-date-picker button {
  cursor: pointer;
  font-family: inherit;
}

#journey-date-picker input,
#journey-date-picker select {
  max-width: 100%;
  box-sizing: border-box;
}

/* STEP 120/D - Journey Date Picker Design */

#journey-date-picker {
  width: min(440px, calc(100vw - 32px));
  padding: 24px;
  background: #0b2035;
  border: 1px solid #326585;
  border-radius: 16px;
  color: #ffffff;
}

/* Consistent spacing inside the picker */

#journey-date-picker > * {
  margin-bottom: 14px;
}

#journey-date-picker > *:last-child {
  margin-bottom: 0;
}

/* Year, month and day button styling */

#journey-date-picker button {
  box-sizing: border-box;
  min-width: 0;
  min-height: 42px;
  padding: 10px 8px;
  background: #102c46;
  color: #eaf5fa;
  border: 1px solid #326585;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
}

#journey-date-picker button:hover {
  background: #17475b;
  border-color: #7ed5d0;
}

#journey-date-picker button:focus-visible {
  outline: 2px solid #7ed5d0;
  outline-offset: 2px;
}

#journey-date-picker button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Grid containers created by the date picker */

#journey-date-picker [class*="grid"],
#journey-date-picker [class*="years"],
#journey-date-picker [class*="months"],
#journey-date-picker [class*="days"] {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
}

/* Calendar days use 7 columns */

#journey-date-picker [class*="days"] {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

/* Header and navigation */

#journey-date-picker [class*="header"],
#journey-date-picker [class*="navigation"],
#journey-date-picker [class*="nav"] {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* Highlight selected date */

#journey-date-picker .selected,
#journey-date-picker [aria-selected="true"] {
  background: #7ed5d0;
  color: #0b2035;
  border-color: #7ed5d0;
}

@media (max-width: 480px) {
  #journey-date-picker {
    padding: 16px;
  }

  #journey-date-picker button {
    padding: 8px 4px;
    font-size: 12px;
  }
}
/* STEP 120/H - Month picker: 4 columns */

#journey-date-picker .journey-picker-grid:has(> button:first-child:nth-last-child(12)) {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

#journey-date-picker .journey-picker-grid:has(> button:first-child:nth-last-child(12)) > button {
  width: 100%;
  min-width: 0;
  padding: 10px 5px;
  font-size: 12px;
}

/* STEP 120/K - Calendar days, Monday to Sunday */

#journey-date-picker .journey-picker-grid.journey-calendar-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
}

#journey-date-picker .journey-calendar-days .journey-weekday {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  color: #a7bfd1;
  font-size: 12px;
  font-weight: 700;
}

#journey-date-picker .journey-calendar-days .journey-calendar-empty {
  min-width: 0;
}

#journey-date-picker .journey-calendar-days > button {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 8px 2px;
  font-size: 12px;
}

@media (max-width: 480px) {
  #journey-date-picker .journey-picker-grid.journey-calendar-days {
    gap: 4px;
  }
}
/* STEP 122/E – Journey Card Action Buttons */

#journeys-list .journey-card-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

#journeys-list .journey-card-action {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #19b5a9;
  border-radius: 8px;
  background: transparent;
  color: #ffffff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease,
              color 0.2s ease;
}

#journeys-list .journey-card-action:hover {
  background: #19b5a9;
  color: #0b2035;
}

#journeys-list .journey-card-action:focus-visible {
  outline: 2px solid #19b5a9;
  outline-offset: 3px;
}

@media (max-width: 480px) {
  #journeys-list .journey-card-actions {
    gap: 8px;
  }

  #journeys-list .journey-card-action {
    padding: 10px 6px;
    font-size: 12px;
  }
}
/* STEP 122/J – Edit Journey Modal */

#edit-journey-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.7);
}

#edit-journey-modal .edit-journey-panel {
  width: 100%;
  max-width: 768px;
  max-height: 90vh;
  overflow-y: auto;
  box-sizing: border-box;
  padding: 28px;
  border: 1px solid #275775;
  border-radius: 16px;
  background: #0b2035;
  color: #ffffff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

#edit-journey-modal h2 {
  margin: 0 0 24px;
  color: #ffffff;
  font-size: 24px;
}

#edit-journey-modal button {
  padding: 11px 24px;
  border: 1px solid #19b5a9;
  border-radius: 8px;
  background: transparent;
  color: #ffffff;
  font: inherit;
  cursor: pointer;
}

#edit-journey-modal button:hover {
  background: #19b5a9;
  color: #0b2035;
}
/* STEP 122/Y – Edit Journey uses Quick Add styling */

#edit-journey-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#edit-journey-form > * {
  min-width: 0;
}

#edit-journey-form .journey-form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

#edit-journey-form .journey-form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

#edit-journey-form .journey-form-field > label {
  color: #a7bfd1;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
}

#edit-journey-form .journey-form-field > input:not([type="hidden"]),
#edit-journey-form .journey-form-field > textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 52px;
  padding: 12px;
  background: #102c46;
  border: 1px solid #326585;
  border-radius: 9px;
  color: #ffffff;
  font-family: inherit;
  font-size: 15px;
}

#edit-journey-form input::placeholder,
#edit-journey-form textarea::placeholder {
  color: #a7c2e0;
  opacity: 1;
}

#edit-journey-form .journey-form-field > textarea {
  min-height: 66px;
  resize: vertical;
}

#edit-journey-form .journey-form-field > input:focus,
#edit-journey-form .journey-form-field > textarea:focus {
  outline: none;
  border-color: #7ed5d0;
}

/* Travel mode */

#edit-journey-form .journey-travel-modes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 6px;
}

#edit-journey-form .journey-mode-option {
  position: relative;
  display: block;
  cursor: pointer;
}

#edit-journey-form .journey-mode-option input[type="radio"] {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  padding: 0;
  opacity: 0;
}

#edit-journey-form .journey-mode-option span {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 46px;
  padding: 10px;
  background: #102c46;
  border: 1px solid #326585;
  border-radius: 9px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 500;
}

#edit-journey-form .journey-mode-option:hover span {
  border-color: #7ed5d0;
}

#edit-journey-form .journey-mode-option input:checked + span {
  background: #17475b;
  border: 2px solid #7ed5d0;
  color: #7ed5d0;
}

#edit-journey-form .journey-mode-option input:focus-visible + span {
  outline: 2px solid #7ed5d0;
  outline-offset: 2px;
}

/* Buttons */

#edit-journey-form .journey-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin-top: 0;
}

#edit-journey-form .journey-form-actions button {
  min-height: 52px;
  padding: 12px;
  border-radius: 9px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

#edit-save-journey-button {
  background: #7ed5d0;
  color: #0b2035;
  border: 1px solid #7ed5d0;
}

#edit-save-journey-button:hover {
  background: #9be5df;
}

#edit-cancel-journey-button {
  background: transparent;
  color: #ffffff;
  border: 1px solid #326585;
}

#edit-cancel-journey-button:hover {
  background: rgba(255, 255, 255, 0.1);
}

#edit-journey-form #edit-journey-form-message {
  margin: 0;
  color: #e4f1f8;
}

#edit-journey-form #edit-journey-form-message:empty {
  display: none;
}

/* Mobile */

@media (max-width: 640px) {
  #edit-journey-form .journey-form-row {
    grid-template-columns: 1fr;
  }

  #edit-journey-form .journey-travel-modes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
/* STEP 123/Z – Journey Status styling */

.journey-status-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 6px;
}

.journey-status-option {
  position: relative;
  display: block;
  cursor: pointer;
}

.journey-status-option input[type="radio"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  opacity: 0;
}

.journey-status-option span {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 46px;
  padding: 10px;
  background: #102c46;
  border: 1px solid #326585;
  border-radius: 9px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
}

.journey-status-option:hover span {
  border-color: #7ed5d0;
}

.journey-status-option input:checked + span {
  background: #17475b;
  border: 2px solid #7ed5d0;
  color: #7ed5d0;
}

.journey-status-option input:focus-visible + span {
  outline: 2px solid #7ed5d0;
  outline-offset: 2px;
}
/* STEP 124/Q – Journey validation message colour */
#quick-add-journey-form #journey-form-message,
#edit-journey-form #edit-journey-form-message {
  color: #ffffff !important;
}
/* STEP 125/D – Journey Status on My Journeys cards */

.journey-card-status {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  width: fit-content;
  margin: 4px 0 14px;
  padding: 5px 11px;

  background: rgba(126, 213, 208, 0.10);
  border: 1px solid rgba(126, 213, 208, 0.45);
  border-radius: 20px;

  color: #ffffff;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.3px;
  line-height: 1.4;
}
/* STEP 125/F – Planned Journey status styling */

.journey-card-status-planned {
  background: rgba(230, 190, 105, 0.10);
  border-color: rgba(230, 190, 105, 0.65);
  color: #ffffff;
}