/* Custom CSS Styling for FocusFlow Daily Scheduler */

:root {
  --bg-main: #0c0d12;
  --bg-card: rgba(20, 22, 32, 0.6);
  --bg-card-hover: rgba(28, 30, 44, 0.7);
  --border-light: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(138, 43, 226, 0.4);
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dark: #6b7280;
  
  /* Palette & Accents */
  --accent-glow: #8a2be2;
  --accent-blue: #3b82f6;
  --accent-teal: #10b981;
  --accent-warning: #f59e0b;
  --accent-alert: #ef4444;
  
  --shadow-premium: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(138, 43, 226, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(59, 130, 246, 0.05) 0%, transparent 40%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
}

/* App Wrapper */
.app-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Header */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  box-shadow: var(--shadow-premium);
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  color: var(--accent-blue);
  width: 28px;
  height: 28px;
}

.main-header h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #fff 30%, var(--text-muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 32px;
}

.clock-card {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

#current-date {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

#current-time {
  font-family: 'Outfit', monospace;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.5px;
}

.overall-progress-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-circle-wrapper {
  position: relative;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-ring {
  transform: rotate(-90deg);
}

.progress-ring__circle {
  transition: stroke-dashoffset 0.35s;
  transform-origin: 50% 50%;
}

#overall-progress-text {
  position: absolute;
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 700;
}

.progress-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  max-width: 60px;
  line-height: 1.2;
}

/* Layout Grid */
.main-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 24px;
}

/* Common Section Cards */
.section-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-premium);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.section-card h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: -0.2px;
}

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

/* Sidebar Column */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Timetable List Styling */
.timetable-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 4px;
}

/* Scrollbar Styling */
.timetable-list::-webkit-scrollbar,
.history-list::-webkit-scrollbar {
  width: 6px;
}

.timetable-list::-webkit-scrollbar-track,
.history-list::-webkit-scrollbar-track {
  background: transparent;
}

.timetable-list::-webkit-scrollbar-thumb,
.history-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

/* Project Group container in list */
.project-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.project-group-title {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 4px;
}

/* Task Item */
.task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  transition: var(--transition-smooth);
}

.task-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.06);
}

.task-item.active {
  border-color: var(--border-focus);
  background: rgba(138, 43, 226, 0.05);
  box-shadow: 0 0 15px -3px rgba(138, 43, 226, 0.15);
}

.task-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

/* Interactive Checkbox styling */
.checkbox-wrapper {
  position: relative;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.checkbox-wrapper input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.checkmark {
  position: absolute;
  top: 0;
  left: 0;
  height: 18px;
  width: 18px;
  background-color: transparent;
  border: 2px solid var(--text-dark);
  border-radius: 5px;
  transition: var(--transition-smooth);
}

.checkbox-wrapper:hover input ~ .checkmark {
  border-color: var(--accent-blue);
}

.checkbox-wrapper input:checked ~ .checkmark {
  background-color: var(--accent-teal);
  border-color: var(--accent-teal);
}

.checkmark:after {
  content: "";
  position: absolute;
  display: none;
}

.checkbox-wrapper input:checked ~ .checkmark:after {
  display: block;
}

.checkbox-wrapper .checkmark:after {
  left: 5px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.task-details {
  display: flex;
  flex-direction: column;
}

.task-name {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-main);
  transition: var(--transition-smooth);
}

.task-item.completed .task-name {
  text-decoration: line-through;
  color: var(--text-dark);
}

.task-time-badge {
  font-family: 'Outfit', monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
  width: fit-content;
  margin-top: 3px;
}

.task-item.active .task-time-badge {
  color: var(--text-main);
  background: rgba(138, 43, 226, 0.2);
}

.delete-task-btn {
  background: transparent;
  border: none;
  color: var(--text-dark);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition-smooth);
}

.task-item:hover .delete-task-btn {
  opacity: 1;
}

.delete-task-btn:hover {
  color: var(--accent-alert);
  background: rgba(239, 68, 68, 0.1);
}

/* Forms styling */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

input, select {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: var(--transition-smooth);
}

input:focus {
  border-color: var(--border-focus);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 10px rgba(138, 43, 226, 0.1);
}

/* Buttons styling */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  border: none;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-glow) 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.2);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border: 1px solid var(--border-light);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-alert {
  background: var(--accent-alert);
  color: white;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-alert:hover {
  background: #dc2626;
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.45);
}

.text-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition-smooth);
}

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

.text-btn.alert-text:hover {
  color: var(--accent-alert);
}

/* Active Timer Panel */
.timer-card {
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  min-height: 480px;
}

.timer-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-glow), var(--accent-blue), var(--accent-teal));
}

.alarm-banner {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(239, 68, 68, 0.95);
  backdrop-filter: blur(8px);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transform: translateY(-100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.alarm-banner.active {
  transform: translateY(0);
}

.alarm-banner-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 500px;
  color: white;
  font-weight: 600;
  font-size: 14px;
}

.bell-pulse {
  animation: bell-ring 1s infinite alternate;
}

@keyframes bell-ring {
  0% { transform: rotate(-15deg); }
  100% { transform: rotate(15deg); }
}

.active-task-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.project-tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  padding: 2px 8px;
  border-radius: 20px;
  letter-spacing: 1px;
}

.task-title {
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  font-weight: 700;
  max-width: 500px;
  line-height: 1.3;
}

.active-time-badge {
  font-family: 'Outfit', monospace;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.timer-display-wrapper {
  margin: 10px 0;
}

.timer-circle {
  position: relative;
  width: 220px;
  height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.timer-ring {
  position: absolute;
  top: 0;
  left: 0;
  transform: rotate(-90deg);
}

.timer-ring__circle {
  transition: stroke-dashoffset 0.1s linear;
  transform-origin: 50% 50%;
}

.timer-numeric {
  font-family: 'Outfit', sans-serif;
  font-size: 42px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -1px;
  z-index: 2;
  margin-top: 10px;
}

.timer-state-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  z-index: 2;
  text-transform: uppercase;
}

/* Linear progress block */
.linear-progress-wrapper {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.linear-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  overflow: hidden;
}

.linear-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-teal));
  border-radius: 10px;
  transition: width 1s linear;
}

.linear-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Controls list */
.timer-controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 10px;
}

.timer-controls .btn {
  padding: 10px 14px;
}

/* History Log List */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 4px;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 10px;
}

.history-date {
  font-family: 'Outfit', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
}

.history-stats {
  font-size: 12px;
  color: var(--text-muted);
}

.history-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
}

.badge-complete {
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-teal);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-incomplete {
  background: rgba(245, 158, 11, 0.1);
  color: var(--accent-warning);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.empty-history-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 30px 0;
  color: var(--text-dark);
  text-align: center;
}

.empty-icon {
  width: 36px;
  height: 36px;
  stroke-width: 1.5;
}

.empty-history-message p {
  font-size: 13px;
}

/* Responsive Styles */
@media (max-width: 900px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
  
  .app-container {
    padding: 16px;
  }
}

@media (max-width: 600px) {
  .main-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  
  .header-right {
    width: 100%;
    justify-content: space-between;
    gap: 16px;
  }
  
  .timer-controls {
    flex-wrap: wrap;
    width: 100%;
  }
  
  .timer-controls .btn {
    flex: 1 1 40%;
  }
}
