/*  Copyright (c) 2026 Kasper Sjöström. All rights reserved. License: AGPL-3.0 license. www.kswebb.se - Thanks to Gemini for helping me out with this project. */
/* Globala inställningar och variabler */
:root {
  --bg-main: #f5f5f4;
  --text-dark: #292524;
  --text-light: #484441;
  --border-color: #e7e5e4;
  --card-bg: #ffffff;

  --emerald-light: #d1fae5;
  --emerald-main: #059669;
  --emerald-dark: #047857;

  --sky-light: #e0f2fe;
  --sky-main: #0284c7;
  --sky-dark: #0369a1;

  --stone-dark: #292524;
  --stone-hover: #44403c;

  --btn-text-dark: #035e41;
  --btn-text-light: #ffffff;
  --btn-bg: #04583d;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  background-color: var(--bg-main);
  color: var(--text-dark);
  animation: fadeIn 0.4s ease-in-out;
  overflow-y: scroll;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.lead {
  font-size: 1.1rem;
  color: var(--text-light);
  text-align: center;
  margin-bottom: 2rem;
}

.site-footer {
  margin-top: 60px;
  text-align: center;
  font-size: 14px;
  color: #546e7a;
  border-top: 1px solid #cfd8dc;
  padding-top: 20px;
  padding-bottom: 20px;
}

/* Layout och Containrar */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem;
}
.mobile-container {
  max-width: 600px;
  margin: 0 auto;
  background-color: var(--card-bg);
  min-height: 100vh;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  padding-bottom: 5rem;
}

/* Flexbox hjälp-klasser */
.flex-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.flex-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.space-between {
  justify-content: space-between;
}
.align-start {
  align-items: flex-start;
}
.w-full {
  width: 100%;
}
.hidden {
  display: none !important;
}

/* Kort / Paneler */
.panel {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

/* Typografi */
h1 {
  font-size: 1.8rem;
  color: var(--emerald-dark);
  margin-bottom: 0.2rem;
  text-align: center;
}
h2 {
  font-size: 1.3rem;
  text-align: center;
  font-weight: 600;
  color: var(--emerald-dark);
  margin-top: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-color);
  letter-spacing: -0.01em;
}
p {
  color: var(--text-light);
}
.text-center {
  text-align: center;
}

/* Knappar */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s;
}
.btn-dark {
  background-color: var(--stone-dark);
  color: white;
  margin-top: 1rem;
}
.btn-dark:hover {
  background-color: var(--stone-hover);
}
.btn-emerald {
  background-color: var(--btn-bg);
  color: var(--btn-text-light);
  width: 100%;
}
.btn-emerald:hover {
  background-color: var(--emerald-dark);
}
.btn-sky {
  background-color: var(--sky-main);
  color: white;
  width: 100%;
}
.btn-sky:hover {
  background-color: var(--sky-dark);
}
.btn-tab {
  flex: 1;
  padding: 0.75rem;
  background-color: var(--stone-hover);
  color: white;
  font-size: 1rem;
}
.btn-tab.active {
  background-color: var(--emerald-main);
}

/* Formulär */
.form-box {
  padding: 1rem;
  border-radius: 0.5rem;
  flex: 1;
}
.form-box.emerald {
  background-color: var(--emerald-light);
  border: 1px solid #a7f3d0;
}
.form-box.sky {
  background-color: var(--sky-light);
  border: 1px solid #bae6fd;
}
.form-box h2.emerald {
  color: var(--emerald-dark);
}
.form-box h2.sky {
  color: var(--sky-dark);
}

input[type="text"],
input[type="number"],
select {
  padding: 0.5rem;
  border: 1px solid #d6d3d1;
  border-radius: 0.25rem;
  font-size: 0.9rem;
  background-color: white;
}
.input-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

/* Tabell (Startsidan) */
.table-responsive {
  overflow-x: auto;
  border-radius: 0.5rem;
  border: 1px solid var(--border-color);
}
table {
  width: 100%;
  border-collapse: collapse;
  background-color: white;
  white-space: nowrap;
}
th {
  background-color: var(--stone-dark);
  color: white;
  padding: 1rem;
  text-align: left;
  font-weight: 600;
}
td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}
tr:hover td {
  background-color: #fafaf9;
}
.table-input {
  width: 80px;
  text-align: center;
  border: 1px solid transparent;
  background: transparent;
  transition: 0.2s;
}
.table-input:hover,
.table-input:focus {
  background: white;
  border-color: var(--border-color);
}
.table-select {
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
}
.table-select:hover {
  border-color: var(--border-color);
  background: white;
}

