body { margin: 0; }
/* ===== VARIABILE ===== */
:root {
  --accent-color: #a259ff;
  --border-color: rgba(255, 255, 255, 0.16);
  --input-bg-color: rgba(255, 255, 255, 0.08);
  --card-bg-color: rgba(255, 255, 255, 0.05);
  --ring-work: #a259ff;
  --ring-short: #2ee6d6;
  --ring-long: #00b2ff;
  --ring-bg: rgba(240, 240, 240, 0.08);
  --center-bg: rgba(255, 255, 255, 0.02);
  --center-border: rgba(255, 255, 255, 0.1);
  --center-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  --text-color: #f0f0f0;
  --ring-color: var(--ring-work);
}

body.light-mode {
  --accent-color: #8b5cf6;
  --border-color: rgba(0, 0, 0, 0.16);
  --input-bg-color: rgba(0, 0, 0, 0.04);
  --card-bg-color: rgba(0, 0, 0, 0.03);
  --ring-work: #8b5cf6;
  --ring-short: #10b981;
  --ring-long: #3b82f6;
  --ring-bg: rgba(45, 55, 72, 0.08);
  --center-bg: rgba(255, 255, 255, 0.8);
  --center-border: rgba(0, 0, 0, 0.05);
  --center-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  --text-color: #2d3748;
  background-color: #f8f9fa;
  color: #222;
}

/* ===== STRUCTURA PRINCIPALĂ ===== */
.pomodoro-title {
  font-weight: 700;
  font-size: 1.25rem;
  text-align: center;
  margin: .25rem 0 .5rem;
}

#section-pomodoro .tool-content-wrapper {
  position: relative;
}

/* ===== CONTROALE ===== */
.pomodoro-controls {
  display: flex;
  justify-content: center;
  gap: .5rem;
  margin-top: 1rem;
}

.main-btn {
  padding: .6rem 1rem;
  font-size: 1rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  background: var(--accent-color);
  color: #fff;
}

.secondary-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  padding: .4rem .75rem;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text);
}

/* ===== BUTOANE SUPERIOARE ===== */
#pomodoroMenuBtn, #pomodoroReportBtn.report-btn {
  position: absolute !important;
  top: 12px !important;
  z-index: 122 !important;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: .25rem .5rem;
  cursor: pointer;
  color: var(--text);
}

#pomodoroMenuBtn {
  right: 12px !important;
}

#pomodoroReportBtn.report-btn {
  right: 48px !important;
}

/* ===== CERCUL POMODORO ===== */
.pomodoro-ring {
  position: relative;
  width: 320px;
  height: 320px;
  margin: 1rem auto;
  background: transparent;
}

.pomodoro-svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
  overflow: visible;
}

.pomodoro-svg .track {
  fill: none;
  stroke: var(--ring-bg);
  stroke-width: 3;
  stroke-linecap: round;
  opacity: 0.3;
}

.pomodoro-svg .progress {
  fill: none;
  stroke: var(--ring-color, var(--ring-work));
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.5s cubic-bezier(0.4, 0, 0.2, 1), stroke 0.3s ease;
}

.pomodoro-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: var(--center-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--center-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: var(--center-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.pomodoro-status {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--ring-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.8;
}

.pomodoro-display {
  font-size: 3rem;
  font-weight: 300;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--text-color);
  transition: transform 0.2s ease;
}

.current-task-name {
  font-size: 0.85rem;
  opacity: 0.6;
  margin-bottom: 0.75rem;
  text-align: center;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Stări pentru inel */
#section-pomodoro.state-work { --ring-color: var(--ring-work); }
#section-pomodoro.state-shortbreak { --ring-color: var(--ring-short); }
#section-pomodoro.state-longbreak { --ring-color: var(--ring-long); }

/* Stilizare pentru tranziția între stări */
.state-transitioning .pomodoro-center {
  transform: translate(-50%, -50%) scale(0.95);
  opacity: 0.8;
}

.state-transitioning .pomodoro-display {
  transform: scale(1.05);
}

/* ===== STATISTICI ===== */
.pomodoro-stats {
  margin-top: 1rem;
  display: block !important;
}

.stats-row {
  display: flex;
  gap: 1rem;
  margin-top: .5rem;
}

.stat-box {
  flex: 1;
  background: rgba(255,255,255,0.04);
  padding: .5rem;
  border-radius: 8px;
}

body.light-mode .stat-box {
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.12);
}

.stat-label {
  font-size: .85rem;
  opacity: .7;
}

.stat-value {
  font-weight: bold;
}

.goal-bar {
  height: 6px;
  background: var(--border-color);
  border-radius: 3px;
  margin-top: .25rem;
}

body.light-mode .goal-bar {
  background: rgba(0,0,0,0.12);
}

.goal-bar div {
  height: 100%;
  background: var(--accent-color);
  border-radius: 3px;
}

.weekly-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  height: 50px;
  margin-top: .5rem;
}

