/* ==========================================================================
   Schengen Calculator — The Road Two Spoons
   ========================================================================== */

/* Tabs */
.schengen-tabs {
  display: flex;
  gap: var(--space-2);
  border-bottom: 2px solid var(--color-border);
  margin-bottom: var(--space-7);
}

.schengen-tab {
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: var(--weight-semibold);
  color: var(--color-text);
  padding: var(--space-3) var(--space-5);
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: color 150ms ease, border-color 150ms ease;
}

@media (max-width: 600px) {
  .schengen-tabs {
    gap: 0;
  }
  .schengen-tab {
    flex: 1;
    padding: var(--space-3) var(--space-2);
    font-size: var(--text-small);
    text-align: center;
  }
}

.schengen-tab:hover {
  color: var(--color-text);
}

.schengen-tab.active {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

/* Panels */
.schengen-panel {
  display: none;
  padding-bottom: var(--space-9);
  overflow: hidden;
}

.schengen-panel.active {
  display: block;
}

/* ==========================================================================
   Dashboard
   ========================================================================== */

.sc-dashboard {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

@media (min-width: 768px) {
  .sc-dashboard {
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  }
}

.sc-dashboard__card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  text-align: center;
}

.sc-dashboard__label {
  display: block;
  font-family: var(--font-body);
  font-size: var(--text-small);
  font-weight: var(--weight-semibold);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-2);
}

.sc-dashboard__number {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-h2);
  line-height: var(--leading-tight);
  color: var(--color-text);
}

.sc-dashboard__card--remaining .sc-dashboard__number {
  color: var(--color-accent);
}

/* Gauge */
.sc-gauge {
  margin-bottom: var(--space-7);
}

.sc-gauge__bar {
  height: 12px;
  background: var(--color-surface);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.sc-gauge__fill {
  height: 100%;
  background: var(--color-accent);
  border-radius: var(--radius-pill);
  transition: width 250ms ease;
}

.sc-gauge__fill--warning {
  background: #e8a317;
}

.sc-gauge__fill--danger {
  background: #d94040;
}

.sc-gauge__labels {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

/* Warning */
#sc-warnings {
  margin-bottom: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.sc-warning {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: #fef3cd;
  border: 1px solid #e8a317;
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-small);
  color: #856404;
}

.sc-warning svg {
  flex-shrink: 0;
  color: #e8a317;
}

/* Max stay */
.sc-max-stay {
  font-size: var(--text-small);
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
  text-align: center;
}

/* ==========================================================================
   Calendar
   ========================================================================== */

.sc-calendar {
  margin-bottom: var(--space-7);
}

.sc-calendar__header {
  margin-bottom: var(--space-4);
}

.sc-calendar__title {
  font-family: var(--font-display);
  font-size: var(--text-h3);
  margin-bottom: var(--space-1);
}

.sc-calendar__subtitle {
  font-size: var(--text-small);
  color: var(--color-text-muted);
}

.sc-calendar__grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.sc-month__label {
  font-size: var(--text-small);
  font-weight: var(--weight-semibold);
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.sc-month__days {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.sc-day {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--color-text-muted);
  background: var(--color-white);
  border: 1px solid var(--color-border);
}

@media (min-width: 768px) {
  .sc-day {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }
}

.sc-day--schengen {
  background: var(--color-accent);
  color: var(--color-white);
  border-color: var(--color-accent);
}

.sc-day--nonschengen {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
}

.sc-day--planned {
  background: var(--color-accent);
  color: var(--color-white);
  border-color: var(--color-accent);
  opacity: 0.5;
}

.sc-day--today {
  border: 2px solid var(--color-text);
  font-weight: var(--weight-semibold);
}

.sc-calendar__legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-top: var(--space-4);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.sc-calendar__legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.sc-calendar__dot {
  width: 12px;
  height: 12px;
  border-radius: var(--radius-sm);
}

.sc-calendar__dot--schengen {
  background: var(--color-accent);
}

.sc-calendar__dot--nonschengen {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}

.sc-calendar__dot--planned {
  background: var(--color-accent);
  opacity: 0.5;
}

.sc-calendar__dot--today {
  background: var(--color-white);
  border: 2px solid var(--color-text);
}

/* ==========================================================================
   Trip Form & List
   ========================================================================== */

.sc-section-title {
  font-family: var(--font-display);
  font-size: var(--text-h2);
  margin-bottom: var(--space-5);
}

.sc-add-trip {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-6);
  overflow: hidden;
}

.sc-add-trip__row {
  margin-bottom: var(--space-4);
}

.sc-add-trip__row:last-child {
  margin-bottom: 0;
}

.sc-add-trip__row--dates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.sc-add-trip__row--country-dates {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

@media (min-width: 768px) {
  .sc-add-trip__row--country-dates {
    grid-template-columns: 2fr 1fr 1fr;
  }
}

@media (max-width: 767px) {
  .sc-add-trip__row--country-dates .sc-field:not(.sc-field--country) {
    width: 50%;
  }
}

.sc-field__select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%236b6b6b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-4) center;
  padding-right: var(--space-8);
}

