:root {
  --bg-dark: #0A1128;
  --bg-panel: #162447;
  --bg-panel-hover: #1F2D5A;
  
  --primary: #F05D23;
  --primary-hover: #D94A15;
  --primary-light: rgba(240, 93, 35, 0.2);
  
  --secondary: #3B82F6;
  --success: #10B981;
  
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  
  --border: rgba(255, 255, 255, 0.1);
  --glass-bg: rgba(22, 36, 71, 0.6);
  --glass-border: rgba(255, 255, 255, 0.08);
  
  --radius: 12px;
  --radius-sm: 8px;
  
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", "Noto Sans", Helvetica, Arial, sans-serif;
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(240, 93, 35, 0.05), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(59, 130, 246, 0.05), transparent 25%);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  overflow-x: hidden;
}

.app-container {
  width: 100%;
  max-width: 1200px;
  display: flex;
  flex-direction: column;
  padding: 1rem 2rem;
  height: 100vh;
}

/* Glassmorphism */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  margin-bottom: 2rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--primary);
}

.logo i {
  font-size: 1.75rem;
}

.logo h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--border);
  background-color: var(--bg-panel);
  color: var(--text-main);
}

.btn:hover {
  background-color: var(--bg-panel-hover);
  transform: translateY(-1px);
}

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

.btn-primary {
  background-color: var(--primary);
  border-color: transparent;
  color: white;
  box-shadow: 0 4px 12px rgba(240, 93, 35, 0.3);
}

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

.btn-icon {
  padding: 0.6rem;
  border-radius: 50%;
  aspect-ratio: 1;
}

.btn-large {
  padding: 0.8rem 2rem;
  font-size: 1.1rem;
  border-radius: 30px;
}

/* Main Layout */
main {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  flex: 1;
  min-height: 0;
}

/* Timer Section */
.timer-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.timer-modes {
  display: flex;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.4rem;
  border-radius: 30px;
  margin-bottom: 2rem;
}

.mode-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.5rem 1.25rem;
  border-radius: 20px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.mode-btn:hover {
  color: var(--text-main);
}

.mode-btn.active {
  background: var(--bg-panel-hover);
  color: var(--text-main);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.mode-btn[data-mode="pomodoro"].active {
  background: var(--primary);
  color: white;
}

.mode-btn[data-mode="shortBreak"].active {
  background: var(--secondary);
  color: white;
}

.mode-btn[data-mode="longBreak"].active {
  background: var(--success);
  color: white;
}

.timer-display {
  font-size: 6rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 2rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: -2px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.timer-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.progress-container {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.05);
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--primary);
  transition: width 1s linear, background-color 0.3s;
}

.session-stats {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 600;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Kanban Board Section */
.board-section {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0; /* Important for scrollable flex children */
  gap: 1.5rem;
}

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

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

.add-task-form {
  display: flex;
  gap: 0.5rem;
  width: 100%;
  max-width: 400px;
}

.add-task-form input {
  flex: 1;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.add-task-form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}

.kanban-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  flex: 1;
  min-height: 0;
}

.kanban-column {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  border-radius: var(--radius);
  position: relative;
}

.kanban-column.active-column {
  border: 2px solid var(--primary-light);
  box-shadow: 0 0 15px var(--primary-light) inset;
}

.active-indicator {
  display: none;
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: white;
  font-size: 0.7rem;
  font-weight: bold;
  padding: 2px 10px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kanban-column.active-column .active-indicator {
  display: block;
}

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

.column-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
}

.task-count {
  background: rgba(0, 0, 0, 0.3);
  padding: 0.1rem 0.5rem;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: bold;
}

.task-list {
  list-style: none;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 100px;
  /* styling for sortable area */
  padding-bottom: 2rem;
}

/* Tasks */
.task-item {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  padding: 1rem;
  border-radius: var(--radius-sm);
  cursor: grab;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.task-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: rgba(255, 255, 255, 0.2);
}

.task-item:active {
  cursor: grabbing;
}

.task-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.task-text {
  font-size: 0.9rem;
  font-weight: 500;
  word-break: break-word;
}

.task-actions {
  display: flex;
  opacity: 0;
  transition: opacity 0.2s;
}

.task-item:hover .task-actions {
  opacity: 1;
}

.task-actions button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem;
  font-size: 1rem;
}

.task-actions button:hover {
  color: #ef4444;
}

.task-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.task-pomodoros {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--primary);
  font-weight: 600;
}

/* SortableJS Classes */
.sortable-ghost {
  opacity: 0.4;
  background: var(--primary-light);
  border: 1px dashed var(--primary);
}

.sortable-drag {
  opacity: 1 !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5) !important;
  cursor: grabbing !important;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 17, 40, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  width: 100%;
  max-width: 450px;
  background: var(--bg-panel);
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.show .modal {
  transform: translateY(0);
}

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

.modal-header h2 {
  font-size: 1.25rem;
}

.modal-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
}

.form-group input[type="number"] {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
}

.checkbox-group {
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
}

.checkbox-group input[type="checkbox"] {
  width: 1.2rem;
  height: 1.2rem;
  accent-color: var(--primary);
}

.checkbox-group label {
  color: var(--text-main);
}

.modal-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-panel-hover);
  color: var(--text-main);
  padding: 0.75rem 1.5rem;
  border-radius: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 1000;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.toast.success i {
  color: var(--success);
}

/* Celebration Overlay */
.celebration-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(240, 93, 35, 0.9);
  backdrop-filter: blur(10px);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s;
}

.celebration-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.celebration-content {
  text-align: center;
  color: white;
  transform: scale(0.8);
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.celebration-overlay.show .celebration-content {
  transform: scale(1);
}

.emoji-bounce {
  font-size: 6rem;
  margin-bottom: 1rem;
  animation: bounce 1s infinite alternate;
}

.celebration-content h2 {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  font-weight: 800;
}

.celebration-content p {
  font-size: 1.5rem;
  opacity: 0.9;
}

@keyframes bounce {
  from { transform: translateY(0); }
  to { transform: translateY(-30px); }
}

/* Responsive */
@media (max-width: 900px) {
  .kanban-board {
    grid-template-columns: 1fr;
    overflow-y: auto;
    gap: 1rem;
  }
  
  .kanban-column {
    min-height: 300px;
  }
}

@media (max-width: 600px) {
  .app-container {
    padding: 1rem;
  }
  
  .timer-display {
    font-size: 4.5rem;
  }
  
  .board-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .add-task-form {
    max-width: 100%;
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}
