body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh; /* Ändrat från height till min-height för bättre hantering av innehåll */
    background-color: #f4f4f9;
    background-image: url('../data/BG.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow-x: hidden; /* Förhindra horisontell scroll */
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    text-align: center;
}

.header {
    background-color: #007bff;
    color: white;
    padding: 20px;
    width: 100%;
}

.title {
    font-size: 2em;
    margin: 0;
}

.employee-list {
    list-style-type: none;
    padding: 0;
    margin: 20px 0;
    width: 100%;
}

.employee-item {
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 15px;
    margin: 10px 0;
    transition: background-color 0.3s;
}

.employee-item:hover {
    background-color: #f1f1f1;
}

.footer {
    margin-top: auto;
    padding: 10px;
    background-color: #007bff;
    color: white;
    width: 100%;
}

#app {
    text-align: center;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 90%; /* Ökar från 80% till 90% för bättre användning av skärmutrymme */
    max-width: 1080px;
    margin: 20px auto; /* Center the white box horizontally */
    box-sizing: border-box; /* Säkerställer att padding inte adderar till totalbredden */
}


#main {
    text-align: center;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 90%; /* Ökar från 80% till 90% för bättre användning av skärmutrymme */
    max-width: 1080px;
    margin: 20px auto; /* Center the white box horizontally */
    box-sizing: border-box; /* Säkerställer att padding inte adderar till totalbredden */
}



h1 {
    color: #333;
    margin-bottom: 20px;
    font-size: 2rem;
    word-wrap: break-word; /* Tillåter brytning av långa ord */
    hyphens: auto; /* Aktiverar avstavning */
}

#schedule {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    justify-items: center;
    align-items: start;
}

.worker {
    padding: 15px; /* Ökar padding för bättre läsbarhet */
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #e0ffe0;
    font-size: 2rem; /* Gör namnet större */
    display: flex;
    flex-direction: column;
    align-items: center; /* Centrerar texten i varje ruta */
    justify-content: center; /* Centrerar innehållet vertikalt */
    height: 150px; /* Sätter en fast höjd för alla rutor */
    width: 100%; /* Gör rutorna lika breda som kolumnen */
    box-sizing: border-box; /* Inkluderar padding och border i bredd och höjd */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Lägger till subtil skugga för djupeffekt */
    transition: box-shadow 0.3s ease; /* Mjuk övergång för skuggan */
    position: relative; /* Lägg till för att kunna positionera stämpeln absolut inuti rutan */
    overflow: hidden; /* Håll stämpeln inom rutans gränser */
}

.worker:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15); /* Större skugga vid hover för interaktionseffekt */
}

/* Stil för stämpeln som visas över rutan */
.worker .stamp {
    position: absolute;
    top: 0.7em;
    right: -2.8em; /* Moved further out to allow more width */
    transform: rotate(22deg);
    background-color: #e67e22;
    color: white;
    padding: 4px 44px; /* Increased horizontal padding for longer text */
    font-size: 1.05rem; /* Slightly smaller for better fit */
    font-weight: bold;
    box-shadow: 0 0 5px rgba(0,0,0,0.18);
    z-index: 10;
    text-transform: uppercase;
    border-radius: 6px;
    pointer-events: none;
    opacity: 0.93;
    border: 2px solid #fffbe6;
    white-space: nowrap;
    overflow: visible; /* Allow text to overflow banner if needed */
    text-overflow: ellipsis;
    max-width: 220px; /* Prevents excessive overflow, adjust as needed */
}

.worker .stamp.sick-stamp {
    background: #444 !important;
    color: #fff !important;
    border: 2px solid #fffbe6;
    text-transform: uppercase;
    font-weight: bold;
    opacity: 0.93;
    top: 0.4em;
    right: 0.4em;
    position: absolute;
    transform: none;
    padding: 2px 10px;
    font-size: 0.95rem;
    z-index: 10;
    pointer-events: none;
    letter-spacing: 0.04em;
}

@media (max-width: 600px) {
  .worker .stamp.sick-stamp {
    font-size: 0.8rem;
    padding: 1.5px 7px;
    right: 0.4em;
    top: 0.4em;
  }
}

.worker .time {
    font-size: 1rem; /* Gör tiden mindre */
    color: #555; /* Gör tiden lite ljusare */
}

.worker.gone {
    background-color: #ffe0e0 !important;
    text-decoration: line-through;
}

.worker.lock-time {
    background-color: #9edbb2; /* Ljusblå bakgrund för arbetare med låsttid */
}

/* När en arbetare med låsttid har gått hem */
.worker.lock-time.gone {
    background-color: #ffe0e0 !important;
    text-decoration: line-through;
}

