/*
==========================================
AVOTI:
1. DayPilot Lite (https://javascript.daypilot.org/open-source/)
2. GeeksforGeeks (https://www.geeksforgeeks.org/how-to-create-a-dynamic-calendar-in-html-css-javascript/)
3. YouTube video (https://www.youtube.com/watch?v=Z1BGAivZRlE)
Papildus – dizaina idejas no dribbble.com

Pamatojums:
Izvēlējos šos avotus, jo tie ir labi piemēroti nedēļas kalendāra logikas un dizaina uzbūvei ar JavaScript, kā arī viegli pielāgojami klienta vajadzībām.

AI izmantošana:
Stilu un funkciju piemēri daļēji ģenerēti un pielāgoti ar ChatGPT.
==========================================
*/


body {
    background: #dfe8ee;
    margin: 0;
    min-height: 100vh;
    font-family: 'Segoe UI', Arial, sans-serif;
}
#login-container, #calendar-container {
    width: 100vw;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-card {
    background: #fff;
    padding: 32px 36px 28px 36px;
    border-radius: 22px;
    box-shadow: 0 8px 36px #bcd1e399;
    text-align: center;
    min-width: 320px;
}
.login-card h1 {
    margin-bottom: 8px;
    color: #368fca;
}
.login-card label {
    display: block;
    margin: 14px 0 4px 0;
    text-align: left;
}
.login-card input {
    width: 100%;
    padding: 7px 8px;
    margin-bottom: 6px;
    border: 1px solid #b7c6d7;
    border-radius: 6px;
}
.login-card button {
    width: 100%;
    background: #368fca;
    color: white;
    border: none;
    padding: 10px 0;
    margin-top: 12px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    font-size: 1rem;
}

.top-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 18px 28px 0 28px;
    background: none;
    justify-content: flex-start;
    flex-wrap: wrap;
}

#week-label {
    font-size: 1.18em;
    font-weight: bold;
    margin: 0 14px;
    color: #368fca;
}

#week-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 18px;
    width: 100vw;
    box-sizing: border-box;
    margin-top: 24px;
    padding: 0 16px 40px 16px;
}

.day-card {
    background: #fff;
    border-radius: 18px;
    min-height: 290px;
    padding: 18px 8px 12px 8px;
    box-shadow: 0 2px 10px #bcd1e366;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: relative;
    border: 3px solid transparent;
    transition: box-shadow 0.25s, border-color 0.25s;
}

.day-card .day-title {
    font-size: 1.15em;
    font-weight: 600;
    margin-bottom: 2px;
}
.date-label {
    font-size: 0.93em;
    margin-bottom: 7px;
    color: #565e6b;
}
.reminders {
    flex: 1;
    margin-bottom: 9px;
}
.reminder {
    background: rgba(255,255,255,0.7);
    border-radius: 7px;
    margin-bottom: 3px;
    padding: 3px 4px 2px 0px;
    font-size: 0.97em;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.reminder-time {
    font-weight: bold;
    color: #1a9a46;
    margin-right: 6px;
}
.reminder-actions button {
    margin-left: 2px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1.05em;
    color: #4186e8;
}
.add-reminder-btn {
    background: linear-gradient(90deg,#9fe6fc,#83e1d6);
    color: #22697b;
    border: none;
    border-radius: 8px;
    padding: 9px 0;
    font-weight: 500;
    margin-top: 8px;
    cursor: pointer;
    font-size: 1em;
    transition: background 0.17s;
}
.add-reminder-btn:hover {
    background: linear-gradient(90deg,#68caec,#39dfbc);
    color: #1c4453;
}

.day-card.today {
    border: 3px solid #e84e66;
    box-shadow: 0 4px 18px #e84e6633;
}

.day-card:nth-child(1) { background: #d0e6ff; }
.day-card:nth-child(2) { background: #d4f0c3; }
.day-card:nth-child(3) { background: #ffe5e7; }
.day-card:nth-child(4) { background: #fbe8b3; }
.day-card:nth-child(5) { background: #ecd7fa; }
.day-card:nth-child(6) { background: #d7f0ec; }
.day-card:nth-child(7) { background: #f2f3fa; }

/* Modālais logs */
.modal {
    display: none; 
    position: fixed;
    z-index: 99;
    left: 0; top: 0;
    width: 100vw; height: 100vh;
    overflow: auto;
    background-color: rgba(30,30,55,0.22);
}
.modal-content {
    background: #fff;
    margin: 60px auto;
    border-radius: 18px;
    padding: 26px 28px 20px 28px;
    width: 95%;
    max-width: 420px;
    box-shadow: 0 8px 36px #bcc1e399;
    position: relative;
    animation: modalShow 0.22s;
}
@keyframes modalShow { from { opacity:0; transform: translateY(-70px);} to{ opacity:1; transform:none;} }
.close {
    color: #e84e66;
    float: right;
    font-size: 1.7em;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 10px;
}
.close:hover { color: #aa2036; }
.modal-content label {
    margin-top: 10px;
    display: block;
    font-weight: 500;
}
.modal-content input[type="text"], .modal-content input[type="time"], .modal-content input[type="number"] {
    width: 100%;
    padding: 7px 8px;
    margin-bottom: 7px;
    border-radius: 7px;
    border: 1px solid #c6d7ea;
}
#save-reminder-btn {
    margin-top: 8px;
    width: 100%;
    background: #368fca;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 9px 0;
    font-weight: bold;
    font-size: 1em;
    cursor: pointer;
}
#reminder-list .reminder-mini {
    background: #f3f6fb;
    margin-bottom: 5px;
    border-radius: 7px;
    padding: 5px 5px 2px 5px;
    font-size: 0.98em;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
#reminder-list button {
    border: none;
    background: none;
    color: #4186e8;
    font-size: 1em;
    margin-left: 4px;
    cursor: pointer;
}

@media (max-width: 1050px) {
    #week-calendar {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 700px) {
    #week-calendar {
        grid-template-columns: 1fr;
        gap: 11px;
        padding: 0 3vw 25vw 3vw;
    }
    .day-card {
        min-height: 180px;
        padding: 13px 5px 8px 5px;
    }
    .modal-content { padding: 17px 7vw; }
    .top-bar { padding: 10px 5vw 0 5vw;}
}
