:root{
  --bg:#0f1724;
  --card:#0b1220;
  --accent:#7c5cff;
  --accent-2:#00d4ff;
  --accent-3:#5ef3b2;
  --muted:#98a0b3;
  --glass: rgba(255,255,255,0.04);
  --glow: 0 8px 40px rgba(92,77,255,0.12), 0 2px 8px rgba(0,212,255,0.06);
  --progress-height: 14px;
}

*{box-sizing:border-box}
html,body{
  height:100%;
  margin:0;
  padding:0;
  overflow-x:hidden;
}
body{
  font-family:Inter,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial;
  background:
    radial-gradient(1200px 600px at 10% 10%, rgba(124,92,255,0.10), transparent),
    linear-gradient(180deg, rgba(0,0,0,0.05), transparent),
    var(--bg);
  background-color:var(--bg);
  color:#e6eef8;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:32px;
  min-height:100vh;
}

.container{
  width:100%;
  max-width:920px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border-radius:14px;
  padding:28px;
  box-shadow: 0 8px 30px rgba(2,6,23,0.7), inset 0 1px 0 rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.03);
}

.header h1{
  margin:0;
  font-size:1.6rem;
  font-weight:800;
  letter-spacing:-0.02em;
}
.subtitle{margin:6px 0 18px;color:var(--muted);font-size:0.95rem}

.config{
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-bottom:18px;
}
.controls{
  display:flex;
  gap:8px;
  align-items:center;
}
input[type="datetime-local"]{
  background:var(--glass);
  border:1px solid rgba(255,255,255,0.03);
  color:inherit;
  padding:10px 12px;
  border-radius:8px;
  box-shadow: none;
  font-size:0.95rem;
}
.btn{
  background:linear-gradient(90deg,var(--accent),var(--accent-2));
  color:white;
  padding:10px 14px;
  border:none;
  border-radius:8px;
  cursor:pointer;
  font-weight:600;
}
.btn:hover{opacity:0.95}
.btn-ghost{
  background:transparent;
  color:var(--muted);
  border:1px solid rgba(255,255,255,0.04);
}
.btn-accent {
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  color: #fff;
}

.status{color:var(--muted);font-size:0.9rem;margin-top:6px}

.countdown{
  display:flex;
  justify-content:center;
  align-items:center;
  padding:18px 0 8px;
}
.timer-wrap{
  width:100%;
  max-width:920px;
  text-align:center;
  padding:18px 28px;
  border-radius:12px;
  background:linear-gradient(180deg, rgba(255,255,255,0.01), rgba(255,255,255,0.005));
  border:1px solid rgba(255,255,255,0.02);
  transition: transform 300ms cubic-bezier(.2,.9,.3,1), box-shadow 300ms;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.timer-wrap:hover{
  transform: translateY(-4px);
  box-shadow: var(--glow);
}

.phase{
  color:var(--accent-2);
  font-weight:700;
  letter-spacing:0.02em;
  margin-bottom:6px;
  font-size:1.2rem;
}
.timer{
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono", monospace;
  font-size:2.4rem;
  font-weight:700;
  margin:6px 0 14px;
  color: #ffffff;
  white-space: nowrap;
  display: block;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
  text-shadow: 0 2px 20px rgba(124,92,255,0.12);
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
}

.phase-bottom{
  margin-top:12px;
  font-weight:700;
  color:var(--muted);
  font-size:1.05rem;
}

.progress-bar{
  height:var(--progress-height);
  width:100%;
  background:rgba(255,255,255,0.03);
  border-radius:999px;
  overflow:hidden;
  margin-top:12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
}
.progress-fill{
  height:100%;
  width:0%;
  background: linear-gradient(90deg, rgba(124,92,255,0.95), rgba(0,212,255,0.95));
  border-radius:999px;
  transition: none;
  box-shadow: 0 6px 20px rgba(124,92,255,0.08);
}

.footer{
  margin-top:14px;
  text-align:center;
  color:var(--muted);
  font-size:0.85rem;
}

@media (max-width:520px){
  .timer{font-size:1.6rem}
  .controls{flex-direction:column;align-items:stretch}
  .phase,.phase-bottom{font-size:1rem}
}

/* --- Phases editor styles --- */
.phases-editor {
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.02);
}
.phases-editor h3{
  margin: 0 0 8px 0;
  font-size: 1.05rem;
}
.phases-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}
.phase-item{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(255,255,255,0.01);
  border: 1px solid rgba(255,255,255,0.02);
}
.phase-item-title{font-weight:700;flex:1}
.phase-item-duration{color:var(--muted);min-width:80px;text-align:right}
.phase-item-controls{display:flex;gap:8px}
.btn-small{padding:6px 8px;font-size:0.9rem;border-radius:6px}
.badge{margin-left:8px;padding:4px 8px;border-radius:999px;font-weight:700;font-size:0.8rem}
.badge.running{background: linear-gradient(90deg,var(--accent-2),var(--accent)); color:#051025}
.badge.done{background: rgba(255,255,255,0.03); color:var(--muted)}

.add-phase-form{
  display:flex;
  gap:8px;
  align-items:center;
  margin-top:8px;
  flex-wrap: wrap;
}
.add-phase-form input[type="text"],
.phase-edit-title{
  padding:8px;
  border-radius:8px;
  border:1px solid rgba(255,255,255,0.03);
  background:var(--glass);
  color:inherit;
  min-width:0;
  flex:2 1 120px;
}
.add-phase-form input[type="number"],
.phase-edit-hours,
.phase-edit-mins{
  width:80px;
  min-width:0;
  padding:8px;
  border-radius:8px;
  border:1px solid rgba(255,255,255,0.03);
  background:var(--glass);
  color:inherit;
  flex:1 1 60px;
}
@media (max-width: 600px) {
  .add-phase-form{
    flex-direction:column;
    align-items:stretch;
    gap:6px;
  }
  .add-phase-form input,
  .add-phase-form button {
    width:100%;
    min-width:0;
    box-sizing:border-box;
  }
}

/* Checkbox label responsiveness */
.show-next-phase-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: normal;
  margin-left: 12px;
}
@media (max-width: 520px) {
  .show-next-phase-label {
    margin: 8px 0 0 0;
    width: 100%;
    justify-content: flex-start;
  }
  .controls {
    flex-direction: column;
    align-items: stretch;
  }
}

