@import url('https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&family=Montserrat:ital,wght@0,600;1,600&family=Roboto:ital,wght@0,100..900;1,100..900&display=swap');

.habitsApp {
    display: flex;
    gap: 30px;
    justify-content: center;
    max-width: 1100px;
    margin: 40px auto;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 30px;
    height: 70vh;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.trackerSection {
    width: 50%;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    padding-right: 20px;
    display: flex;
    flex-direction: column;
}

.trackerHeader {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

#trackerTitle {
    color: #e19c30;
    font-family: 'Roboto', sans-serif;
    font-size: 1.6rem;
    margin: 0;
}

.template-actions {
    display: flex;
    gap: 10px;
    margin-top: 5px;
}

.template-btn {
    background: transparent;
    border: 1px solid #e19c30;
    color: #e19c30;
    padding: 4px 10px;
    border-radius: 10px;
    cursor: pointer;
    font-family: 'Roboto', sans-serif;
    font-size: 0.8rem;
    transition: 0.2s;
}

.template-btn:hover {
    background: rgba(225, 156, 48, 0.2);
}

.template-btn.delete-btn {
    border-color: #d9534f;
    color: #d9534f;
}

.template-btn.delete-btn:hover {
    background: rgba(217, 83, 79, 0.2);
}

.statsArea {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
}

#streakDisplay {
    background: rgba(217, 83, 79, 0.2);
    color: #ff6b6b;
    padding: 6px 15px;
    border-radius: 20px;
    font-family: 'Roboto', sans-serif;
    font-weight: 900;
    border: 1px solid #d9534f;
    white-space: nowrap;
}

#maxStreakDisplay {
    color: #aaa;
    font-family: 'Roboto', sans-serif;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
}

.addHabitArea {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

#habitInput {
    flex-grow: 1;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #d1d1d1;
    font-size: 1.2rem;
    padding: 10px 5px;
    outline: none;
    font-family: 'Lato', sans-serif;
}

#habitInput::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

#btnAddHabit {
    background-color: #e19c30;
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

#btnAddHabit:hover {
    background-color: #b37109;
    box-shadow: -2px -2px 5px #8d621d;
}

#habitsList {
    list-style: none;
    overflow-y: auto;
    flex-grow: 1;
    padding: 0;
    margin: 0;
}

#habitsList li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    color: #d1d1d1;
    font-family: 'Lato', sans-serif;
    font-size: 1.1rem;
    transition: 0.2s;
}

#habitsList li.completed {
    opacity: 0.5;
    text-decoration: line-through;
    border-left: 3px solid #b6f500;
}

.habit-actions {
    display: flex;
    gap: 10px;
}

.btnCheck, .btnDelete {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    transition: 0.2s;
}

.btnCheck { color: #b6f500; }
.btnCheck:hover { transform: scale(1.2); }

.btnDelete { color: #d9534f; }
.btnDelete:hover { transform: scale(1.2); }

.calendarSection {
    width: 50%;
    padding-left: 10px;
    display: flex;
    flex-direction: column;
}

.calendarHeader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.calendarHeader h2 {
    color: #e19c30;
    font-family: 'Roboto', sans-serif;
    font-size: 1.8rem;
    margin: 0;
}

.calendar-nav-btn {
    background: transparent;
    border: none;
    color: #e19c30;
    font-size: 1.8rem;
    cursor: pointer;
    transition: 0.2s;
    font-weight: bold;
}

.calendar-nav-btn:hover {
    color: #fff;
    transform: scale(1.1);
}

.calendarDaysOfWeek {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    color: #aaa;
    font-family: 'Roboto', sans-serif;
    font-weight: bold;
    margin-bottom: 10px;
}

.calendarGrid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    flex-grow: 1;
}

.calendarDay {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #d1d1d1;
    font-family: 'Lato', sans-serif;
    font-size: 1.1rem;
    transition: all 0.2s ease;
    cursor: pointer;
    user-select: none;
    border: 1px solid transparent;
}

.calendarDay.day-perfect {
    background: rgba(182, 245, 0, 0.25);
    border: 1px solid rgba(182, 245, 0, 0.5);
    color: #b6f500;
}

.calendarDay.day-partial {
    background: rgba(225, 156, 48, 0.25);
    border: 1px solid rgba(225, 156, 48, 0.5);
    color: #e19c30;
}

.calendarDay.day-none {
    background: rgba(217, 83, 79, 0.15);
    border: 1px solid rgba(217, 83, 79, 0.35);
    color: #d9534f;
}

.calendarDay.day-future {
    background: transparent;
    border: 1px dashed rgba(255, 255, 255, 0.2);
}

.calendarDay.selected {
    border: 2px solid #ffffff !important;
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.calendarDay.today-marker {
    text-decoration: underline;
    font-weight: 900;
}

.calendarDay.empty {
    background: transparent;
    cursor: default;
    border: none;
}

.calendarDay.empty:hover {
    background: transparent;
}

#habitsList li.failed {
    opacity: 0.8;
    border-left: 3px solid #d9534f;
    background: rgba(217, 83, 79, 0.1);
    color: #ffb3b3;
}
.btnFail { 
    background: transparent; border: none; cursor: pointer; 
    font-size: 1.2rem; color: #d9534f; transition: 0.2s; 
}
.btnFail:hover { transform: scale(1.2); }

/* --- MODERN TOAST NOTIFICATION --- */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1a1a1a;
    color: #b6f500;
    padding: 12px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.7);
    border: 1px solid rgba(182, 245, 0, 0.4);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10000;
    font-family: 'Roboto', sans-serif;
    font-weight: bold;
    pointer-events: none;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* --- CUSTOM DELETE MODAL --- */
.modal-overlay {
    display: none; 
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7); 
    backdrop-filter: blur(5px);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.modal-box {
    background: #1a1a1a;
    padding: 30px 40px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    color: white;
    max-width: 400px;
    animation: popIn 0.3s ease-out;
}

@keyframes popIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-box h3 {
    color: #d9534f;
    margin-bottom: 10px;
    font-size: 1.5rem;
    font-family: 'Roboto', sans-serif;
}

.modal-box p {
    color: #d1d1d1;
    margin-bottom: 25px;
    font-family: 'Lato', sans-serif;
}

.modal-actions {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.modal-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: 0.3s;
}

.modal-btn.cancel { background: #333; color: white; }
.modal-btn.cancel:hover { background: #555; }
.modal-btn.confirm { background: #d9534f; color: white; }
.modal-btn.confirm:hover { background: #c9302c; }