/* Loading screen */
#loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #f5f5f5; /* Same as body background */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 1;
  transition: opacity 1s ease-out;
}

#loader-overlay.fade-out {
  opacity: 0;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(0, 101, 189, 0.3); /* A light, transparent blue */
  border-top-color: #0065bd; /* The solid TUM blue for the spinning part */
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}


/* Basic styling for HTML and Body */
html, body {
    height: 100%;
    width: 100%;
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    overflow: hidden; /* Removes scrollbars if content overflows */
}

/* Flex container for centering content */
body {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    padding: 0;
    margin: 0;
}

/* Main content container */
.container {
    max-width: 95vw;
    width: 100%;
    height: 95vh;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    transition: opacity 1s ease-in;
}

/* Header styling */
header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1vh 5vw;
    line-height: 1.2;
    flex-shrink: 0; /* Prevents the header from shrinking */
}

#header-left {
    color: #0065bd;
    font-size: 2vh;
    text-align: left;
}

#header-right img {
    height: 8vh;
    cursor: pointer;
}

/* Subject title */
#subject {
    font-size: 5vh;
    font-weight: bold;
    /* Reduced vertical margins */
    margin-top: 2vh;
    margin-bottom: 2vh;
    text-align: center;
    flex-shrink: 0; /* Prevents the title from shrinking */
}

/* Clocks container */
#clocks {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* NEW: This area will now be flexible */
    flex-grow: 1;
    flex-shrink: 1;
    min-height: 0; /* Important to allow this area to shrink */
    justify-content: center;
    width: 100%;
}

#analogClockCanvas {
    /* Base size on viewport height to be responsive */
    width: 30vh;
    height: 30vh;
    
    /* But don't allow it to become huge on large screens */
    max-width: 500px;
    max-height: 500px;

    background-color: white;
    border: 2px solid #000;
    border-radius: 50%;
    margin-bottom: 2vh;
}

#digitalClock {
    font-size: 5vh;
    margin: 1vh 0;
}

/* Start/End times */
#times {
    text-align: center;
    font-size: 4vh;
    line-height: 1.5;
    flex-shrink: 0; /* Prevents the times from shrinking */
}

/* Notification area */
#notification {
    font-size: 3vh;
    color: red;
    text-align: center;
    white-space: normal;
    margin-top: 2vh;
    margin-bottom: 1vh;
    line-height: 1.2;
    flex-shrink: 0; /* Prevents the notification from shrinking */
}

/* Notes area */
#displayNotes {
  max-width: 100%;
  color: black;
  font-size: 2.5vh;
  padding: 10px;
  white-space: pre-wrap;
  text-align: center;
  flex-shrink: 0; /* Prevents the notes from shrinking */
  /* NEW: Minimum height to guarantee space for ~2 lines */
  min-height: 6vh;
}


/* --- POPUP MODAL STYLES --- */

.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000; /* Ensure it's on top of everything */
}

.popup-content {
  position: relative; /* NEW: Necessary for positioning the dropdown */
  background-color: #fff;
  padding: 20px 40px;
  border-radius: 8px;
  max-width: 600px;
  width: 90%;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  font-size: 0.8em;
}

/* NEW: Styling for the language selector inside the popup */
#language-selector-main {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 0.9rem;
    padding: 5px;
    border-radius: 5px;
    border: 1px solid #ccc;
    background-color: #f9f9f9;
}


.popup-content h2 {
  margin-top: 0;
  padding-right: 100px; /* Make space for the dropdown */
}

.popup-actions {
  margin-top: 20px;
}

.popup-actions label {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.popup-actions input[type="checkbox"] {
  margin-right: 10px;
}

.popup-buttons {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end; /* Align buttons to the right */
  gap: 10px;
}

.popup-buttons button {
  padding: 10px 20px;
  border: 1px solid #ccc;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1em;
  /* Smooth transition for the hover effect */
  transition: background-color 0.2s, border-color 0.2s;
}

#beta-popup-continue {
  background-color: #0065bd;
  color: white;
  border-color: #0065bd;
}

#beta-popup-continue:disabled {
    background-color: #ccc;
    border-color: #ccc;
    cursor: not-allowed;
}

/* NEW: Hover effect only for the enabled button */
#beta-popup-continue:not([disabled]):hover {
    background-color: #004c90; /* A slightly darker blue */
    border-color: #004c90;
}