.phases-hint{color:var(--muted);font-size:0.85rem;margin-top:8px}

.phases-empty{
  color:var(--muted);
  font-style:italic;
  text-align:center;
  padding:20px;
}

/* presentation mode adjustments - FIXED to prevent scrollbars */
.presentation {
  overflow: hidden !important;
}

.presentation html,
.presentation body {
  overflow: hidden !important;
  height: 100vh !important;
  max-height: 100vh !important;
}

.presentation .container {
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  padding: 0;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
  background:
    radial-gradient(1200px 600px at 10% 10%, rgba(124,92,255,0.10), transparent),
    linear-gradient(180deg, rgba(0,0,0,0.04), transparent),
    var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: none;
  box-shadow: none;
}

.presentation .config,
.presentation .header,
.presentation .footer,
.presentation .status {
  display: none !important;
}

.presentation .timer-wrap {
  padding: 0;
  margin: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  max-width: 90vw;
  width: 90vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  animation: gentle-pulse 6s ease-in-out infinite;
}

.presentation .timer {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono", monospace;
  font-weight:700;
  letter-spacing: 0.01em;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  white-space: nowrap;
  display: inline-block;
  word-break: normal;
  overflow-wrap: normal;
  font-variant-numeric: tabular-nums;
  text-shadow:
    0 6px 30px rgba(92,77,255,0.18),
    0 2px 8px rgba(0,212,255,0.06);
  max-width: 100%;
  overflow: hidden;
}

.presentation .phase {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  font-size: clamp(18px, 2.6vw, 36px);
  color: var(--accent-3);
  font-weight: 700;
  margin-bottom: 0.35rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.95;
  text-shadow: 0 4px 18px rgba(92,77,255,0.08);
}

.presentation .phase-bottom {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  font-size: clamp(18px, 2.2vw, 34px);
  margin-top: 0.6rem;
  color: rgba(255,255,255,0.90);
  font-weight:700;
  letter-spacing: 0.02em;
}

.presentation .progress-bar{
  height: clamp(10px, 1.2vh, 28px);
  margin-top: 2vh;
  max-width: 85vw;
  width: 85vw;
  margin-left: auto;
  margin-right: auto;
  background: rgba(255,255,255,0.04);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.presentation .progress-fill{
  height:100%;
  width:0%;
  background: linear-gradient(90deg, rgba(124,92,255,0.98), rgba(0,212,255,0.98));
  box-shadow: 0 10px 40px rgba(92,77,255,0.12);
  border-radius: 999px;
}

/* FIXED: Animation that doesn't cause scrollbars - only changes opacity and text-shadow */
@keyframes gentle-pulse {
  0% { 
    opacity: 1; 
    text-shadow: 0 6px 30px rgba(92,77,255,0.18), 0 2px 8px rgba(0,212,255,0.06); 
  }
  50% { 
    opacity: 0.98; 
    text-shadow: 0 8px 35px rgba(92,77,255,0.22), 0 3px 12px rgba(0,212,255,0.08); 
  }
  100% { 
    opacity: 1; 
    text-shadow: 0 6px 30px rgba(92,77,255,0.18), 0 2px 8px rgba(0,212,255,0.06); 
  }
}

.presentation .timer-wrap.urgent .timer {
  color: #ffecb3;
  text-shadow: 0 8px 40px rgba(255,190,60,0.18), 0 2px 12px rgba(255,80,60,0.06);
  transition: color 120ms ease, text-shadow 120ms ease;
}

.presentation .timer-wrap.urgent .progress-fill {
  box-shadow: 0 14px 60px rgba(255,80,60,0.12);
}

.presentation body,
.presentation * {
  cursor: default;
  overflow: hidden;
}

.presentation.hide-cursor * { 
  cursor: none; 
}

.presentation .timer,
.presentation .phase,
.presentation .phase-bottom {
  -webkit-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

.presentation .timer-wrap:hover {
  transform: none;
  box-shadow: none;
}

@media (max-height: 500px) {
  .presentation .timer { font-size: clamp(28px, 9vw, 120px); }
  .presentation .phase { font-size: clamp(14px, 3.2vw, 26px); }
  .presentation .phase-bottom { font-size: clamp(12px, 2.8vw, 22px); }
}