.weekly-bar .day {
  flex: 1;
  margin: 0 2px;
  background: var(--accent-color);
  border-radius: 3px 3px 0 0;
}

/* ===== MENIU SETĂRI ===== */
.pomodoro-menu {
  position: absolute;
  right: 12px;
  top: 56px;
  width: 300px;
  max-width: calc(100vw - 2rem);
  background: var(--bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,.28);
  padding: .75rem;
  z-index: 130;
}

.pomodoro-menu.hidden {
  display: none;
}

.menu-title {
  margin-bottom: .5rem;
  font-size: .95rem;
  opacity: .8;
}

.pomodoro-settings .setting-group {
  display: flex;
  justify-content: space-between;
  margin-bottom: .5rem;
  align-items: center;
}

.pomodoro-settings .setting-group input[type="number"],
.pomodoro-settings .setting-group select {
  padding: .25rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--input-bg-color);
  color: var(--text);
}

.pomodoro-settings .setting-group input[type="number"] {
  width: 60px;
}

.pomodoro-settings .setting-group select {
  width: 180px;
}

.pomodoro-settings .setting-group.toggles label {
  font-size: .9rem;
  display: flex;
  gap: .25rem;
  align-items: center;
}

.menu-sep {
  height: 1px;
  background: var(--border-color);
  margin: .5rem 0;
  opacity: .7;
}

.pomodoro-menu .danger-btn {
  width: 100%;
  margin-top: .5rem;
  padding: .5rem .75rem;
  border-radius: 8px;
  border: 1px solid rgba(255,0,0,.35);
  background: transparent;
  color: #ff6b6b;
  cursor: pointer;
}

/* ===== LISTA DE TASK-URI ===== */
.time-tracking-tasks#pomodoroTasks {
  margin-top: 1.5rem;
}

.task-input-container {
  display: flex;
  gap: .5rem;
  margin-bottom: .75rem;
}

.task-input {
  flex: 1;
  padding: .5rem .75rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--input-bg-color);
  color: var(--text);
}

.add-task-btn {
  padding: .5rem .9rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: transparent;
  cursor: pointer;
  color: var(--text);
}

.task-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.task-list li {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: .5rem .6rem;
  transition: all 0.2s ease;
}

body.light-mode .task-list li {
  background: rgba(0,0,0,0.03);
  border-color: rgba(0,0,0,0.12);
}

.task-list li.selected {
  border-left: 4px solid var(--accent-color);
  background: linear-gradient(90deg, rgba(162,89,255,.10) 0%, var(--card-bg-color) 20%);
}

/* ===== RAPOARTE ===== */
.report-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.report-modal.hidden {
  display: none;
}

.report-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
}

.report-content {
  position: relative;
  background: var(--bg);
  color: var(--text);
  width: min(920px, 92vw);
  max-height: 86vh;
  overflow: auto;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
  padding: 1rem;
}

body.light-mode .report-content {
  background: #fff;
  color: #111;
  border-color: rgba(0,0,0,0.15);
}

.report-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .9rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

.report-close {
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: .25rem .6rem;
  cursor: pointer;
  color: var(--text);
}

.report-cards {
  display: grid;
  gap: .75rem;
  grid-template-columns: repeat(3, minmax(0,1fr));
}

.report-card {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: .75rem;
}

body.light-mode .report-card {
  background: rgba(0,0,0,0.03);
  border-color: rgba(0,0,0,0.12);
}

.report-card .label {
  font-size: .9rem;
  opacity: .7;
  margin-bottom: .25rem;
}

.report-card .value {
  font-size: 1.4rem;
  font-weight: 700;
}

.report-section {
  margin-top: 1rem;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: .75rem;
}

body.light-mode .report-section {
  background: rgba(0,0,0,0.03);
  border-color: rgba(0,0,0,0.12);
}

.section-title {
  font-weight: 700;
  margin-bottom: .5rem;
}

.report-table-wrap {
  overflow: auto;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
}

.report-table th, .report-table td {
  padding: .5rem;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}

.report-actions {
  margin-top: 1rem;
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

/* ===== ANIMAȚII ===== */
@keyframes modern-pulse {
  0%   { stroke-width: 8; }
  50%  { stroke-width: 10; }
  100% { stroke-width: 8; }
}

.pomodoro-ring.ending-soon .pomodoro-svg .progress {
  animation: modern-pulse 1s ease-in-out infinite;
}

* {
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 720px) {
  .report-cards {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }
}

@media (max-width: 480px) {
  .pomodoro-ring {
    width: 280px;
    height: 280px;
  }
  
  .pomodoro-center {
    width: 190px;
    height: 190px;
  }
  
  .pomodoro-display {
    font-size: 2.5rem;
  }
  
  .stats-row {
    flex-direction: column;
  }
  
  .report-cards {
    grid-template-columns: 1fr;
  }
  
  .pomodoro-menu {
    width: calc(100vw - 2rem);
    right: 1rem;
  }
}
/* Additional styles for task management */
.task-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.delete-task-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0 0.25rem;
}

