/* ============================================
   CHECK-IN TOOL - Styling
   ============================================ */

.checkin-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    padding: 20px 0;
}

/* ---------- Title ---------- */
.checkin-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-dark);
    text-align: center;
    margin: 0;
}

/* ---------- Pie Chart ---------- */
.checkin-chart-wrapper {
    position: relative;
    width: 340px;
    height: 340px;
}

.checkin-pie {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.08));
}

.checkin-pie .pie-segment {
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.checkin-pie .pie-segment:hover {
    opacity: 0.82;
}

/* ---------- Pie Tooltip ---------- */
.checkin-tooltip {
    position: fixed;
    background: var(--text-dark);
    color: #fff;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 1000;
    white-space: nowrap;
    box-shadow: var(--shadow-md);
}

.checkin-tooltip.visible {
    opacity: 1;
}

/* ---------- Center Total ---------- */
.checkin-total {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-white);
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    pointer-events: none;
    z-index: 1;
}

.checkin-total .total-number {
    font-size: 36px;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1;
}

.checkin-total .total-label {
    font-size: 12px;
    color: var(--text-medium);
    font-weight: 600;
    margin-top: 2px;
}

@keyframes countPop {
    0% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.15); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

.checkin-total.pop {
    animation: countPop 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Smiley Buttons ---------- */
.checkin-smileys {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    padding: 8px 0;
}

.checkin-smiley-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid #E8E8F0;
    background: var(--bg-white);
    cursor: pointer;
    font-size: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

.checkin-smiley-btn:hover {
    transform: scale(1.12);
    box-shadow: var(--shadow-md);
}

.checkin-smiley-btn:active {
    transform: scale(0.95);
}

@keyframes smileyBounce {
    0% { transform: scale(1); }
    30% { transform: scale(1.3); }
    50% { transform: scale(0.9); }
    70% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.checkin-smiley-btn.clicked {
    animation: smileyBounce 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Floating +1 ---------- */
@keyframes floatUp {
    0% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-60px) scale(1.3); }
}

.checkin-float-plus {
    position: absolute;
    font-size: 22px;
    font-weight: 800;
    pointer-events: none;
    animation: floatUp 0.7s ease-out forwards;
    z-index: 10;
}

/* ---------- Reset Button ---------- */
.checkin-reset-btn {
    padding: 12px 32px;
    font-size: 15px;
    font-weight: 600;
    background: var(--bg-light);
    color: var(--text-medium);
    border: 2px solid #E8E8F0;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.checkin-reset-btn:hover {
    background: var(--bg-white);
    border-color: var(--secondary);
    color: var(--secondary);
    box-shadow: 0 4px 16px rgba(255, 107, 107, 0.15);
    transform: translateY(-2px);
}

/* ---------- Settings Checkbox ---------- */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* ---------- Week Overview Section ---------- */
.checkin-week-section {
    margin-top: 8px;
}

.checkin-week-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.checkin-week-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-dark);
    margin: 0;
}

/* ---------- PDF Download Button ---------- */
.checkin-pdf-btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.checkin-pdf-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(108, 99, 255, 0.3);
}

.checkin-week-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

/* Individual day column */
.checkin-week-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 16px 8px;
    border-radius: var(--radius-md);
    background: var(--bg-light);
    transition: var(--transition);
}

.checkin-week-day.today {
    background: #EEEDFB;
    box-shadow: inset 0 0 0 2px var(--primary);
}

.checkin-week-day.empty {
    opacity: 0.5;
}

.week-day-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-medium);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.checkin-week-day.today .week-day-name {
    color: var(--primary);
}

/* Average mood smiley */
.week-day-mood {
    font-size: 40px;
    line-height: 1;
}

/* Stacked bar */
.week-day-bar {
    width: 100%;
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    background: #E8E8F0;
}

.week-day-bar-segment {
    height: 100%;
    transition: width 0.4s ease;
}

/* Total count */
.week-day-count {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-dark);
}

.week-day-count span {
    color: var(--text-medium);
    font-weight: 500;
}

/* No data state */
.week-day-empty {
    font-size: 13px;
    color: var(--text-light);
    text-align: center;
    padding: 8px 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .checkin-week-grid {
        gap: 8px;
    }

    .checkin-week-day {
        padding: 12px 4px;
    }

    .week-day-mood {
        font-size: 32px;
    }
}

@media (max-width: 600px) {
    .checkin-container {
        gap: 20px;
    }

    .checkin-title {
        font-size: 22px;
    }

    .checkin-chart-wrapper {
        width: 260px;
        height: 260px;
    }

    .checkin-total {
        width: 80px;
        height: 80px;
    }

    .checkin-total .total-number {
        font-size: 28px;
    }

    .checkin-smiley-btn {
        width: 64px;
        height: 64px;
        font-size: 36px;
    }

    .checkin-smileys {
        gap: 10px;
    }

    .checkin-week-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 4px;
    }

    .checkin-week-day {
        padding: 10px 2px;
        gap: 8px;
    }

    .week-day-name {
        font-size: 11px;
    }

    .week-day-mood {
        font-size: 26px;
    }

    .week-day-count {
        font-size: 12px;
    }

    .checkin-week-title {
        font-size: 18px;
    }
}