/* Busslistan (Mobil) */
.header-mobile {
  background-color: var(--stone-dark);
  color: white;
  padding: 1.25rem;
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-mobile-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.header-mobile h1 {
  color: white;
  margin: 0;
  font-size: 1.2rem;
}
.tab-container {
  display: flex;
  gap: 0.5rem;
}
.bus-list {
  padding: 1rem;
}
.bus-list ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.bus-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem;
  border-radius: 0.75rem;
  cursor: pointer;
  background-color: #fafaf9;
  border: 2px solid var(--border-color);
  transition: all 0.2s;
  user-select: none;
  -webkit-user-select: none;
}
.bus-item:active {
  transform: scale(0.98);
}
.bus-item.checked {
  background-color: #ecfdf5;
  border-color: #34d399;
}
.bus-item-name {
  font-size: 1.1rem;
  font-weight: 600;
}
.bus-item input[type="checkbox"] {
  pointer-events: none;
  width: 1.5rem;
  height: 1.5rem;
}

/* Status text (Buss) */
.status-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 1rem;
  padding: 0 0.5rem;
}
.status-badge {
  background-color: var(--emerald-light);
  color: var(--emerald-dark);
  font-weight: bold;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.9rem;
}

/* Generell Checkbox styling */
input[type="checkbox"] {
  cursor: pointer;
  width: 1.25rem;
  height: 1.25rem;
  accent-color: var(--emerald-main);
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(41, 37, 36, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 1;
  transition: opacity 0.2s;
}
.modal-overlay.hidden {
  display: none !important;
  opacity: 0;
}

.modal-content {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: 0.75rem;
  width: 90%;
  max-width: 400px;
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-light);
  padding: 0.25rem;
  transition: color 0.2s;
}

.close-btn:hover {
  color: var(--text-dark);
}

.fc-event {
  cursor: pointer;
  border: none !important;
  border-radius: 4px;
  padding: 2px 4px;
}
.fc-event:hover {
  opacity: 0.9;
}

.fc .fc-list-day-cushion {
  background-color: var(--bg-main) !important;
  color: var(--stone-dark) !important;
  font-weight: bold;
}

.fc .fc-list-event:hover td {
  background-color: #fafaf9 !important;
}

.fc-theme-standard .fc-list {
  border-color: var(--border-color) !important;
}

.fc .fc-toolbar-title {
  font-size: 1.2rem;
  color: var(--stone-dark);
  font-weight: bold;
}

.fc .fc-button-primary {
  background-color: var(--stone-dark) !important;
  border: none !important;
  text-transform: capitalize;
}
.fc .fc-button-primary:hover {
  background-color: var(--stone-hover) !important;
}

.fc .fc-button-active {
  background-color: var(--emerald-main) !important;
}

.activity-panel {
  margin-bottom: 0;
}

.activity-title {
  color: var(--emerald-dark);
  margin-bottom: 0.25rem;
  font-size: 1.2rem;
  border-bottom: none;
  text-transform: none;
  text-align: left;
  margin-top: 0;
}

.activity-time {
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-dark);
}

.activity-desc {
  margin-bottom: 1rem;
}

.activity-status-container {
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.status-full {
  color: #dc2626;
  font-weight: 600;
}

.status-open {
  color: var(--emerald-dark);
  font-weight: 600;
}

/* --- Mobilanpassning för Kalendern --- */
@media (max-width: 768px) {
  .fc .fc-header-toolbar {
    flex-direction: column;
    gap: 0.75rem;
  }

  .fc .fc-toolbar-title {
    font-size: 1.1rem !important;
  }

  .fc .fc-button {
    padding: 0.3rem 0.6rem !important;
    font-size: 0.85rem !important;
  }

  .fc-event-title {
    white-space: normal !important;
    line-height: 1.2;
    overflow: visible !important;
  }

  .fc-event {
    font-size: 0.75rem !important;
    padding: 2px !important;
  }

  .fc .fc-daygrid-day-number {
    font-size: 0.8rem;
    padding: 2px;
  }

  body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  background-color: var(--bg-main);
  color: var(--text-dark);
  animation: fadeIn 0.4s ease-in-out;
}
}