/* Popup-stil */
.popup {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: white;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 10px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.popup.hidden {
    display: none;
}

.popup-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.date-navigation {
    display: flex;
    flex-direction: column; /* Stack children vertically */
    align-items: center;
    justify-content: center;
    width: 90%;
    max-width: 1080px;
    margin: 1.5rem auto 0.5rem auto;
    background: none !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0;
    position: relative;
    z-index: 2;
    gap: 0.2em;
}

.date-navigation-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 0.7em;
    background: none !important;
    box-shadow: none !important;
    border: none !important;
}

#red-day-name {
    font-size: 1.1rem;
    font-weight: bold;
    margin-top: 0.2em;
    color: #e74c3c;
    text-align: center;
}

.date-navigation h1 {
    margin: 0 0.2em;
    font-size: 1.1rem; /* Normal storlek på desktop */
    font-weight: 500;
    line-height: 1.1;
    white-space: nowrap; /* Ingen radbrytning */
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 95vw;
    background: none;
    color: #333;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

.date-nav-button.minimal {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    font-size: 2rem;
    padding: 0.5em 1.2em; /* Make button area much larger for touch */
    border-radius: 50%;
    min-width: 48px;
    min-height: 48px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.date-nav-button.minimal:active, .date-nav-button.minimal:focus {
    background: #f0f0f0;
    outline: none;
}

@media (max-width: 1080px) {
  .date-navigation {
    width: 95%;
    max-width: 95vw;
  }
  #app {
    width: 95%;
    max-width: 95vw;
  }
}

@media screen and (max-width: 600px) {
  .date-navigation {
    margin-top: 1.1rem;
    margin-bottom: 0.3rem;
    gap: 0.1em;
    width: 99%;
    max-width: 99vw;
  }
  .date-navigation-row {
    gap: 0.4em;
  }
  .date-navigation h1 {
    font-size: 1.5rem !important; /* Mindre på mobil, tvingas med !important */
    margin: 0 0.2em;
    font-weight: 500;
    line-height: 1.1;
    white-space: nowrap; /* Ingen radbrytning */
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 95vw;
  }
  #app {
    width: 98vw;
    max-width: 99vw;
    margin-left: auto !important;
    margin-right: auto !important;
    margin-top: 10px;
    margin-bottom: 10px;
    left: unset !important;
    right: unset !important;
    border-radius: 8px;
    padding: 10px;
    display: block;
    box-sizing: border-box;
  }
}

#current-date {
    margin: 0 0.5em 0 0.5em;
    font-size: 2.5rem; /* Make the date text larger */
    font-weight: 600;
    background: none;
    color: #333;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

#current-date {
    margin: 0;
}

.logo-container {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1000;
}

.logo {
    max-width: 100px;
    height: auto;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.logo:hover {
    opacity: 1;
}

/* Stil för lunch- och nyckelikoner */
.lunch-icon, .key-icon {
    font-size: 1.2rem !important; /* Gör ikonerna större och överskrid inline styling */
    margin-right: 5px;
    vertical-align: middle;
}

/* Container för ikonerna */
.icon-container {
    display: flex;
    justify-content: center;
    margin-top: 5px;
    gap: 8px; /* Mellanrum mellan ikonerna */
}

/* Responsiva stilar för mobila enheter */
@media screen and (max-width: 768px) {
    #app {
        width: 95%;
        padding: 15px;
        margin: 10px 0;
       
    }
    
    #schedule {
        grid-template-columns: repeat(2, 1fr); /* 2 kolumner istället för 3 på surfplattor */
        gap: 15px;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .worker {
        height: 120px;
        font-size: 1.5rem;
    }
    
    .worker .stamp {
        font-size: 1rem;
        padding: 4px 15px;
    }
    
    .logo {
        max-width: 80px;
    }
}

@media screen and (max-width: 480px) {
    #app {
        width: 100%;
        border-radius: 0;
        padding: 10px;
       
    }
    
    #schedule {
        grid-template-columns: 1fr; /* Endast 1 kolumn på små mobiler */
        gap: 10px;
    }
    
    h1 {
        font-size: 1.2rem;
    }
    
    .date-nav-button.minimal {
        margin: 0 10px;
    }
    
    .worker {
        height: 100px;
        padding: 10px;
        font-size: 1.2rem;
    }
    
    .worker .time {
        font-size: 0.9rem;
    }
    
    .lunch-icon, .key-icon {
        font-size: 1.1rem !important;
    }
    
    .logo-container {
        right: 10px;
        bottom: 10px;
    }
    
    .logo {
        max-width: 60px;
    }
}

