/* Återställning och globala stilar */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    avenir next,
    avenir,
    segoe ui,
    helvetica neue,
    Adwaita Sans,
    Cantarell,
    Ubuntu,
    roboto,
    noto,
    helvetica,
    arial,
    sans-serif;
  background-color: #ccccc2; /* Mycket ljus grå */
  color: #333;
}

/* Header och profilsektion */
header {
  background-color: #f3f3ef;
  color: #121213;
  padding: 15px 30px;
}
.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.site-title {
  font-size: 28px;
  font-weight: 700;
}
.logo {
  width: 60px;
  height: auto;
  margin-right: 15px;
}

#user-profile {
  display: flex;
  align-items: center;
}
#profile-pic {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-right: 10px;
  border: 2px solid #ffffff;
}
#profile-details {
  display: flex;
  flex-direction: column;
  margin-right: 10px;
}
.btn-logout {
  padding: 5px 12px;
  background-color: #cc0000;
  border: none;
  border-radius: 4px;
  color: #ffffff;
  cursor: pointer;
  transition: background-color 0.3s ease;
}
.btn-logout:hover {
  background-color: #a30000;
}
#login-link {
  padding: 5px 12px;
  background-color: #4ec752;
  color: #ffffff;
  text-decoration: none;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}
#login-link:hover {
  background-color: #57ff65;
}

/* Navigation – delas upp i tre sektioner */
.navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #f3f3ec;
  border-bottom: 22px solid #f3f3ec;
  padding: 0 10px;
}

/* Vänstersida: "Idag"-knapp och datumväljare */
.nav-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
#today-btn {
  background-color: #ffffff;
  border: 1px solid #ccc;
  padding: 10px 15px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
}
#today-btn:hover {
  background-color: #fdd0cc;
}
.nav-date-picker {
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 5px;
  background-color: #ffffff;
  color: #000;
  width: 140px;
  font-size: 16px;
}

/* Center: Navigeringspilar och veckolabel */
.nav-center {
  display: flex;
  align-items: center;
}
.nav-btn {
  background-color: #ffe5e3;
  color: #000000;
  border: none;
  padding: 10px 15px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}
.nav-btn:hover {
  background-color: #fdd0cc;
}
.week-label {
  font-size: 20px;
  font-weight: 700;
  margin: 0 10px;
}

/* Höger: Skaparfiltret */
.nav-right {
  display: flex;
  align-items: center;
}
#user-filter {
  padding: 5px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 16px;
}

/* Kalender och layout */
.calendar-wrapper {
  display: flex;
  gap: 20px;
  padding: 20px;
}
#calendar-grid {
  flex: 3;
  overflow: auto;
  height: 600px;
  background-color: #ffffff;
  border: 1px solid #ddd;
  position: relative;
}
.sidebar {
  flex: 1;
  border-left: 1px solid #ddd;
  padding-left: 20px;
}
#week-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
#week-table th,
#week-table td {
  border: 1px solid #bbb;
  padding: 5px;
  text-align: center;
}
.time-header,
.time-label {
  background-color: #f0f0f0;
  font-weight: 700;
}
.day-header {
  min-width: 100px;
  padding: 10px;
  position: relative;
}
/* I den stora kalendern ska den dag som är idag markeras med en ljusröd bakgrund */
.day-header.today {
  background-color: #ffcccc;
}
#week-table thead th {
  position: sticky;
  top: 0;
  background-color: #f0f0f0;
  z-index: 2;
}
.cell {
  position: relative;
  height: 40px;
}

