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

/* ===== Base ===== */
body {
    font-family: 'Inter', sans-serif;
    background-color: #F8FAFC;
}

/* Hide scrollbar but keep scrollable */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Glass panel */
.glass-panel {
    background: #FFFFFF;
    border-radius: 1.25rem;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.02), 0 8px 10px -6px rgba(0,0,0,0.01);
    border: 1px solid #F1F5F9;
    transition: box-shadow 0.3s ease;
}
.glass-panel:hover {
    box-shadow: 0 12px 30px -5px rgba(0,0,0,0.04), 0 10px 14px -6px rgba(0,0,0,0.02);
}

/* ===== Calendar ===== */
.cal-cell {
    padding: 6px 0;
    border-radius: 8px;
    cursor: pointer;
    position: relative;
    transition: all 0.15s ease;
    user-select: none;
}
.cal-cell:hover { background: #F8FAFC; }
.cal-cell.today {
    background: #F43F5E;
    color: #fff;
    box-shadow: 0 4px 12px rgba(244,63,94,0.25);
}
.cal-cell.today:hover { background: #E11D48; }
.cal-cell.selected {
    background: #F0FDFA;
    color: #0D9488;
    border: 1px solid #99F6E4;
}
.cal-cell.other-month { color: #CBD5E1; }
.cal-cell .cal-dot {
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #2DD4BF;
}
.cal-cell.today .cal-dot { background: #fff; }

/* ===== Todo ===== */
.todo-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    cursor: pointer;
}
.todo-item:hover {
    background: #F8FAFC;
    border-color: #F1F5F9;
}
.todo-item.done .todo-title {
    text-decoration: line-through;
    color: #94A3B8;
}
.todo-item .todo-checkbox {
    margin-top: 2px;
    width: 18px;
    height: 18px;
    accent-color: #14B8A6;
    cursor: pointer;
}
.todo-item .todo-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
    line-height: 1.4;
}
.todo-item .todo-meta {
    font-size: 0.75rem;
    margin-top: 3px;
}
.todo-filter-btn.active {
    background: #F1F5F9 !important;
    color: #475569 !important;
}

/* ===== Todo delete button ===== */
.todo-item .todo-delete {
    opacity: 0;
    transition: opacity 0.15s ease;
    margin-left: auto;
    flex-shrink: 0;
}
.todo-item:hover .todo-delete { opacity: 1; }

/* ===== Stats bars ===== */
.stat-bar-wrapper {
    width: 100%;
    background: #F1F5F9;
    border-radius: 4px 4px 0 0;
    position: relative;
}
.stat-bar {
    position: absolute;
    bottom: 0;
    width: 100%;
    border-radius: 4px 4px 0 0;
    transition: height 0.5s ease, background 0.3s ease;
}
.stat-bar:hover { filter: brightness(1.08); }
.stat-bar.today-bar { box-shadow: 0 4px 12px rgba(20,184,166,0.25); }

/* ===== Habits ===== */
.habit-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid;
    transition: all 0.2s ease;
}
.habit-item .habit-check-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.habit-item .habit-check-btn:hover {
    transform: scale(1.1);
}
.habit-item .habit-check-btn.checked {
    animation: checkBounce 0.3s ease;
}
@keyframes checkBounce {
    0% { transform: scale(1); }
    50% { transform: scale(1.25); }
    100% { transform: scale(1); }
}

/* ===== Habit delete button ===== */
.habit-item .habit-delete {
    opacity: 0;
    transition: opacity 0.15s ease;
}
.habit-item:hover .habit-delete { opacity: 1; }

/* ===== Pomodoro ===== */
.pomo-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    transition: all 0.3s ease;
}
.pomo-dot.filled { background: #F43F5E; box-shadow: 0 2px 6px rgba(244,63,94,0.3); }
.pomo-dot.empty  { background: #E2E8F0; }

/* ===== Modal ===== */
#modal-overlay.show { display: flex !important; }
#modal-overlay.show #modal-content {
    transform: scale(1);
    opacity: 1;
}
.modal-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    font-size: 0.875rem;
    color: #334155;
    outline: none;
    transition: border-color 0.2s ease;
}
.modal-input:focus {
    border-color: #14B8A6;
    box-shadow: 0 0 0 3px rgba(20,184,166,0.1);
}
.modal-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748B;
    margin-bottom: 6px;
}
.modal-select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    font-size: 0.875rem;
    color: #334155;
    background: #fff;
    outline: none;
    cursor: pointer;
}
.modal-select:focus {
    border-color: #14B8A6;
}

/* ===== Toast ===== */
.toast {
    background: #334155;
    color: #fff;
    padding: 10px 18px;
    border-radius: 12px;
    font-size: 0.8125rem;
    font-weight: 500;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    pointer-events: auto;
    animation: toastIn 0.3s ease forwards;
    max-width: 300px;
}
.toast.toast-out {
    animation: toastOut 0.25s ease forwards;
}
@keyframes toastIn {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(40px); }
}

/* ===== Mobile responsive ===== */
@media (max-width: 1023px) {
    body {
        padding: 12px;
        height: auto !important;
        min-height: 100vh;
    }
    .glass-panel { border-radius: 1rem; }

    #app-main {
        grid-template-columns: 1fr;
        overflow-y: visible;
        padding-bottom: 24px;
        flex: none;
        height: auto;
    }
    #app-main > section {
        height: auto !important;
        min-height: 0;
    }
    /* Pomodoro needs explicit padding on mobile */
    #pomodoro-panel {
        min-height: 460px;
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
    /* Todo & Habits panels need min-height so they're visible */
    #todo-panel {
        min-height: 200px;
    }
    #habits-panel {
        min-height: 160px;
    }
    /* Smaller timer ring on small mobile */
    @media (max-width: 400px) {
        #pomo-time { font-size: 2.5rem !important; }
    }
}

/* ===== Tabular nums for timer ===== */
.tabular-nums { font-variant-numeric: tabular-nums; }