@media (min-width: 1081px) {
  body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
  }
  #app {
    margin-top: 0;
    margin-bottom: 0;
    background: rgba(255, 255, 255, 0);
  }
}

/* Ny CSS för .birthday-badge */
.birthday-badge {
  display: none !important;
}

.birthday-popup {
  position: fixed;
  left: 0;
  top: 0;
  background: #fffbe6;
  color: #e67e22;
  border: 1.5px solid #e67e22;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
  padding: 10px 18px;
  font-size: 1.1rem;
  font-weight: bold;
  z-index: 9999;
  white-space: nowrap;
  transform: translate(-50%, 0);
  animation: birthday-popup-fadein 0.18s;
  max-width: 90vw;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
}

@keyframes birthday-popup-fadein {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* Ny CSS för .birthday-bubble */
.birthday-bubble {
  position: fixed;
  left: 20px;
  bottom: 90px; /* Höj upp bubblan så den hamnar tydligt ovanför icon place */
  background: #fffbe6;
  color: #e67e22;
  border: 2px solid #e67e22;
  border-radius: 18px 18px 0 18px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.13);
  padding: 12px 22px 12px 18px;
  font-size: 1.15rem;
  font-weight: bold;
  z-index: 10001;
  white-space: nowrap;
  animation: birthday-bubble-fadein 0.25s;
  display: flex;
  align-items: center;
  gap: 0.5em;
  max-width: 90vw;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
}

@keyframes birthday-bubble-fadein {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
  .birthday-bubble {
    left: 10px;
    bottom: 70px; /* Även på mobil, höj upp bubblan mer */
    font-size: 1rem;
    padding: 8px 12px 8px 10px;
    max-width: 98vw;
  }
}

.worker.past-day {
    background-color: #e0e0e0 !important; /* Ljusgrå bakgrund */
    opacity: 0.65;
    filter: grayscale(0.5);
    pointer-events: none; /* Gör rutorna ej klickbara om så önskas */
    box-shadow: none;
    text-decoration: none;
}

.worker.leave {
    background-color: #f7e6e6 !important; /* Ljus röd/rosa bakgrund */
    color: #b94a48 !important;
    border: 2px dashed #df110e;
    opacity: 1;
    filter: none;
    text-decoration: none;
}

#leave-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

.worker.leave {
  min-width: 220px;
  max-width: 320px;
  width: 100%;
  height: 150px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative; /* Lägg till position: relative för leave-rutor */
}

/* Ny CSS för leave-badge */
.leave-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #e67e22;
  color: #fff;
  font-size: 1.05rem;
  font-weight: bold;
  padding: 4px 16px;
  border-radius: 16px;
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 1px 4px rgba(0,0,0,0.10);
  z-index: 2;
}

@media (max-width: 900px) {
  .worker.leave {
    min-width: 140px;
    max-width: 100vw;
    height: 120px;
  }
  .leave-badge {
    font-size: 0.95rem;
    padding: 3px 10px;
    max-width: 80px;
    top: 6px;
    right: 6px;
  }
}

/* Ta bort bakgrund, border och box-shadow för leave-toggle pilen */
#toggle-leave-btn {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0;
  margin: 0;
  border-radius: 0;
  outline: none;
  display: inline-block;
  height: 2.2em;
  width: 2.2em;
  min-width: unset;
  min-height: unset;
  cursor: pointer;
}
#toggle-leave-btn:active, #toggle-leave-btn:focus {
  background: none !important;
  outline: none;
}
#toggle-leave-btn span {
  background: none !important;
  box-shadow: none !important;
  border: none !important;
}

.worker.late-start {
  background-color: #b1d3f1 !important; /* Tydlig ljusgul bakgrund */
  color: #000000 !important;
}

/* Ensure .gone always overrides .late-start visually */
.worker.gone,
.worker.late-start.gone,
.worker.gone.late-start {
  background-color: #ffe0e0 !important;
  color: #000 !important;
  text-decoration: line-through;
}

.worker.sick {
    background-color: #bdbdbd !important; /* Grå bakgrund */
    color: #444 !important;
    border: 2px dashed #888;
    opacity: 1;
    filter: none;
    text-decoration: none;
    position: relative;
}
.worker.sick .stamp,
.worker.sick .leave-badge {
    background: #444 !important;
    color: #fff !important;
    border: 2px solid #fffbe6;
    text-transform: uppercase;
    font-weight: bold;
    opacity: 0.93;
}

.oncall-worker {
  background: #fffbe6 !important;
  border: 2.5px dashed #888 !important;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
  position: relative;
}
.oncall-worker::after {
  content: '';
  display: none;
}

