/* Custom animations and styles */

@keyframes pop {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.habit-cell {
    transition: all 0.2s ease;
    cursor: pointer;
    animation: fadeIn 0.3s ease forwards;
    opacity: 0;
}

.habit-cell:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.habit-cell.completed {
    animation: pop 0.3s ease;
}

.habit-cell.today {
    animation: pulse 2s ease-in-out infinite;
}

/* Stagger the grid animation */
.habit-cell:nth-child(1) { animation-delay: 0.01s; }
.habit-cell:nth-child(2) { animation-delay: 0.02s; }
.habit-cell:nth-child(3) { animation-delay: 0.03s; }
.habit-cell:nth-child(4) { animation-delay: 0.04s; }
.habit-cell:nth-child(5) { animation-delay: 0.05s; }
.habit-cell:nth-child(6) { animation-delay: 0.06s; }
.habit-cell:nth-child(7) { animation-delay: 0.07s; }
.habit-cell:nth-child(8) { animation-delay: 0.08s; }
.habit-cell:nth-child(9) { animation-delay: 0.09s; }
.habit-cell:nth-child(10) { animation-delay: 0.10s; }
.habit-cell:nth-child(11) { animation-delay: 0.11s; }
.habit-cell:nth-child(12) { animation-delay: 0.12s; }
.habit-cell:nth-child(13) { animation-delay: 0.13s; }
.habit-cell:nth-child(14) { animation-delay: 0.14s; }
.habit-cell:nth-child(15) { animation-delay: 0.15s; }
.habit-cell:nth-child(16) { animation-delay: 0.16s; }
.habit-cell:nth-child(17) { animation-delay: 0.17s; }
.habit-cell:nth-child(18) { animation-delay: 0.18s; }
.habit-cell:nth-child(19) { animation-delay: 0.19s; }
.habit-cell:nth-child(20) { animation-delay: 0.20s; }
.habit-cell:nth-child(21) { animation-delay: 0.21s; }
.habit-cell:nth-child(22) { animation-delay: 0.22s; }
.habit-cell:nth-child(23) { animation-delay: 0.23s; }
.habit-cell:nth-child(24) { animation-delay: 0.24s; }
.habit-cell:nth-child(25) { animation-delay: 0.25s; }
.habit-cell:nth-child(26) { animation-delay: 0.26s; }
.habit-cell:nth-child(27) { animation-delay: 0.27s; }
.habit-cell:nth-child(28) { animation-delay: 0.28s; }
.habit-cell:nth-child(29) { animation-delay: 0.29s; }
.habit-cell:nth-child(30) { animation-delay: 0.30s; }

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #dc2626, #1f2937);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #b91c1c, #000000);
}

/* Modal animation */
#setupModal {
    animation: fadeIn 0.3s ease;
}

#setupModal > div {
    animation: pop 0.4s ease;
}

/* Tooltip styles */
.tooltip {
    position: absolute;
    background: #1f2937;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 50;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.tooltip.visible {
    opacity: 1;
}

/* Success animation for completion */
@keyframes success {
    0% {
        transform: scale(0.8) rotate(0deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(180deg);
    }
    100% {
        transform: scale(1) rotate(360deg);
        opacity: 1;
    }
}

.success-animation {
    animation: success 0.6s ease;
}