/* ===== HABITS SECTION ===== */
.habits-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 100%;
}

.habits-left {
    flex: 1;
}

.habits-right {
    flex: 1;
}

.habits-header {
    margin-bottom: 16px;
}

.habits-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 12px;
}

.date-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.date-btn {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    padding: 4px;
    transition: color var(--transition-speed) ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.date-btn:hover {
    color: var(--color-gold);
}

.date-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.date-btn svg {
    display: block;
}

.current-date {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-primary);
    min-width: 100px;
    text-align: center;
}

/* ===== HABITS LIST ===== */
.habits-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.habit-item {
    background-color: var(--color-bg-elevated);
    border-radius: 8px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background-color var(--transition-speed) ease;
}

.habit-item:hover {
    background-color: #323232;
}

.habit-name {
    font-size: 14px;
    font-weight: 400;
    color: var(--color-text-primary);
    user-select: none;
}

.habit-checkbox {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    border: 2px solid var(--color-text-tertiary);
    background: transparent;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    flex-shrink: 0;
}

.habit-checkbox:hover {
    border-color: var(--color-gold);
}

.habit-checkbox.checked {
    background-color: var(--color-gold);
    border-color: var(--color-gold);
    position: relative;
}

.habit-checkbox.checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--color-bg-primary);
    font-size: 13px;
    font-weight: bold;
}

.loading-text {
    text-align: center;
    color: var(--color-text-secondary);
    padding: 32px;
    font-size: 14px;
}

/* ===== PERFORMANCE CHART ===== */
.performance-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--color-text-primary);
    margin-bottom: 12px;
    text-align: center;
}

.performance-chart {
    background-color: var(--color-bg-elevated);
    border-radius: 8px;
    padding: 16px;
    min-height: 200px;
}

#chart-canvas {
    width: 100% !important;
    height: 200px !important;
}

/* ===== RESPONSIVE - DESKTOP ===== */
@media (min-width: 768px) {
    .habits-container {
        flex-direction: row;
        align-items: flex-start;
        gap: 24px;
        max-width: 1200px;
        margin: 0 auto;
    }

    .habits-left {
        flex: 1;
    }

    .habits-right {
        flex: 1;
        margin-top: 62px; /* Align with habits list (title + date nav height) */
    }

    .habits-title {
        font-size: 18px;
    }

    .performance-chart {
        min-height: 220px;
    }

    #chart-canvas {
        height: 220px !important;
    }
}

/* ===== CELEBRATION MODAL ===== */
.celebration-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.celebration-modal.show {
    opacity: 1;
    pointer-events: auto;
}

.celebration-content {
    background: linear-gradient(135deg, var(--color-bg-elevated), var(--color-bg-secondary));
    border: 2px solid var(--color-gold);
    border-radius: 24px;
    padding: 48px 32px;
    text-align: center;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(212, 175, 55, 0.3);
    animation: celebrationBounce 0.6s ease-out;
    position: relative;
    z-index: 2;
}

@keyframes celebrationBounce {
    0% {
        transform: scale(0.3) translateY(-100px);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.celebration-emoji {
    font-size: 80px;
    margin-bottom: 20px;
    animation: emojiRotate 0.8s ease-in-out;
}

@keyframes emojiRotate {
    0% {
        transform: rotate(0deg) scale(0);
    }
    50% {
        transform: rotate(180deg) scale(1.2);
    }
    100% {
        transform: rotate(360deg) scale(1);
    }
}

.celebration-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-gold);
    margin-bottom: 12px;
}

.celebration-text {
    font-size: 16px;
    color: var(--color-text-secondary);
    line-height: 1.5;
}

.confetti {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
}

.confetti::before,
.confetti::after {
    content: '🎊';
    position: absolute;
    font-size: 40px;
    animation: confettiFall 3s ease-in-out infinite;
}

.confetti::before {
    left: 20%;
    animation-delay: 0.2s;
}

.confetti::after {
    right: 20%;
    animation-delay: 0.5s;
}

@keyframes confettiFall {
    0% {
        top: -10%;
        transform: rotate(0deg);
        opacity: 1;
    }
    100% {
        top: 100%;
        transform: rotate(720deg);
        opacity: 0;
    }
}