/* Färglogik för veckovy-tabellceller (matchar .worker) */
table.weekly-schedule td.lock-time {
  background-color: #9edbb2 !important;
  color: #222 !important;
}
table.weekly-schedule td.late-start {
  background-color: #b1d3f1 !important;
  color: #000 !important;
}
table.weekly-schedule td.oncall-worker {
  background-color: #fffbe6 !important;
  color: #b8860b !important;
  border: 2px dashed #b8860b;
  font-weight: bold;
}
table.weekly-schedule td.sick {
  background-color: #bdbdbd !important;
  color: #444 !important;
  border: 2px dashed #888;
  font-weight: bold;
}
table.weekly-schedule td.off {
  background-color: #f2f2f2 !important;
  color: #aaa !important;
  font-style: italic;
}
table.weekly-schedule td.weekend {
  background-color: #fff3e0 !important;
  color: #d32f2f !important;
}
table.weekly-schedule td.semester {
  background-color: #fffbe6 !important;
}
/* Kombinerade klasser */
table.weekly-schedule td.late-start.weekend {
  background-color: #ffe9b1 !important;
  color: #b94a48 !important;
}
table.weekly-schedule td.lock-time.weekend {
  background-color: #b6e6c7 !important;
  color: #b94a48 !important;
}
table.weekly-schedule td.sick.weekend {
  background-color: #e57373 !important;
  color: #fff !important;
}
table.weekly-schedule td {
  background-color: #e0ffe0;
}
/* Men specialklasser ska alltid vinna */
table.weekly-schedule td.off,
table.weekly-schedule td.sick,
table.weekly-schedule td.lock-time,
table.weekly-schedule td.late-start,
table.weekly-schedule td.oncall-worker,
table.weekly-schedule td.weekend {
  /* Dessa har redan !important i sina regler ovan */
}

.worker.expanded-bonus {
    transform: none; /* Ta bort scale för att förhindra suddighet */
    min-height: 300px; /* Ge mer utrymme för bonusinformation */
    background-color: #f0f8ff; /* Ljusblå bakgrund för att visa att den är aktiv */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    z-index: 10;
    grid-column: span 1; /* Se till att den inte tar upp mer än en kolumn */
}

.bonus-summary-details {
    margin-top: 15px;
    padding: 10px;
    border-top: 1px solid #ddd;
    text-align: left;
    font-size: 1rem;
    color: #333;
    opacity: 0;
    animation: fadeInBonus 0.5s 0.2s forwards;
    width: 100%;
    box-sizing: border-box;
}

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

.bonus-summary-details h4 {
    margin: 0 0 10px 0;
    font-size: 1.2rem;
    color: #007bff;
    text-align: center;
}

.bonus-summary-details dl {
    margin: 0;
    padding: 0;
}

.bonus-summary-details dt {
    font-weight: bold;
    margin-top: 8px;
}

.bonus-summary-details dd {
    margin-left: 15px;
    color: #555;
}

.bonus-summary-details p {
    text-align: center;
    font-style: italic;
    color: #777;
}

.bonus-summary-details .loading-bonus {
    color: #007bff;
}

.bonus-summary-details .error-bonus {
    color: #e74c3c;
    font-weight: bold;
}


/* Highlight for today's column in weekly overview - gray dashed border */
table.weekly-schedule th.today-col,
table.weekly-schedule td.today-col {
  position: relative;
  z-index: 1;
  box-shadow: none;
  border-left: 2px dashed #bdbdbd;
  border-right: 2px dashed #bdbdbd;
  background-clip: padding-box;
}
table.weekly-schedule th.today-col {
  border-top: 2px dashed #bdbdbd;
}
table.weekly-schedule tr:last-child td.today-col {
  border-bottom: 2px dashed #bdbdbd;
}

.weekly-overview-container {
  max-width: 1500px;
  margin: 18px auto 0 auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.13);
  padding: 1.3em 1.3em 1.1em 1.3em;
  width: 97vw;
  min-width: 320px;
  min-height: 60vh;
  max-height: 78vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
@media (max-width: 1400px) {
  .weekly-overview-container {
    max-width: 99vw;
    padding: 0.7em 0.1em;
    min-height: 54vh;
    max-height: 74vh;
  }
}
@media (max-width: 900px) {
  .weekly-overview-container {
    padding: 0.3em 0.1em;
    min-height: 40vh;
    max-height: 60vh;
  }
}

.card-flip-back {
    /* ...existing code... */
    background: #fff !important;
    color: black;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18); /* Tydlig skugga */
    /* ...existing code... */
}

.card-flip-back-content {
    /* ...existing code... */
    background: #f8f8fc; /* Ljusgrå bakgrund för kontrast mot vit ram */
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.10); /* Subtil inre skugga */
}