@import url('https://fonts.cdnfonts.com/css/rubik');

:root {
  --primary: #1764AE;
  --secondary: #4C814D;
  --accent: #C78B5D;
  --light: #f8f9fa;
  --dark: #343a40;
  --gray: #6c757d;

  --depart-bg:#FFF4E7;     /* warm tint */
  --depart-bd:#C78B5D55;
  --return-bg:#E7F1FF;     /* cool tint */
  --return-bd:#1764AE44;

  --depart-txt:#B00020;    /* red for Leaving */
  --return-txt:#1764AE;    /* blue for Arriving */
}

/* Global Reset / Base */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Rubik', sans-serif;
}

body {
  background-color: #f5f7fa;
  color: #333;
  line-height: 1.6;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}

.intro-copy {
  white-space: normal;
  line-height: 1.5;
}

/* Intro header */

header {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  padding: 30px;
  border-radius: 10px;
  margin-bottom: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

header h1 {
  font-size: 28px;
  margin-bottom: 15px;
  font-weight: 600;
}

header p {
  font-size: 16px;
  opacity: 0.95;
}

/* Progress bar */

.progress-container {
  width: 100%;
  height: 5px;
  background: #e9ecef;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 15px;
}

.progress-bar {
  height: 5px;
  width: 0;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 0.25s ease;
}

/* Sections */

.form-section {
  display: none;
  background-color: #fff;
  border-radius: 10px;
  padding: 24px 24px 20px;
  margin-bottom: 24px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.form-section.active {
  display: block;
  animation: fadeIn 0.35s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0);    }
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  font-size: 20px;
  margin-bottom: 18px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
  font-weight: 600;
  justify-content: space-between;
}



/* Form elements */

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--dark);
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ced4da;
  border-radius: 6px;
  font-size: 15px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus,
input[type="number"]:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(23, 100, 174, 0.15);
}

/* Radios & checkboxes */

.radio-group,
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.radio-option,
.checkbox-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.95rem;
  color: #374151;
}

.radio-option input,
.checkbox-option input {
  margin: 0;
}

/* Buttons */

.btn {
  padding: 10px 22px;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.25s;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-primary {
  background-color: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background-color: #14518e;
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: var(--gray);
  color: #fff;
}

.btn-secondary:hover {
  background-color: #5a6268;
  transform: translateY(-1px);
}

.btn-accent {
  background-color: var(--accent);
  color: #fff;
}

.btn-accent:hover {
  background-color: #b57a4f;
  transform: translateY(-1px);
}

.form-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 22px;
}

/* Language switch pill */

.lang-switch {
  background: #ffffffcc;
  backdrop-filter: blur(4px);
  border: 1px solid #e5e7eb;
  border-radius: 9999px;
  padding: 6px 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,.06);
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin: 10px auto 14px;
}

.lang-switch .lang {
  text-decoration: none;
  font-size: 14px;
  color: #111827;
  padding: 4px 10px;
  border-radius: 9999px;
  transition: background-color .2s ease, transform .1s ease, color .2s;
}

.lang-switch .lang:hover {
  background: #f3f4f6;
  transform: translateY(-1px);
}

.lang-switch .lang.active {
  background: var(--primary);
  color: #fff;
}

.lang-switch .sep {
  color: #9ca3af;
}

/* Counter rows (Section 2) */

.counter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 600px;
}

.counter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.counter-label {
  flex: 1;
  font-size: 0.95rem;
  color: #111827;
}