.sc-add-trip__row--options {
  display: flex;
  gap: var(--space-5);
  flex-wrap: wrap;
}

.sc-field {
  min-width: 0;
  overflow: hidden;
}

.sc-field__label {
  display: block;
  font-size: var(--text-small);
  font-weight: var(--weight-semibold);
  color: var(--color-text);
  margin-bottom: var(--space-1);
}

.sc-field__input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 48px;
  padding: 0 var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 48px;
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  transition: border-color 150ms ease;
}

input[type="date"].sc-field__input {
  -webkit-appearance: none;
  appearance: none;
  min-height: 48px;
}


.sc-field__input:focus {
  outline: none;
  border-color: var(--color-accent);
}

.sc-checkbox {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-small);
  cursor: pointer;
}

.sc-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-accent);
}

.sc-form-error {
  background: #fde8e8;
  border: 1px solid #d94040;
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  margin-top: var(--space-4);
  font-size: var(--text-small);
  color: #991b1b;
}

.sc-trips {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.sc-trip {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  overflow: hidden;
}

.sc-trip__display {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.sc-trip--planned {
  border-style: dashed;
  opacity: 0.75;
}

.sc-trip__info {
  flex: 1;
  min-width: 0;
}

.sc-trip__name {
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-1);
}

.sc-trip__dates {
  font-size: var(--text-small);
  color: var(--color-text-muted);
}

.sc-trip__days {
  font-family: var(--font-display);
  font-size: var(--text-h3);
  color: var(--color-accent);
  white-space: nowrap;
}

.sc-trip--nonschengen .sc-trip__days {
  color: var(--color-text-muted);
}

.sc-trip__badge {
  display: inline-block;
  font-size: var(--text-xs);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text-muted);
  white-space: nowrap;
  margin-top: var(--space-1);
}

.sc-trip__badge--schengen {
  background: #e0f5f5;
  color: var(--color-accent-dark);
}

.sc-trip__badge--planned {
  background: #fef3cd;
  color: #856404;
}

.sc-trip__badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-top: var(--space-1);
}

.sc-trip__meta {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-shrink: 0;
}

.sc-trip__actions {
  display: flex;
  gap: var(--space-1);
  flex-shrink: 0;
}

.sc-trip__edit,
.sc-trip__delete {
  color: var(--color-text-muted);
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  transition: color 150ms ease;
}

.sc-trip__edit:hover {
  color: var(--color-accent);
}

.sc-trip__delete:hover {
  color: #d94040;
}

/* Inline edit form */
.sc-trip__edit-form {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}

.sc-trip__edit-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.sc-trip__edit-actions {
  display: flex;
  gap: var(--space-3);
}

.sc-edit-cancel {
  font-size: var(--text-small);
  color: var(--color-text-muted);
  padding: var(--space-2) var(--space-4);
}

