@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

body {
    font-family: 'Poppins', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f4f4f9;
    margin: 0;
}

input, button {
    font-family: 'Poppins', sans-serif;
}

a {
    text-decoration: none;
    color: black;
}

/* Profil bearbeiten/ username.html -> Auth Container */
.auth-container {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    width: 350px;
    text-align: center;
    margin: auto;
}

.auth-container h2 {
    margin-bottom: 20px;
    color: #333;
}

.auth-container input {
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.auth-container button {
    width: 100%;
    padding: 12px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s;
}

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

.auth-container .message {
    margin-bottom: 15px;
    font-size: 0.9em;
}

.auth-container .error {
    color: #dc3545;
}

.auth-container .success {
    color: #28a745;
}

.auth-container a {
    display: block;
    margin-top: 15px;
    color: #007bff;
    text-decoration: none;
}

.auth-container a:hover {
    text-decoration: underline;
}

/* Freunde-Liste */
.container {
    display: none;
    align-items: flex-start;
    gap: 20px;
}

/* Kalender */
.calendar-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.calendar {
    width: 450px;
    border: 1px solid #ddd;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    border-radius: 8px;
    overflow: hidden;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background-color: #797979;
    color: white;
    padding: 10px;
    font-size: 1.2em;
    font-weight: bold;
}

.calendar-header button {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.2em;
    cursor: pointer;
    padding: 0 5px;
}

.calendar-header button:hover {
    color: #ddd;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background-color: #797979;
    color: white;
}

.calendar-days div {
    padding: 10px;
    text-align: center;
    font-weight: bold;
}

.calendar-dates {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.calendar-dates div {
    padding: 20px;
    text-align: center;
    border: 1px solid #ddd;
    cursor: pointer;
}

.calendar-dates div:hover {
    background-color: #f0f0f0;
}

.calendar-dates div.today:hover {
    background-color: #ffdd57;
}

.today {
    border: 2px solid yellow;
    font-size: 1.2em;
    font-weight: bold;
}

.past-date {
    color: #ccc;
    cursor: not-allowed;
}

/* Sidebar */
.sidebar {
    width: 220px;
    padding: 16px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    word-wrap: break-word;
    word-break: break-all;
}

.sidebar h2 {
    margin-top: 0;
    margin-bottom: 20px;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.sidebar a:hover {
    color: rgb(255, 154, 22);
    font-weight: bold;
}

.friend-icon {
    width: 20px;
    height: 20px;
}

/* Legende */
.legend {
    margin: 0 auto;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    text-align: center;
    width: 450px;
    box-sizing: border-box;
}

.legend h4 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1em;
}

.legend ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.legend li {
    display: flex;
    align-items: center;
    font-size: 0.9em;
}

.legend-color {
    display: inline-block;
    width: 15px;
    height: 15px;
    margin-right: 5px;
    border: 1px solid #000;
}

.legend-color.no-entry { background-color: #808080; }
.legend-color.one-person { background-color: #A9A9A9; }
.legend-color.no-overlap { background-color: #FF0000; }
.legend-color.overlap { background-color: rgb(0, 125, 0); }

/* Verfügbarkeitsfenster */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    justify-content: center;
    align-items: center;
}

.modal {
    position: relative;
    background: white;
    padding: 20px;
    padding-bottom: 60px;
    border-radius: 5px;
    max-width: 400px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

#modalDate, #suggestion, .modal h4 {
    margin-top: 10px;
    margin-bottom: 10px;
}

#modalDate {
    margin-top: 0px;
}

#suggestion {
    display: none; /* Initially hidden */
    color: green;
}

.modal-input-group {
    margin-bottom: 10px;
}

#modal-error {
    color: red;
    margin-bottom: 5px;
    min-height: 10px;
    font-size: 11px;
}


.availability-list-item {
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.delete-button {
    cursor: pointer;
    margin-left: 10px;
    width: 20px;
    height: 20px;
    position: relative;
}

.delete-icon {
    width: 100%;
    height: 100%;
    background-color: red;
    position: relative;
}

.delete-cross {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.delete-cross::before, .delete-cross::after {
    content: '';
    position: absolute;
    width: 80%;
    height: 2px;
    background-color: white;
}

.delete-cross::before {
    transform: rotate(45deg);
}

.delete-cross::after {
    transform: rotate(-45deg);
}


/* Buttons */
#saveTime {
    position: absolute;
    right: 16px;
    bottom: 16px;
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
}

#saveTime:hover {
    background: #218838;
}

#closeModal {
    position: absolute;
    left: 16px;
    bottom: 16px;
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
}

#closeModal:hover {
    background: #0056b3;
}

#todayBtn, #logoutBtn, #changeUsernameBtn {
    position: fixed;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    color: white;
    z-index: 1001;
    width:fit-content;
}

body.modal-open #todayBtn,
body.modal-open #logoutBtn,
body.modal-open #changeUsernameBtn {
    display: none;
}

#todayBtn {
    background: #007bff;
    right: 20px;
}
#changeUsernameBtn {
    background: #007bff;
    right: 20px;
    top: 20px;
}

#todayBtn, #logoutBtn {
    bottom: 20px;
}

#logoutBtn {
    background: #dc3545;
    left: 20px;
}

#changeUsernameBtn :hover, #todayBtn :hover {
    background-color: #0056b3;
}

#logoutBtn:hover {
    background: #c82333;
}


/* Anpassung für z.B. Handys */
@media (max-width: 400px) {
    body {
        display: block;
        padding: 20px 0;
    }

    .container {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        width: 100%;
    }
    

    .sidebar, .calendar, .legend, .auth-container {
        width: 95%;
        margin-left: auto;
        margin-right: auto;
        box-sizing: border-box;
    }
    
    .sidebar {
        order: -1; 
        padding: 10px;
        position: relative;
    }

    .sidebar h2 {
		display: flex;
		align-items: center;
		justify-content: space-between;
    }

    .calendar-days div,
    .calendar-dates div {
        padding: 10px 4px;
        font-size: 0.8em;
    }

    .calendar-dates div {
        padding: 15px 4px;
    }

    .today {
        font-size: 0.9em;
    }


    #logoutBtn, #todayBtn {
        position: relative;
        bottom: auto;
        left: auto;
        right: auto;
        margin-top: 10px; 
        width: 95%;
        margin-left: auto;
        margin-right: auto;
        display: block;
    }

    #changeUsernameBtn {
        position: static;
        width: auto;
        margin: 0;
        padding: 5px 8px;
        font-size: 12px;
    }

}
