:root {
  --primary: #ff6b6b;
  --secondary: #4ecdc4;
  --success: #95e1d3;
  --background: #1a1a2e;
  --background-light: #16213e;
  --text: #f0f0f0;
  --card-bg: rgba(255, 255, 255, 0.08);
  --card-border: rgba(255, 255, 255, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background: linear-gradient(
    135deg,
    var(--background),
    var(--background-light)
  );
  color: var(--text);
  min-height: 100vh;
  padding: 20px;
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* Background elements for a cozy feel */
.background-elements {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.floating-shape {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  animation: float 15s infinite ease-in-out;
}

.shape-1 {
  width: 150px;
  height: 150px;
  top: 10%;
  left: 5%;
  animation-delay: 0s;
}

.shape-2 {
  width: 100px;
  height: 100px;
  top: 70%;
  left: 80%;
  animation-delay: -5s;
}

.shape-3 {
  width: 80px;
  height: 80px;
  top: 40%;
  left: 85%;
  animation-delay: -10s;
}

.shape-4 {
  width: 120px;
  height: 120px;
  top: 80%;
  left: 15%;
  animation-delay: -7s;
}

@keyframes float {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  25% {
    transform: translate(20px, 30px) rotate(90deg);
  }
  50% {
    transform: translate(0, 60px) rotate(180deg);
  }
  75% {
    transform: translate(-20px, 30px) rotate(270deg);
  }
  100% {
    transform: translate(0, 0) rotate(360deg);
  }
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

header {
  text-align: center;
  padding: 20px 0;
  margin-bottom: 30px;
}

h1 {
  font-size: 2.8rem;
  margin-bottom: 10px;
  background: linear-gradient(to right, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
  font-size: 1.2rem;
  opacity: 0.8;
  max-width: 600px;
  margin: 0 auto;
}

.main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
  margin-bottom: 30px;
}

@media (max-width: 900px) {
  .main-grid {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 25px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  border: 1px solid var(--card-border);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.card-title {
  font-size: 1.5rem;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title i {
  color: var(--secondary);
}

/* Timer Styles */
.timer-container {
  position: relative;
  width: 300px;
  height: 300px;
  margin: 0 auto 25px;
}

.timer-circle {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.timer-circle.active-work {
  box-shadow: 0 0 30px rgba(255, 107, 107, 0.5);
}

.timer-circle.active-break {
  box-shadow: 0 0 30px rgba(78, 205, 196, 0.5);
}

.timer-progress {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  clip-path: polygon(50% 50%, 50% 0%, 100% 0%, 100% 100%, 0% 100%, 0% 0%);
  transform: rotate(-90deg);
  transition: clip-path 1s linear;
}

.work-progress {
  background: conic-gradient(
    var(--primary) 0%,
    var(--primary) 100%,
    transparent 100%
  );
}

.break-progress {
  background: conic-gradient(
    var(--secondary) 0%,
    var(--secondary) 100%,
    transparent 100%
  );
}

.timer-display {
  font-size: 3.5rem;
  font-weight: 700;
  z-index: 2;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.timer-label {
  font-size: 1.5rem;
  margin-top: 10px;
  text-align: center;
  font-weight: 600;
}

.session-type {
  display: inline-block;
  padding: 5px 15px;
  border-radius: 20px;
  font-weight: 600;
  margin-bottom: 20px;
}

.work-session {
  background: rgba(255, 107, 107, 0.2);
  color: var(--primary);
}

.break-session {
  background: rgba(78, 205, 196, 0.2);
  color: var(--secondary);
}

.controls {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 25px;
  flex-wrap: wrap;
}

.btn {
  padding: 12px 25px;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-secondary {
  background: var(--secondary);
  color: white;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--secondary);
  color: var(--secondary);
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Task Management */
.task-input-container {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.task-input {
  flex: 1;
  min-width: 200px;
  padding: 15px;
  border-radius: 12px;
  border: 2px solid var(--card-border);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text);
  font-size: 1.1rem;
  transition: border-color 0.3s;
}

.task-input:focus {
  outline: none;
  border-color: var(--secondary);
}

.task-display {
  background: rgba(0, 0, 0, 0.2);
  padding: 20px;
  border-radius: 15px;
  margin: 20px 0;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.current-task {
  font-size: 1.4rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 15px;
}

.task-status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
}

.task-status.completed {
  color: var(--success);
}

.task-history {
  max-height: 200px;
  overflow-y: auto;
  margin-top: 20px;
}

.history-item {
  padding: 12px 15px;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  justify-content: space-between;
}

.history-item:last-child {
  border-bottom: none;
}

/* Stats Section */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--card-bg);
  border-radius: 15px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 10px 0;
}

.stat-label {
  font-size: 1rem;
  opacity: 0.8;
}

.focus-score {
  color: var(--secondary);
}

.sessions-completed {
  color: var(--primary);
}

.focus-streak {
  color: var(--success);
}

.productive-time {
  color: #ffd166;
}

/* Charts */
.chart-container {
  height: 300px;
  margin-top: 20px;
}

/* Notification */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--card-bg);
  border-left: 5px solid var(--secondary);
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  transform: translateX(120%);
  transition: transform 0.5s ease;
  z-index: 1000;
  backdrop-filter: blur(10px);
  border: 1px solid var(--card-border);
  max-width: 350px;
}

.notification.show {
  transform: translateX(0);
}

.notification-content {
  display: flex;
  align-items: center;
  gap: 15px;
}

.notification-icon {
  font-size: 1.8rem;
  color: var(--secondary);
}

.notification-text {
  font-size: 1.1rem;
  flex: 1;
}

.notification-close {
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 5px;
}

/* Particles */
.particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
}

.particle {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.7;
  animation: particleAnimation 1.5s ease-out forwards;
}

@keyframes particleAnimation {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 0.7;
  }
  100% {
    transform: translate(var(--tx), var(--ty)) scale(0);
    opacity: 0;
  }
}

/* Alarm Modal */
.alarm-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.alarm-modal.show {
  opacity: 1;
  pointer-events: all;
}

.alarm-content {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 40px;
  text-align: center;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(10px);
}

.alarm-icon {
  font-size: 4rem;
  color: var(--primary);
  margin-bottom: 20px;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

.alarm-title {
  font-size: 2rem;
  margin-bottom: 20px;
}

.alarm-message {
  font-size: 1.2rem;
  margin-bottom: 30px;
  opacity: 0.9;
}

/* Timer Selector */
.timer-selector {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin: 20px 0;
}

.timer-selector label {
  font-weight: 600;
  font-size: 1.1rem;
}

.timer-selector select {
  padding: 12px 15px;
  border-radius: 12px;
  border: 2px solid var(--card-border);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text);
  appearance: none;
}

.timer-selector select option {
  background: var(--background);
  color: var(--text);
  padding: 12px;
  color: var(--text);
  font-size: 1rem;
}

/* Delete task button */
.delete-task-btn {
  background: none;
  border: none;
  color: var(--text);
  opacity: 0.6;
  cursor: pointer;
  padding: 5px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.delete-task-btn:hover {
  opacity: 1;
  color: var(--primary);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .timer-container {
    width: 250px;
    height: 250px;
  }

  .timer-display {
    font-size: 2.8rem;
  }

  .controls {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    justify-content: center;
    margin-bottom: 10px;
  }

  .task-input-container {
    flex-direction: column;
  }

  .task-input {
    min-width: 100%;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .alarm-content {
    padding: 30px 20px;
  }

  h1 {
    font-size: 2.2rem;
  }

  .subtitle {
    font-size: 1rem;
  }
}

/* Smooth animations */
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
