body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f4f7f6;
    color: #333;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    box-sizing: border-box;
}

#app-container {
    background-color: #ffffff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 900px;
}

#notification {
    margin-bottom: 16px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: #e9f6ec;
    color: #0f5132;
}

#notification.error { background: #fdecea; color: #842029; border-color: #f5c2c7; }
#notification.info { background: #e7f1ff; color: #084298; border-color: #b6d4fe; }

header {
    text-align: center;
    margin-bottom: 30px;
}

h1, h2 {
    color: #1a1a1a;
}

.view {
    animation: fadeIn 0.5s ease-in-out;
}

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

form {
    display: flex;
    flex-direction: column;
}

label {
    margin-bottom: 8px;
    font-weight: 600;
}

textarea, input[type="email"], input[type="text"], input[type="date"], input[type="time"] {
    padding: 12px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

textarea:focus, input[type="email"]:focus, input[type="text"]:focus, input[type="date"]:focus, input[type="time"]:focus {
    outline: none;
    border-color: #007bff;
}

.time-range-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.time-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}

button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    background-color: #007bff;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #0056b3;
}

.link-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    background-color: #e9ecef;
    border-radius: 8px;
    padding: 10px 15px;
}

.link-container a {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #0056b3;
}

/* Calendar Styles */
.calendar-container {
    display: flex;
    position: relative;
}

.calendar-scroll-wrapper {
    overflow-x: auto;
    flex-grow: 1;
    border-radius: 8px;
    background-color: #ddd;
    min-width: 0; /* Prevents the flex item from overflowing its container */
    border-radius: 0 8px 8px 0;
}

.calendar {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 80px;
    gap: 1px;
    border: none;
    user-select: none;
}

.time-column {
    display: flex;
    flex-direction: column;
    background-color: #e9ecef;
    z-index: 2;
    position: sticky;
    left: 0;
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.time-header, .day-header {
    background-color: #e9ecef;
    font-weight: bold;
    text-align: center;
    padding: 8px;
    position: sticky;
    top: 0;
    z-index: 3;
}

.time-header {
    height: 40px; /* Aligns with day header height */
}

.day-column {
    display: flex;
    flex-direction: column;
    min-width: 80px;
}

.day-header {
    position: sticky;
    top: 0;
    z-index: 1;
}

.tz-banner {
  margin: 6px 0 10px;
  padding: 8px 12px;
  background: #eef5ff;
  border: 1px solid #cfe2ff;
  border-radius: 6px;
  font-size: 14px;
}

.time-label {
    height: 0; /* Collapse the element's height */
    margin-bottom: 30px; /* Use margin to create the 30px vertical space */
    font-size: 12px;
    text-align: right;
    padding-right: 10px;
    color: #555;
    /* This transform pulls the text up to be vertically centered on the line above it */
    transform: translateY(-50%);
}

.time-label:first-of-type {
    margin-top: 29px;
}

.time-slot {
    height: 30px; 
    background-color: #f9f9f9;
    box-sizing: border-box;
    border-top: 1px solid #ddd;
}

.time-slot.selected {
    background-color: #66bb6a;
}

/* Results Calendar Colors (0% = neutral gray, higher % = greener) */
.results-calendar .time-slot.level-5 { background-color: #1a9850; color: #fff; }  /* 100% */
.results-calendar .time-slot.level-4 { background-color: #91cf60; }               /* 75–<100% */
.results-calendar .time-slot.level-3 { background-color: #d9ef8b; }               /* 50–<75% */
.results-calendar .time-slot.level-2 { background-color: #fee08b; }               /* 25–<50% */
.results-calendar .time-slot.level-1 { background-color: #fc8d59; }               /* >0–<25% */
.results-calendar .time-slot.level-0 { background-color: #f7f7f7; }               /* 0% */

.results-calendar .time-slot {
    text-align: center;
    font-size: 12px;
    line-height: 30px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

#clear-selections-btn {
    background-color: #6c757d;
}
#clear-selections-btn:hover {
    background-color: #5a6268;
}

.participant-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.participant-controls label { margin-bottom: 0; }
.participant-controls #participant-email { flex: 1 1 280px; margin-bottom: 0; }
.participant-controls button { margin-bottom: 0; }
.participant-controls .pc-row { width: 100%; display: flex; align-items: center; gap: 10px; }
.participant-controls .pc-row .actions button { height: 42px; }

/* Make inputs, selects, and buttons visually consistent */
input[type="email"], input[type="text"], select, button, .tz-banner {
  border-radius: 8px;
}
input[type="email"], input[type="text"], select {
  height: 42px;
}
button { height: 42px; }

select {
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  background: #fff;
}

.participant-controls select {
  min-width: 220px;
}