/* =========================================================
   KeoTeach · Modo concentración (Pomodoro)
========================================================= */

.kf-button { position: relative; width: auto; min-width: 40px; gap: 6px; padding-inline: 10px; }
.kf-mini { font-variant-numeric: tabular-nums; font-size: 12.5px; font-weight: 700; }
.kf-mini:empty { display: none; }
.kf-button.is-running { color: #fff; border-color: transparent; background: linear-gradient(135deg, var(--primary), var(--cyan)); box-shadow: 0 6px 18px rgba(118, 103, 255, .35); }
.kf-button.is-running.is-break { background: linear-gradient(135deg, var(--green), var(--cyan)); box-shadow: 0 6px 18px rgba(66, 211, 146, .35); }
.kf-button.is-running i { animation: kfTick 1s steps(2) infinite; }
.kf-button.kf-ding { animation: kfDing .8s cubic-bezier(.3, 1.6, .5, 1); }

.kf-panel {
    --kf: var(--primary);
    --kf-2: var(--cyan);
    position: fixed; z-index: 900; right: 18px; top: calc(var(--topbar-height) + 10px);
    width: min(360px, calc(100vw - 24px)); max-height: calc(100vh - var(--topbar-height) - 24px); overflow-y: auto;
    padding: 18px; border: 1px solid var(--border); border-radius: var(--radius-xl);
    background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--kf) 16%, transparent), transparent 60%), var(--surface);
    box-shadow: var(--shadow-lg);
    opacity: 0; transform: translateY(-10px) scale(.97); transform-origin: top right;
    transition: opacity .22s ease, transform .22s cubic-bezier(.2, .9, .3, 1.2);
}
.kf-panel.show { opacity: 1; transform: none; }
.kf-panel.hidden { display: none; }
.kf-panel.is-break { --kf: var(--green); --kf-2: var(--cyan); }

.kf-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.kf-head h3 { margin: 0; display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-size: 17px; }
.kf-head h3 i { color: var(--kf); }

.kf-presets { display: flex; gap: 6px; justify-content: center; margin-bottom: 8px; }
.kf-preset { padding: 5px 12px; border: 1px solid var(--border); border-radius: 100px; background: var(--surface-2); color: var(--text-soft); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; transition: all .15s ease; }
.kf-preset.active { border-color: var(--kf); color: var(--text); background: color-mix(in srgb, var(--kf) 18%, var(--surface-2)); }
.kf-preset:disabled { opacity: .5; cursor: default; }

.kf-ring-wrap { position: relative; width: 210px; height: 210px; margin: 6px auto 4px; }
.kf-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.kf-track { fill: none; stroke: var(--surface-3); stroke-width: 12; }
.kf-bar { fill: none; stroke: var(--kf); stroke-width: 12; stroke-linecap: round; transition: stroke-dashoffset 1s linear, stroke .3s ease; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--kf) 60%, transparent)); }
.kf-panel.is-running .kf-ring-wrap { animation: kfBreath 4s ease-in-out infinite; }
.kf-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.kf-phase { color: var(--kf); font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.kf-time { font-family: var(--font-display); font-size: 46px; line-height: 1; font-variant-numeric: tabular-nums; color: var(--text); }
.kf-cycle { color: var(--text-muted); font-size: 12px; }

.kf-tip { margin: 6px 0 12px; text-align: center; color: var(--text-soft); font-size: 13px; }

.kf-controls { display: flex; justify-content: center; gap: 8px; margin-bottom: 14px; }
.kf-controls .btn-primary { min-width: 130px; }

.kf-task { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; font-size: 12.5px; color: var(--text-muted); }
.kf-task input { padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-3); color: var(--text); font: inherit; font-size: 14px; }
.kf-task input:focus { outline: none; border-color: var(--kf); }

.kf-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.kf-stats div { display: flex; flex-direction: column; align-items: center; padding: 10px 6px; border-radius: var(--radius-sm); background: var(--surface-2); }
.kf-stats strong { font-family: var(--font-display); font-size: 20px; }
.kf-stats span { color: var(--text-muted); font-size: 11.5px; text-align: center; }

.kf-week-title { display: block; margin-bottom: 6px; color: var(--text-muted); font-size: 12px; }
.kf-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; align-items: end; height: 80px; }
.kf-day { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.kf-day b { width: 100%; max-width: 22px; border-radius: 6px 6px 3px 3px; background: color-mix(in srgb, var(--kf) 45%, var(--surface-3)); animation: kfGrow .6s cubic-bezier(.2, .8, .2, 1) both; }
.kf-day.today b { background: linear-gradient(180deg, var(--kf-2), var(--kf)); }
.kf-day span { color: var(--text-muted); font-size: 11px; text-transform: uppercase; }

@keyframes kfTick { 50% { transform: rotate(12deg); } }
@keyframes kfDing { 0%, 100% { transform: none; } 30% { transform: scale(1.25) rotate(-10deg); } 60% { transform: scale(.95) rotate(8deg); } }
@keyframes kfBreath { 50% { transform: scale(1.025); } }
@keyframes kfGrow { from { transform: scaleY(0); transform-origin: bottom; } }

@media (max-width: 600px) {
    .kf-panel { right: 12px; left: 12px; width: auto; }
    .kf-button .kf-mini { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .kf-button.is-running i, .kf-button.kf-ding, .kf-panel.is-running .kf-ring-wrap, .kf-day b { animation: none; }
    .kf-panel { transition: none; }
}
