:root {
  /* Themes */
  --focus-bg: #ff5f5f;
  --short-bg: #48c9b0;
  --long-bg: #5dade2;

  --focus-accent: rgba(255, 255, 255, 0.2);
  --glass-bg: rgba(255, 255, 255, 0.15);
  --glass-border: rgba(255, 255, 255, 0.3);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.8);

  --font-family: 'Outfit', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  transition: all 0.8s ease-in-out;
  overflow-x: hidden;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
}

body.theme-focus { 
  background-color: var(--focus-bg);
  background-image: linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.45)), url('focus.png'); 
}
body.theme-short { 
  background-color: var(--short-bg);
  background-image: linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.45)), url('short.png'); 
}
body.theme-long { 
  background-color: var(--long-bg);
  background-image: linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.45)), url('long.png'); 
}

#app {
  width: 100%;
  max-width: 600px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

header {
  display: flex;
  justify-content: center;
}

.header-content {
  width: 100%;
  max-width: 480px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--glass-border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
}

.logo i {
  width: 24px;
  height: 24px;
}

.icon-btn {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  background: var(--glass-bg);
}

main {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
}

.timer-container {
  padding: 2.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.mode-selector {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.mode-btn {
  background: none;
  border: none;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s;
}

.mode-btn.active {
  background: rgba(0, 0, 0, 0.15);
}

.timer-display {
  font-size: 8rem;
  font-weight: 700;
  line-height: 1;
}

.timer-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

.reset-btn {
  padding: 0.75rem;
  opacity: 0.6;
  transition: opacity 0.2s, transform 0.2s;
}

.reset-btn:hover {
  opacity: 1;
  transform: rotate(-30deg);
}

.main-btn {
  background: white;
  border: none;
  color: #333;
  padding: 1rem 3.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.2s;
  box-shadow: 0 6px 0 #ddd;
}

.main-btn.small {
  padding: 0.75rem 2rem;
  font-size: 1.1rem;
}

.main-btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #ddd;
}

.tasks-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

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

.tasks-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  transition: opacity 0.3s;
}

.task-item.completed {
  opacity: 0.6;
}

.task-item span {
  flex: 1;
  font-weight: 400;
}

.task-item.completed span {
  text-decoration: line-through;
}

.task-item.active {
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(0, 0, 0, 0.3);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

.task-item .task-text {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.task-progress {
  font-size: 0.85rem;
  font-weight: 700;
  opacity: 0.7;
}

/* Info Section */
.info-section {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1rem;
}

.info-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 1rem;
}

.info-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.info-header i {
  width: 20px;
  height: 20px;
  opacity: 0.8;
}

.info-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.info-content > p {
  line-height: 1.6;
  opacity: 0.9;
  font-size: 1rem;
}

.info-steps {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.step {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.2s, background 0.2s;
}

.step:hover {
  background: rgba(0, 0, 0, 0.2);
  transform: translateX(5px);
}

.step-number {
  min-width: 28px;
  height: 28px;
  background: white;
  color: #333;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

.step p {
  font-size: 0.95rem;
  line-height: 1.4;
  opacity: 0.85;
}

/* Modals */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
}

.modal.hidden {
  display: none;
}

.modal-content {
  width: 90%;
  max-width: 400px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.settings-group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.settings-group label {
  font-weight: 600;
  opacity: 0.8;
}

.timer-inputs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.input-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.input-item span {
  font-size: 0.75rem;
  opacity: 0.7;
}

.input-item input {
  background: rgba(0, 0, 0, 0.1);
  border: 1px solid var(--glass-border);
  color: white;
  padding: 0.75rem;
  border-radius: 8px;
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
}

.text-input {
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: #333;
  padding: 0.85rem;
  border-radius: 12px;
  width: 100%;
  font-family: inherit;
  font-size: 1.1rem;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.text-input::placeholder {
  color: #999;
  font-weight: 400;
}

.text-input:focus {
  outline: none;
  border-color: #ff5f5f;
  box-shadow: 0 0 0 3px rgba(255, 95, 95, 0.1);
}

.est-pomodoros {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.est-pomodoros label {
  font-size: 0.9rem;
  font-weight: 700;
  opacity: 0.8;
}

.est-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.est-controls input[type="number"] {
  width: 70px;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--glass-border);
  color: white;
  padding: 0.5rem;
  border-radius: 8px;
  font-weight: 600;
}

.icon-btn.small {
  padding: 0.4rem;
  background: rgba(255, 255, 255, 0.1);
}

.icon-btn.small:hover {
  background: rgba(255, 255, 255, 0.2);
}

.modal-footer {
  margin-top: 1rem;
  background: rgba(0, 0, 0, 0.05);
  padding: 1rem;
  margin: 0 -2rem -2rem -2rem;
  border-radius: 0 0 24px 24px;
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  align-items: center;
}

.text-btn {
  background: none;
  border: none;
  color: white;
  opacity: 0.6;
  cursor: pointer;
  font-weight: 600;
}

.text-btn:hover {
  opacity: 1;
}

.toggle-group {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

.toggle-btn {
  width: 48px;
  height: 24px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  border: none;
  transition: background 0.3s;
}

.toggle-btn::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: left 0.3s;
}

.toggle-btn.on {
  background: rgba(255, 255, 255, 0.4);
}

.toggle-btn.on::after {
  left: 26px;
}

/* Animations */
@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.02); opacity: 0.9; }
  100% { transform: scale(1); opacity: 1; }
}

.timer-running .timer-display {
  animation: pulse 2s infinite ease-in-out;
}

.task-item:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  transition: all 0.2s;
}

@media (max-width: 480px) {
  .timer-display {
    font-size: 5rem;
  }
}