.sc-trips-empty {
  text-align: center;
  padding: var(--space-7) var(--space-5);
  color: var(--color-text-muted);
  font-size: var(--text-small);
}

.sc-trips {
  margin-bottom: var(--space-7);
}

.sc-disclaimer {
  margin-top: var(--space-7);
  font-size: var(--text-small);
  color: var(--color-text-muted);
  line-height: var(--leading-normal);
}

/* ==========================================================================
   Country Guide
   ========================================================================== */

.sc-intro {
  color: var(--color-text);
  margin-bottom: var(--space-5);
  max-width: var(--width-content);
}

.sc-country-group {
  margin-bottom: var(--space-6);
}

.sc-country-group__title {
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-3);
}

.sc-country-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.sc-country {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-small);
}

.sc-callout {
  background: #e0f5f5;
  border-left: 4px solid var(--color-accent);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  margin: var(--space-6) 0;
  font-size: var(--text-small);
  line-height: var(--leading-normal);
}

.sc-callout--warning {
  background: #fef3cd;
  border-left-color: #e8a317;
}

.sc-country-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-7);
}

@media (min-width: 768px) {
  .sc-country-cards {
    grid-template-columns: 1fr 1fr;
  }
}

.sc-country-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.sc-country-card h4 {
  font-family: var(--font-display);
  font-size: var(--text-h3);
  margin-bottom: var(--space-2);
}

.sc-country-card p {
  font-size: var(--text-small);
  color: var(--color-text-muted);
  line-height: var(--leading-normal);
}

.sc-alt-table {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--space-6);
}

.sc-alt-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-1);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-border);
  font-size: var(--text-small);
}

@media (min-width: 768px) {
  .sc-alt-row {
    grid-template-columns: 1.5fr 1fr 2fr;
    gap: var(--space-4);
  }
}

.sc-alt-row:last-child {
  border-bottom: none;
}

.sc-alt-row--header {
  background: var(--color-surface);
  font-weight: var(--weight-semibold);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}

@media (max-width: 767px) {
  .sc-alt-row--header {
    display: none;
  }

  /* Reduce nested padding so date inputs fit */
  .sc-add-trip {
    padding: var(--space-3);
  }

  /* Trip card: 4-line stack on mobile */
  .sc-trip {
    padding: var(--space-3);
  }

  .sc-trip__display {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }

  .sc-trip__info {
    flex: none;
    width: 100%;
  }

  .sc-trip__meta {
    width: 100%;
    justify-content: space-between;
  }

  .sc-trip__days {
    font-size: var(--text-body);
  }

  /* Edit form: stack date fields, half width */
  .sc-trip__edit-fields {
    grid-template-columns: 1fr;
  }
  .sc-trip__edit-fields .sc-field {
    width: 50%;
  }
}

.sc-alt-country {
  font-weight: var(--weight-semibold);
  color: var(--color-text);
}

/* ==========================================================================
   How It Works Article
   ========================================================================== */

.sc-article h2 {
  font-family: var(--font-display);
  font-size: var(--text-h2);
  margin: var(--space-7) 0 var(--space-4);
}

.sc-article h2:first-child {
  margin-top: 0;
}

.sc-article h3 {
  font-family: var(--font-body);
  font-size: var(--text-h3);
  font-weight: var(--weight-semibold);
  margin: var(--space-5) 0 var(--space-2);
}

.sc-article p {
  margin-bottom: var(--space-4);
  line-height: var(--leading-relaxed);
}

.sc-article strong {
  font-weight: var(--weight-semibold);
}

/* ==========================================================================
   Print
   ========================================================================== */

@media print {
  .header, .nav-drawer, .nav-overlay, .footer,
  .sc-trip__delete, #add-trip-form, .schengen-tabs,
  .header__search, .header__burger {
    display: none !important;
  }

  .schengen-panel {
    display: block !important;
    padding-bottom: var(--space-5);
  }
}
