* { 
    box-sizing: border-box; 
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
    background: #342b42;
    min-height: 100vh;
}

.logo {
    background: #413455;
    position: fixed;
    display: flex;
    justify-content: space-between;
    margin: 0 auto;
    width: 100%;
    box-shadow: 0 5px 5px 0 rgba(0, 0, 20, 0.2);
    z-index: 800;
}

.logo h1 {
    color: white;
    padding-left: 20px;
    display: flex;
}

.profileBtn {
    display: flex;
    align-items: center;
    position: relative;
    padding-right: 20px;
    width: 100px;
}

.profileBtn button {
    background: #8a58ac !important;
}

#login-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    gap: 16px;
}

.login-box {
    width: 100%;
    max-width: 340px;
    border: none;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 0 5px 4px rgba(0, 0, 0, 0.2);
    background: #413455;
}

.login-box h2{
    font-size: 28px;
    color: white;
}

#profile-btn {
  background: #6c757d;
  color: white;
}

input {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 10px;
    margin: 8px 0;
}

button {
    width: 100%;
    max-width: 300px;
    padding: 14px;
    font-size: 1.1rem;
    background: linear-gradient(90deg, rgba(168, 105, 219, 1), rgba(104, 45, 138, 1));
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0px 5px 5px 0px rgba(0, 0, 0, 0.2);
}

button:hover {
    background: linear-gradient(90deg, rgba(168, 105, 219, 0.8), rgba(104, 45, 138, 0.8));
}

#error-msg {
    color: #d32f2f;
    min-height: 1.4em;
}

#calendar-app {
    color: white;
    background: #413455;
    display: none;
    position: relative;
    justify-content: center;
    width: 1200px;
    top: 120px;
    border-radius: 10px;
    box-shadow: 0 0 4px 5px rgba(0,0,0,0.3);
    padding: 20px;  
    margin: 0 auto; 
}

#calendar-app h1 {
    position: absolute;
    display: flex;
    top: 22px;
    left: 30px; 
    margin: 0;
    gap: 12px;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-left: 20px;
    justify-content: end;
}

.conBtns {
    display: flex;
    position: relative;
    width: 500px;
}

.controls h1 {
    margin: 0; 
    font-size: 1.6rem;
    color: white; 
}

.month-nav { 
    display: flex; 
    gap: 12px; 
    align-items: center; 
}

#month-year{
    color: white;
    font-weight: bold;
}

#calendar {
    display: grid;
    margin-top: 20px;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    color: white;
    background: #ffffff00;
    border-radius: 8px;
    overflow: hidden;
}

.header {
    background: #8a58ac;
    font-weight: bold;
    text-align: center;
    border-radius: 10px;
    padding: 10px 4px;
    font-size: 0.9rem;
}

.day {
    border-radius: 10px;
    padding: 10px;
    min-height: 100px;
    background-color: #8a58ac;
}

.day-header {
    font-weight: bold;
    margin-bottom: 4px;
    font-size: 1.1rem;
}

.event {
    background: #f8d1fd;
    border-left: 4px solid #f081ff;
    padding: 6px 8px;
    margin: 4px 0;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
}

.event:hover {
    background: #bbdefb; 
}

#overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 998;
}

.modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #413455;
    color: white;
    width: 90%;
    max-width: 390px;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    z-index: 999;
    max-height: 90vh;
    overflow-y: auto;
}

.modal h2 {
    display: block;
    align-items: center;
    align-content: center;
    text-align: center;
    margin-top: 0;
    color: white;
    text-shadow: 0px 2px 4px rgba(0, 0, 0, 0.8);
}

.modal button {
    max-width: 340px;
}

input, select, button { 
    margin: 8px 0; 
}

button {
    display: flex;
    justify-content: center;
    width: 600px;
}

button.danger { 
    background: #d32f2f; 
}

button.danger:hover { 
    background: #b71c1c; 
}

.edit {
    display:none; 
    background:#f698ff;
}

.edit:hover {
    background: #d683dd;
}

@media (max-width: 768px) {
    body{
        height: 100vh;
        overflow: hidden;
    }
    #calendar {gap: 4px;}
    #calendar-app {
        width: 390px; 
        top: 100px;}
    #calendar-app h1 {display: none;}
    .conBtns {
        padding: 0px;
        margin: 0;
        max-width: 300px;
        width: 380px;
        font-size: 0.6rem;
    }
    .conBtn {
        font-size: 0.8rem;
        padding: 8px;
    }
    .day { min-height: 80px; padding: 6px; }
    .day-header { font-size: 1rem; }
    .event { font-size: 0.7rem; padding: 0px 0px; }
    .controls { flex-direction: column; align-items: stretch; }
}