body {
    font-family: 'Courier New', Courier, monospace;
    background-color: #333;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding-top: 100px; /* Further increased padding to ensure list starts below title */
    padding-bottom: 80px; /* Add padding to the bottom to prevent content from going under the display-switch */
    box-sizing: border-box;
}

/* Default title styling with box shadow for list mode */
.page-title {
    text-align: center;
    font-size: 1.5rem;
    margin: 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: #222;
    /* padding: 20px; */
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Authentication container - repositioned to bottom left */
.auth-container {
    position: fixed;
    bottom: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    z-index: 1000;
    background-color: rgba(34, 34, 34, 0.6);
    border-radius: 8px;
    padding: 8px;
    backdrop-filter: blur(4px);
    transition: opacity 0.3s, transform 0.3s;
    opacity: 0.5;
}

.auth-container:hover {
    opacity: 1;
}

.user-info {
    font-size: 0.7rem;
    color: #ddd;
    margin-bottom: 5px;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.auth-button {
    background-color: transparent;
    color: white;
    border: none;
    padding: 5px;
    cursor: pointer;
    border-radius: 50%;
    font-family: 'Courier New', Courier, monospace;
    transition: background-color 0.3s;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-button:hover {
    background-color: rgba(85, 85, 85, 0.5);
}

.auth-button .icon {
    font-size: 1rem;
}

.auth-message {
    text-align: center;
    color: #aaa;
    font-style: italic;
    padding: 20px;
    border: 1px dashed #555;
    border-radius: 5px;
    margin: 20px 0;
}

.auth-message.error {
    color: #ff6b6b;
    border-color: #ff6b6b;
    background-color: rgba(255, 107, 107, 0.1);
}

.auth-error {
    color: #ff6b6b;
}

/* Remove box shadow in single and three events modes */
body.single-mode .page-title,
body.three-mode .page-title {
    box-shadow: none;
}

.event-list {
    list-style: none;
    padding: 0;
    width: 80%;
    max-width: 1200px;
    margin-top: 20px; /* Added top margin to separate from title */
    position: relative;
}

.display-switch {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: rgba(68, 68, 68, 0.6);
    padding: 10px 15px;
    border-radius: 8px;
    font-family: 'Courier New', Courier, monospace;
    color: #fff;
    z-index: 1000;
    backdrop-filter: blur(4px);
    transition: opacity 0.3s;
    opacity: 0.5;
}

.display-switch:hover {
    opacity: 1;
}

#displayMode, #cyclingOrder {
    margin-left: 10px;
    background-color: rgba(51, 51, 51, 0.7);
    color: #fff;
    border: none;
    padding: 5px;
    border-radius: 5px;
    font-family: 'Courier New', Courier, monospace;
}

.event-item {
    display: grid;
    grid-template-columns: 1fr auto;
    padding: 10px 20px;
    border-bottom: 1px solid #444;
    gap: 50px;
    transition: opacity 0.8s ease-in-out, transform 0.8s ease-in-out;
    position: relative;
}

/* Special event indicators */
.today-event::before {
    content: "★";
    color: #ffcc00;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1em;
}

.personal-event::before {
    content: "♦";
    color: #ff6b6b;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1em;
}

/* For events that are both today and personal */
.today-event.personal-event::before {
    content: "♦★";
    color: #ff6b6b;
}

.event-item span:first-child {
    word-break: break-word;
}

.event-item span:last-child {
    text-align: right;
    min-width: 100px;
}

.adjacent-event {
    color: white;
    opacity: 0.5;
    transform: scale(0.95);
    transition: opacity 0.8s ease-in-out, transform 0.8s ease-in-out;
}

/* Styles for centering single and three events */
.single-event, .three-events {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 300px); /* Reduced from -200px to -300px to move content up */
    transition: opacity 0.5s ease-in-out;
}

.single-event .event-item, .three-events .event-item {
    width: 80%;
    max-width: 800px;
    margin: 5px auto;
    border-bottom: 1px solid #444;
}

.three-events {
    justify-content: center;
}

/* Ensure adjacent events in three-event mode are properly faded */
.three-events .adjacent-event {
    opacity: 0.5;
    transform: scale(0.95);
    color: #aaa;
}

.three-events .event-item {
    margin: 3px auto;
}

/* Fade-in animation for new events */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Fade-out animation for removing events */
@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-10px); }
}

.fade-in {
    animation: fadeIn 0.8s ease-in-out forwards;
}

.fade-out {
    animation: fadeOut 0.8s ease-in-out forwards;
}