.delete-task-btn:hover {
  color: #ff6b6b;
}

/* Toast notifications */
.toast {
  background: var(--accent-color);
  color: white;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  animation: toastSlideIn 0.3s ease-out;
  font-size: 0.9rem;
  font-weight: 500;
  max-width: 300px;
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.1);
}

.toast-success {
  background: #10b981;
  border-color: rgba(255,255,255,0.2);
}

.toast-error {
  background: #ef4444;
  border-color: rgba(255,255,255,0.2);
}

.toast-warning {
  background: #f59e0b;
  border-color: rgba(255,255,255,0.2);
}

.toast-info {
  background: #3b82f6;
  border-color: rgba(255,255,255,0.2);
}

@keyframes toastSlideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast-exit {
  animation: toastSlideOut 0.3s ease-in forwards;
}

@keyframes toastSlideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* Weekly bars in stats */
.weekly-bar .day {
  background: var(--accent-color);
  transition: height 0.3s ease;
  min-height: 4px;
}

/* Pomodoro Settings: FULLSCREEN ONLY on phones (desktop width unchanged) */
@media (max-width: 600px) {
  \1width: 600px;
    height: 100vh;
    margin: 0;
    border-radius: 0;
    padding: 1rem;
    box-sizing: border-box;
    overflow-y: auto;
    z-index: 9999;
    background: var(--bg-color, #111);
  }
}

#section-pomodoro .pomodoro-stats { display: none !important; }


#section-pomodoro .pomodoro-menu {
  width: 600px;
  max-width: 96vw;
  box-sizing: border-box;
}

#section-pomodoro .pomodoro-settings .setting-group { display: flex; align-items: center; gap: .5rem; }

#section-pomodoro .pomodoro-settings .setting-group label { white-space: nowrap; flex: 0 0 160px; margin: 0; }

#section-pomodoro .pomodoro-settings .setting-group select { flex: 1 1 auto; min-width: 0; }


/* Hide stats from main Pomodoro card (show only in Report) */
#section-pomodoro .pomodoro-stats {
  display: none !important;
}


/* === Pomodoro Backdrop & Scroll Lock === */
#settingsBackdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 9998;
  display: none;
}
body.pomodoro-settings-open { overflow: hidden; }

/* === Pomodoro Settings Fullscreen on Mobile === */
#pomodoroSettingsBackdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1500;
}
#pomodoroSettingsBackdrop.hidden { display: none; }

@media (max-width: 768px) {
  .pomodoro-menu {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 0 !important;
    top: 0 !important;
    right: 0 !important;
    padding: 1rem !important;
    overflow-y: auto !important;
    z-index: 2000 !important;
  }
  
}

/* === FIX: Header Settings + X aligned with spacing === */
.pomodoro-menu .menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .75rem;
}
.pomodoro-menu .menu-title {
  margin: 0;
  font-weight: 600;
  font-size: 1rem;
}
#pomodoroCloseBtn {
  margin-left: auto;
  background: transparent;
  border: none;
  line-height: 1;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--text-color);
}
#pomodoroCloseBtn:hover { opacity:.8; }
body.light-mode #pomodoroCloseBtn { color:#111; }


/* === HARD FULLSCREEN CLASS (works regardless of media query) === */
.pomodoro-menu.is-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  max-height: none !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 1rem !important;
  overflow-y: auto !important;
  z-index: 100000 !important;
  background: var(--bg, #0b0b0b) !important;
}

html.no-scroll, body.no-scroll {
  overflow: hidden !important;
  height: 100dvh !important;
  overscroll-behavior: none !important;
}

/* Ensure true fullscreen look - no rounded corners or shadows */
.pomodoro-menu.is-fullscreen {
  border-radius: 0 !important;
  box-shadow: none !important;
  background: var(--bg, #0b0b0b) !important;
}


/* === Hard layout fullscreen for Pomodoro Settings === */
.pomodoro-menu.is-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 1rem !important;
  overflow-y: auto !important;
  z-index: 100000 !important;
  background: var(--bg, #0b0b0b) !important;
}

html.no-scroll, body.no-scroll {
  overflow: hidden !important;
  height: 100dvh !important;
  overscroll-behavior: none !important;
}

#pomodoroSettingsBackdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 99990;
}
#pomodoroSettingsBackdrop.hidden { display: none; }