.counter-controls {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.counter-input {
  width: 70px;
  text-align: center;
  padding: 4px 6px;
  border-radius: 4px;
  border: 1px solid #ced4da;
  font-size: 14px;
}

.counter-btn {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  cursor: pointer;
  line-height: 1;
  font-size: 16px;
}

.counter-btn:hover {
  background: #e5e7eb;
}

/* Tables (Section 3 mode-of-transport) */

.table-responsive {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 14px;
  font-size: 0.9rem;
}

th,
td {
  padding: 8px 8px;
  text-align: center;
  border: 1px solid #dee2e6;
}

th {
  background-color: var(--primary);
  color: #fff;
  font-weight: 500;
}

tr:nth-child(even) {
  background-color: #f8f9fa;
}

tr:hover {
  background-color: #eef2f7;
}

/* Mode tables */

.mode-block {
  margin-top: 16px;
}

.mode-label-prefix {
  font-weight: 600;
  margin-inline-end: 4px;
}

.mode-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.mode-table th,
.mode-table td {
  border: 1px solid #dee2e6;
  padding: 4px 6px;
  text-align: center;
  vertical-align: middle;
}

.mode-table th:first-child,
.mode-table td:first-child {
  text-align: left;
  white-space: nowrap;
}

.slot-input {
  width: 60px;
  padding: 3px;
  text-align: center;
  border-radius: 4px;
  border: 1px solid #ced4da;
}

/* Row tinting helpers (if used) */

tr.row-depart td {
  background: var(--depart-bg) !important;
}

tr.row-return td {
  background: var(--return-bg) !important;
}

tr.row-depart:hover td {
  background: var(--depart-bg) !important;
}

tr.row-return:hover td {
  background: var(--return-bg) !important;
}

tr.row-depart input[type="number"] {
  border-color: var(--depart-bd);
}

tr.row-return input[type="number"] {
  border-color: var(--return-bd);
}

/* Legend badges (if needed) */

.table-legend {
  display: flex;
  gap: 8px;
  margin: 8px 0 10px;
  font-size: 12px;
}

.badge-key {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
}

.badge-key.badge-depart {
  color: var(--depart-txt);
  background: var(--depart-bg);
  border-color: var(--depart-bd);
}

.badge-key.badge-return {
  color: var(--return-txt);
  background: var(--return-bg);
  border-color: var(--return-bd);
}

/* Colored word wrappers (if you later wrap labels) */

.key-leaving {
  color: var(--depart-txt);
  font-weight: 600;
}

.key-arriving {
  color: var(--return-txt);
  font-weight: 600;
}

/* Section 3 help button & modal */

.section3-help-btn {
    margin-left: 4px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--depart-txt);
    color: #fff;
    font-size: 20px;
    line-height: 28px;
    text-align: center;
    cursor: pointer;
    padding: 0;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.section3-help-btn:hover {
    background: #0056b3;
    box-shadow: 0 0 0 4px rgba(0, 86, 179, 0.15);
}

/* Flash / pulse + mouse hint when we want to attract attention */
.section3-help-btn.section3-help-pulse {
    animation: section3-help-pulse 0.9s ease-in-out infinite;
    box-shadow: 0 0 0 4px rgba(0, 86, 179, 0.18);
}

/* Little mouse icon nudging toward the button */
.section3-help-btn.section3-help-pulse::after {
    content: '🖱';
    position: absolute;
    right: -18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    opacity: 0;
    animation: mouse-wiggle 0.9s ease-in-out infinite;
}

/* Pulse animation */
@keyframes section3-help-pulse {
    0% {
        transform: scale(1);
        background: var(--depart-txt);
    }
    40% {
        transform: scale(1.12);
        background: #0056b3;
    }
    100% {
        transform: scale(1);
        background: var(--depart-txt);
    }
}

/* Mouse wiggle / fade animation */
@keyframes mouse-wiggle {
    0% {
        opacity: 0;
        transform: translate(4px, -50%);
    }
    40% {
        opacity: 1;
        transform: translate(0, -50%);
    }
    100% {
        opacity: 0;
        transform: translate(4px, -50%);
    }
}


.tooltip-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1050;
  justify-content: center;
  align-items: center;
  padding: 16px;
}

.tooltip-modal-content {
  background: #fff;
  max-width: 900px;
  width: 100%;
  padding: 20px 24px;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  direction: ltr;
}

html[dir="rtl"] .tooltip-modal-content {
  direction: rtl;
  text-align: right;
}

.tooltip-close {
  position: absolute;
  top: 8px;
  right: 10px;
  border: none;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}

/* Inputs inside modal table match main style */

.tooltip-modal-content table.mode-table th,
.tooltip-modal-content table.mode-table td {
  padding: 4px 6px;
}

/* Responsive */

@media (max-width: 768px) {
  .container {
    padding: 15px;
  }

  header {
    padding: 22px;
  }

  .form-section {
    padding: 18px 14px 16px;
  }

  table,
  .mode-table {
    font-size: 0.78rem;
  }

  th,
  td {
    padding: 6px 6px;
  }

  .form-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }
}