/* Sidebar – mini kalender, skapa-knapp och händelselista */
.mini-calendar {
  display: flex;
  overflow-x: auto;
  white-space: nowrap;
  margin-bottom: 10px;
}
.mini-calendar > :last-child {
  margin-right: 0;
}
.mini-week {
  flex: 0 0 auto;
  /* min-width: 80px; */
  width: calc(20% - 4px);
  background-color: #e0e0e0;
  padding: 5px;
  margin-right: 5px;
  border-radius: 4px;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.3s ease;
}
.mini-week.active {
  background-color: #ff534a;
  color: #ffffff;
}
.create-btn {
  width: 100%;
  padding: 10px;
  background-color: #92928e;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin-bottom: 10px;
  transition: background-color 0.3s ease;
}
.create-btn:hover {
  background-color: #606060;
}
.events-container {
  border: 1px solid #ddd;
  background-color: #ffffff;
  padding: 10px;
  max-height: 300px;
  overflow-y: auto;
}
.event-item {
  border: 1px solid #ddd;
  background-color: #f0f0f0;
  padding: 8px;
  margin-bottom: 5px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}
.event-item:hover {
  background-color: #e0e0e0;
}

/* Händelser i kalendern */
.event {
  cursor: pointer;
  position: absolute;
  color: #ffffff;
  font-size: 12px;
  background-color: #005a9c;
  border: 1px solid #004880;
  border-radius: 4px;
  padding: 2px;
  overflow: hidden;
  transition: opacity 0.3s ease;
  z-index: 10;
}

/* Teams-knapp i modal */
.teams-btn {
  color: #ffffff;
  border: none;
  border-radius: 3px;
  padding: 2px 5px;
  font-size: 10px;
  margin-left: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}
.teams-btn:hover {
  background-color: #d3d3d3;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 10;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}
.modal-content {
  background-color: #ffffff;
  margin: 10% auto;
  padding: 20px;
  border-radius: 8px;
  max-width: 500px;
  position: relative;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.modal-content h2 {
  margin-bottom: 15px;
  font-weight: 700;
}
.modal-content label {
  display: block;
  margin: 10px 0 5px;
}
.modal-content input,
.modal-content textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
}
.modal-buttons {
  margin-top: 20px;
  text-align: right;
}
.modal-buttons button {
  padding: 8px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}
.btn-delete {
  background-color: #ca0000;
  color: #ffffff;
  margin-right: 10px;
}
.btn-delete:hover {
  background-color: #a30000;
}
.btn-save {
  background-color: #00b318;
  color: #ffffff;
}
.btn-save:hover {
  background-color: #198900;
}
.close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 24px;
  cursor: pointer;
}

/* Login-sida */
.login-wrapper {
  position: relative;
  width: 90%;
  max-width: 500px;
  margin: 100px auto;
  background-color: #ffffff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 30px;
  text-align: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.login-logo {
  width: 100px;
  height: auto;
  position: absolute;
  top: 15px;
  right: 15px;
}
.login-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 20px;
}
.login-btn,
.view-btn {
  padding: 10px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  width: 100%;
  max-width: 300px;
  transition: background-color 0.3s ease;
}
.login-btn {
  color: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-btn:hover {
  background-color: #cdcdcd;
}
.login-btn .logo {
  width: 24px;
  height: 24px;
  margin-right: 8px;
}
.view-btn {
  color: #000000;
}
.view-btn:hover {
  background-color: #cdcdcd;
}

/* Responsiv design – för mobila enheter */

@media (max-width: 768px) {
  /* Anpassa headern */
  header {
    padding: 10px 15px;
  }
  .header-container {
    flex-direction: column;
  }
  /* Stapla navigationen */
  .navigation {
    flex-direction: column;
    gap: 10px;
    padding: 10px;
  }
  .nav-left,
  .nav-center,
  .nav-right {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
  /* På mobil vill vi inte visa den stora kalendern, endast sammanfattningen */
  #calendar-grid {
    display: none;
  }
  .calendar-wrapper {
    flex-direction: column;
    gap: 10px;
    padding: 10px;
  }
  .sidebar {
    border: none;
    padding-left: 0;
  }

  .mini-week {
    width: calc(20% - 4px); /* Minska bredden så att alla rutor syns */
    font-size: 14px;
    text-indent: -9999px; /* Döljer den ursprungliga texten */
    position: relative;
  }
  .mini-week::before {
    content: "v. " attr(data-week); /* Visa kort text */
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    text-align: center;
    color: #000;
    text-indent: 0;
  }
}

.teams-icon {
  width: 24px;
}
