/* Modern Variables */
:root {
  --primary: #2563eb;
  --primary-light: #3b82f6;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --surface: #ffffff;
  --surface-light: #f8fafc;
  --background: #f1f5f9;
  --text: #0f172a;
  --text-light: #64748b;
  --border: #e2e8f0;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --glass-bg: rgba(255, 255, 255, 0.9);
  --glass-border: rgba(255, 255, 255, 0.2);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--background);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.app-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Enhanced Header Styles */
.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 2rem;
  align-items: center;
}

/* Enhanced App Title */
.app-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
}

.app-title i {
  font-size: 1.75rem;
  color: var(--primary);
  filter: drop-shadow(0 2px 4px rgba(37, 99, 235, 0.2));
}

.title-text {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
}

/* Header Navigation */
.header-nav {
  display: flex;
  gap: 0.5rem;
  padding: 0.25rem;
  background: var(--surface-light);
  border-radius: 12px;
  margin: 0 auto;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-light);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-btn i {
  font-size: 1rem;
}

.nav-btn:hover {
  color: var(--primary);
  background: var(--surface);
}

.nav-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

/* Enhanced Header Right Section */
.header-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.datetime {
  padding: 0.625rem 1rem;
  background: var(--surface-light);
  border-radius: 8px;
  font-family: 'Roboto Mono', monospace;
  font-size: 0.875rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.datetime i {
  color: var(--primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-btn {
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 8px;
  background: var(--surface-light);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.header-btn:hover {
  background: var(--surface);
  color: var(--primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.notification-badge {
  position: absolute;
  top: -0.25rem;
  right: -0.25rem;
  background: var(--danger);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  min-width: 1.25rem;
  height: 1.25rem;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.25rem;
}

.user-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 6px;
  object-fit: cover;
}

/* Responsive Header */
@media (max-width: 1024px) {
  .header-nav span {
    display: none;
  }

  .nav-btn {
    padding: 0.75rem;
  }

  .datetime span {
    display: none;
  }
}

@media (max-width: 768px) {
  .header-container {
    grid-template-columns: auto auto;
    gap: 1rem;
  }

  .header-center {
    display: none;
  }

  .header-right {
    gap: 0.75rem;
  }

  .datetime {
    display: none;
  }
}

/* Mobile Header Navigation Fix */
@media (max-width: 768px) {
  .header-container {
    grid-template-columns: auto 1fr auto;
    gap: 0.5rem;
  }

  .header-center {
    display: flex;
    justify-content: center;
  }

  .header-nav {
    padding: 0.25rem;
    background: transparent;
  }

  .nav-btn {
    padding: 0.5rem;
    min-width: 40px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .nav-btn i {
    font-size: 1.25rem;
  }

  /* Keep the navigation visible but compact */
  .header-right {
    display: flex;
    gap: 0.5rem;
  }
}

/* Mobile Header Size Adjustments */
@media (max-width: 768px) {
  .header-container {
    padding: 0.5rem 1rem;
  }

  .app-title {
    font-size: 1.25rem;
    gap: 0.5rem;
    padding: 0.25rem 0;
  }

  .app-title i {
    font-size: 1.25rem;
  }

  .nav-btn {
    padding: 0.5rem;
    min-width: 36px;
    min-height: 36px;
  }

  .nav-btn i {
    font-size: 1.125rem;
  }

  .header-btn {
    width: 2rem;
    height: 2rem;
  }

  .header-actions {
    gap: 0.5rem;
  }

  .header-right {
    gap: 0.5rem;
  }
}

/* Additional mobile optimization for very small screens */
@media (max-width: 375px) {
  .header-container {
    padding: 0.5rem;
    gap: 0.5rem;
  }

  .app-title {
    font-size: 1rem;
  }

  .app-title i {
    font-size: 1rem;
  }

  .nav-btn {
    min-width: 32px;
    min-height: 32px;
  }

  .header-btn {
    width: 1.75rem;
    height: 1.75rem;
  }
}

/* Updated Statistics Cards Styles */
.stats-container {
  max-width: 100%;
  margin: 0 auto 2rem;
  padding: 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  animation: slideDown 0.3s ease;
}

.stat-card {
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--surface-light);
  border-radius: 8px;
  transition: all 0.2s ease;
}

/* Responsive adjustments for stats */
@media (max-width: 640px) {
  .stats-container {
    padding: 1rem;
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-card {
    padding: 1rem;
  }

  .stat-value {
    font-size: 1.1rem;
  }

  .stat-label {
    font-size: 0.75rem;
  }
}

@media (max-width: 400px) {
  .stats-container {
    grid-template-columns: 1fr;
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Main Content Area */
.app-main {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

/* Quick Add Task Section */
.quick-add {
  background: var(--surface);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
}

.task-input-group {
  display: grid;
  gap: 1rem;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
}

.task-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

/* Form Elements */
input,
select,
textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 0.875rem;
  color: var (--text);
  background: var(--surface-light);
  transition: all 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

textarea {
  min-height: 100px;
  resize: vertical;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-light);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

/* Controls Bar */
.controls-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

/* Filter Buttons */
.filter-buttons {
  display: flex;
  gap: 0.5rem;
}

.filter-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var (--border);
  border-radius: 6px;
  background: var(--surface-light);
  color: var(--text-light);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  margin-left: 6px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.1);
  font-size: 0.75rem;
}

/* Search and Sort */
.search-sort {
  display: flex;
  gap: 1rem;
  margin-left: auto;
}

.search-box {
  position: relative;
}

.search-box i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
}

.search-box input {
  padding-left: .5rem;
  width: 250px;
  font-size: 0.75rem;
}

/* Sort Controls */
.sort-controls {
  display: flex;
  gap: 0.5rem;
}

/* Add these new styles after the existing task-list-container styles */

.task-list-wrapper {
  position: relative;
  min-height: 200px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  text-align: center;
  color: var(--text-light);
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--primary);
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.empty-state p {
  font-size: 0.875rem;
}

/* Enhanced Task List Styles */
.task-list {
  display: grid;
  gap: 1.25rem;
  padding: 0.75rem;
}

.task-item {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  background: var(--surface);
  border-radius: 16px;
  padding: 1.25rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.task-status-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.priority-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--surface-light);
}

.priority-label[data-priority="high"] {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.priority-label[data-priority="medium"] {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.priority-label[data-priority="low"] {
  background: rgba(34, 197, 94, 0.1);
  color: var(--success);
}

.task-timing {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.due-date {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text);
}

.countdown {
  padding: 0.375rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  font-family: 'Roboto Mono', monospace;
  background: var(--surface-light);
  color: var(--text);
}

.countdown.urgent {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
  animation: pulse 2s infinite;
}

.countdown.overdue {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.task-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.task-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

.task-description {
  color: var(--text-light);
  font-size: 0.925rem;
  line-height: 1.6;
  padding: 0.75rem;
  background: var(--surface-light);
  border-radius: 8px;
  margin-bottom: 1rem;
}

.task-indicators {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.813rem;
  background: var(--surface-light);
  color: var(--text-light);
}

.indicator i {
  font-size: 0.875rem;
  color: var(--primary);
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
  .task-status-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .task-timing {
    margin-left: 0;
    width: 100%;
    justify-content: space-between;
  }

  .task-indicators {
    gap: 0.5rem;
  }

  .indicator {
    flex: 1;
    justify-content: center;
  }
}

.task-item[data-priority="high"]::before {}

/* Countdown Animation */
@keyframes pulse {
  0% {
    opacity: 1;
  }

  50% {
    opacity: 0.6;
  }

  100% {
    opacity: 1;
  }
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
  .task-meta {
    grid-template-columns: 1fr;
  }

  .meta-group {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .meta-value {
    text-align: right;
  }
}

.task-item[data-priority="high"]::before {
  background: linear-gradient(to bottom, var(--danger), #dc2626);
}

.task-item[data-priority="medium"]::before {
  background: linear-gradient(to bottom, var(--warning), #d97706);
}

.task-item[data-priority="low"]::before {
  background: linear-gradient(to bottom, var(--success), #16a34a);
}

.task-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.task-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.task-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  margin: 0;
}

.task-meta {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.75rem;
  background: var(--surface-light);
  border-radius: 12px;
  font-size: 0.875rem;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-light);
}

.meta-item i {
  color: var(--primary);
  font-size: 1rem;
}

.task-description {
  color: var(--text-light);
  font-size: 0.925rem;
  line-height: 1.6;
  margin: 0;
  padding: 0.75rem;
  background: var(--surface-light);
  border-radius: 12px;
}

.task-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.action-btn {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: none;
  border-radius: 8px;
  color: var(--text);
  background: var(--surface-light);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.action-btn:hover {
  transform: translateY(-2px);
  background: var(--primary);
  color: white;
}

.edit-btn:hover {
  background: var(--warning);
}

.complete-btn:hover {
  background: var (--success);
}

.delete-btn:hover {
  background: var(--danger);
}

/* Task States */
.task-item.completed {
  opacity: 0.75;
}

.task-item.completed .task-title {
  text-decoration: line-through;
  color: var(--text-light);
}

.task-item.completed::before {
  background: var(--success) !important;
  opacity: 0.5;
}

.countdown {
  font-family: 'Roboto Mono', monospace;
  font-weight: 500;
}

.countdown.urgent {
  color: var(--danger);
  animation: pulse 2s infinite;
}

.countdown.overdue {
  color: white;
  background: var(--danger);
}

/* Hover Effects */
.task-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Mobile Optimizations */
@media (max-width: 768px) {
  .task-item {
    grid-template-columns: 1fr;
    padding: 1rem;
    gap: 1rem;
  }

  .task-actions {
    flex-direction: row;
    justify-content: flex-end;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
  }

  .meta-item {
    flex: 1;
    justify-content: center;
  }
}

/* Completed Task State */
.task-item.completed {
  background: var(--surface-light);
  opacity: 0.85;
}

.task-item.completed .task-title {
  text-decoration: line-through;
  color: var(--text-light);
}

.task-item.completed .status-indicator {
  background: var(--success);
  opacity: 0.5;
}

/* Mobile Optimization */
@media (max-width: 768px) {
  .task-item {
    grid-template-columns: 1fr auto;
    padding: 0.875rem;
  }

  .task-content {
    padding-left: 1rem;
  }

  .task-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .task-actions {
    flex-direction: row;
    padding-left: 0;
  }

  .status-indicator {
    width: 3px;
  }
}

/* Additional Animation */
.task-item {
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Task Item Styles */
.task-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem;
  position: relative;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.task-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 4px;
  background: var(--primary);
  opacity: 0.8;
}

.task-item[data-priority="high"]::before {
  background: linear-gradient(to bottom, var(--danger), #dc2626);
}

.task-item[data-priority="medium"]::before {
  background: linear-gradient(to bottom, var(--warning), #d97706);
}

.task-item[data-priority="low"]::before {
  background: linear-gradient(to bottom, var(--success), #16a34a);
}

.task-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 0 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.task-title-group {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  flex: 1;
}

.task-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  line-height: 1.4;
}

.task-priority-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: capitalize;
  white-space: nowrap;
}

.task-priority-badge[data-priority="high"] {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.task-priority-badge[data-priority="medium"] {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.task-priority-badge[data-priority="low"] {
  background: rgba(34, 197, 94, 0.1);
  color: var(--success);
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  background: var(--surface-light);
  border-radius: 8px;
  margin: 0;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-light);
}

.meta-item i {
  color: var(--primary);
  font-size: 1rem;
}

.task-description {
  color: var(--text-light);
  font-size: 0.925rem;
  line-height: 1.6;
  margin: 0;
  padding: 0.75rem;
  background: var(--surface-light);
  border-radius: 12px;
}

.task-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.action-btn {
  flex: 1;
  padding: 0.625rem 1rem;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-width: 120px;
}

.action-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.action-btn i {
  font-size: 1rem;
}

/* Task Status Indicators */
.task-status {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.status-badge.completed {
  background: rgba(34, 197, 94, 0.1);
  color: var (--success);
}

.status-badge.overdue {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

/* Completed Task Styling */
.task-item.completed {
  background: var(--surface-light);
  opacity: 0.85;
}

.task-item.completed .task-title {
  text-decoration: line-through;
  color: var (--text-light);
}

.task-item.completed::before {
  background: var(--success);
  opacity: 0.5;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
  .task-item {
    padding: 1rem;
  }

  .task-header {
    flex-direction: column;
    gap: 0.75rem;
  }

  .task-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .task-actions {
    flex-direction: column;
    gap: 0.5rem;
  }

  .action-btn {
    width: 100%;
  }

  .task-status {
    position: static;
    margin-top: 0.5rem;
  }
}

/* Task Priority Indicator */
.task-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 4px 0 0 4px;
  opacity: 0.8;
  transition: all 0.3s ease;
}

.task-item[data-priority="high"]::before {
  background: linear-gradient(to bottom, var(--danger), #dc2626);
}

.task-item[data-priority="medium"]::before {
  background: linear-gradient(to bottom, var(--warning), #d97706);
}

.task-item[data-priority="low"]::before {
  background: linear-gradient(to bottom, var(--success), #16a34a);
}

/* Task Header Styles */
.task-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding-left: 0.5rem;
}

.task-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  margin: 0;
}

/* Task Meta Information */
.task-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  background: var(--surface-light);
  border-radius: 8px;
  margin-top: 0.5rem;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.meta-item i {
  color: var(--primary);
}

/* Task Actions */
.task-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  justify-content: flex-end;
  padding-top: 0.5rem;
}

#addTaskBtn {
  min-width: 120px;
  max-width: 200px;
}

@media (max-width: 768px) {
  .task-actions {
    padding-top: 1rem;
  }

  #addTaskBtn {
    width: 100%;
    max-width: none;
  }
}

.action-btn {
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 100px;
  justify-content: center;
}

.edit-btn {
  background: var(--warning);
}

.complete-btn {
  background: var(--success);
}

.delete-btn {
  background: var(--danger);
}

.edit-btn:hover {
  background: #d97706;
}

.complete-btn:hover {
  background: #16a34a;
}

.delete-btn:hover {
  background: #dc2626;
}

/* Completed Task Styling */
.task-item.completed {
  background: var(--surface-light);
  opacity: 0.8;
}

.task-item.completed .task-title {
  text-decoration: line-through;
  color: var(--text-light);
}

/* Drag and Drop Visual Feedback */
.task-item.dragging {
  opacity: 0.5;
  cursor: move;
  box-shadow: var(--shadow-md);
  border: 2px dashed var(--primary);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .task-meta {
    flex-direction: column;
    gap: 0.5rem;
  }

  .task-actions {
    flex-direction: column;
  }

  .action-btn {
    width: 100%;
    justify-content: center;
  }
}

.action-btn {
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.action-btn i {
  font-size: 0.9rem;
}

.edit-btn {
  background: var(--warning);
}

.edit-btn:hover {
  background: #d97706;
}

.complete-btn {
  background: var(--success);
}

.complete-btn:hover {
  background: #16a34a;
}

.delete-btn {
  background: var(--danger);
}

.delete-btn:hover {
  background: #dc2626;
}

/* Completed Task Style - Enhanced */
.task-item.completed {
  opacity: 0.85;
  background: var(--surface);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .input-row {
    grid-template-columns: 1fr;
  }

  .controls-bar {
    flex-direction: column;
  }

  .search-sort {
    flex-direction: column;
    margin-left: 0;
    width: 100%;
  }

  .search-box,
  .search-box input {
    width: 100%;
  }

  .sort-controls {
    width: 100%;
  }

  .task-actions {
    flex-wrap: wrap;
  }

  .action-btn {
    flex: 1;
    text-align: center;
  }
}

/* Animations */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.task-item {
  animation: slideIn 0.3s ease;
}

/* Accessibility / Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* Print Styles */
@media print {

  .app-header,
  .controls-bar,
  .task-actions {
    display: none;
  }

  .task-item {
    break-inside: avoid;
    box-shadow: none;
  }
}

/* Flatpickr Custom Styles */
.flatpickr-calendar {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow-md) !important;
  border-radius: 12px !important;
  padding: 1rem !important;
  width: 346px !important;
  /* Increased from 330px */
}

.flatpickr-calendar.arrowTop:before {
  border-bottom-color: var(--border);
}

.flatpickr-calendar.arrowTop:after {
  border-bottom-color: var(--surface);
}

.flatpickr-current-month {
  color: var(--text);
}

.flatpickr-day {
  border-radius: 6px !important;
  margin: 2px !important;
  height: 40px !important;
  /* Increased from 38px */
  line-height: 40px !important;
  /* Increased from 38px */
}

.flatpickr-day.selected {
  background: var(--primary);
  border-color: var(--primary);
}

.flatpickr-day.today {
  border-color: var(--primary);
  color: var (--primary);
}

.flatpickr-time input {
  color: var(--text);
  background: var(--surface-light);
}

/* Mobile Optimization */
@media (max-width: 768px) {
  .flatpickr-calendar {
    width: 316px !important;
    /* Increased from 300px */
    font-size: 0.875rem !important;
  }
}

/* Dark mode support */
body.dark-mode .flatpickr-calendar {
  background: var(--surface);
  border-color: var(--border);
}

body.dark-mode .flatpickr-day {
  color: var(--text);
}

body.dark-mode .flatpickr-day.selected {
  background: var(--primary);
  color: white;
}

/* Task Edit Form Styles */
.task-edit-form {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  background: var(--surface-light);
  border-radius: 8px;
}

.task-edit-form input,
.task-edit-form select,
.task-edit-form textarea {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}

.edit-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

/* Enhanced Flatpickr Styles */
.flatpickr-calendar {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow-md) !important;
  border-radius: 12px !important;
  font-family: 'Inter', sans-serif !important;
}

.flatpickr-day {
  border-radius: 6px !important;
  color: var(--text) !important;
}

.flatpickr-day.selected {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: white !important;
}

.flatpickr-time input {
  background: var(--surface-light) !important;
  color: var(--text) !important;
}

.flatpickr-confirm {
  background: var(--primary) !important;
  color: white !important;
  padding: 0.5rem 1rem !important;
  border-radius: 6px !important;
}

/* Dark Mode Support */
body.dark-mode .flatpickr-calendar,
body.dark-mode .flatpickr-months .flatpickr-month,
body.dark-mode .flatpickr-current-month .flatpickr-monthDropdown-months,
body.dark-mode .flatpickr-weekdays,
body.dark-mode span.flatpickr-weekday {
  background: var(--surface) !important;
  color: var(--text) !important;
}

body.dark-mode .flatpickr-day {
  color: var(--text) !important;
}

body.dark-mode .flatpickr-day:hover {
  background: var(--surface-light) !important;
}

body.dark-mode .flatpickr-day.selected {
  background: var(--primary) !important;
  color: white !important;
}

/* Dark Mode Styles */
body.dark-mode {
  --primary: #60a5fa;
  --primary-light: #93c5fd;
  --success: #4ade80;
  --warning: #fbbf24;
  --danger: #f87171;
  --surface: #1e1e1e;
  --surface-light: #2d2d2d;
  --background: #121212;
  --text: #e5e7eb;
  --text-light: #9ca3af;
  --border: #404040;

  color-scheme: dark;
}

body.dark-mode .app-header {
  --glass-bg: rgba(18, 18, 18, 0.9);
  --glass-border: rgba(255, 255, 255, 0.1);
}

body.dark-mode .header-btn {
  background: var(--surface-light);
  color: var(--text-light);
}

body.dark-mode .header-btn.active {
  background: var(--primary);
  color: white;
}

body.dark-mode .notification-badge {
  background: var(--danger);
  color: white;
}

/* Progress Section */
.progress-section {
  margin-top: 2rem;
  text-align: center;
  padding: 1rem;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.progress-bar {
  height: 8px;
  background: var(--surface-light);
  border-radius: 8px;
  margin: 0.75rem 0;
  overflow: hidden;
}

.progress-indicator {
  width: 0;
  height: 100%;
  background: var(--primary);
  border-radius: 8px;
  transition: all 0.3s ease;
}

.progress-text {
  font-size: 0.875rem;
  color: var(--text-light);
  margin-top: 0.5rem;
}

/* Task List Enhancements */
.task-item {
  /* ...existing task-item styles... */
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.task-item:hover {
  transform: translateY(-2px) scale(1.005);
  box-shadow: var(--shadow-md);
}

/* Countdown Styles */
.countdown {
  font-family: 'Roboto Mono', monospace;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.875rem;
  background: var(--surface-light);
}

.countdown.urgent {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
  animation: pulse 2s infinite;
}

.countdown.overdue {
  color: white;
  background: var(--danger);
  animation: none;
}

/* Dark Mode Button */
#darkModeToggle {
  padding: 0.5rem;
  border: none;
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

#darkModeToggle:hover {
  background: var(--surface-light);
  transform: translateY(-1px);
}

/* Alert and Dialog Styles */
.swal2-popup {
  border-radius: 12px !important;
  padding: 2rem !important;
}

body.dark-mode .swal2-popup {
  background: var(--surface) !important;
  color: var(--text) !important;
}

body.dark-mode .swal2-title,
body.dark-mode .swal2-content {
  color: var(--text) !important;
}

@keyframes pulse {
  0% {
    opacity: 1;
  }

  50% {
    opacity: 0.6;
  }

  100% {
    opacity: 1;
  }
}

@keyframes highlight {
  0% {
    background: var(--primary);
    transform: scale(1.02);
  }

  70% {
    background: var(--surface-light);
    transform: scale(1);
  }

  85% {
    background: var(--primary-light);
    transform: scale(1.01);
  }

  100% {
    background: var(--surface-light);
    transform: scale(1);
  }
}

/* Input Group Styles */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.input-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}

/* Enhanced datetime input styling */
.datetime-input {
  position: relative;
  padding-right: 2.5rem;
  /* Restore padding for icon */
}

/* Style the calendar picker icon consistently across devices */
.datetime-input::-webkit-calendar-picker-indicator {
  opacity: 0.6;
  cursor: pointer;
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.25rem;
  height: 1.25rem;
  color: var(--text-light);
}

.datetime-input::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

/* Ensure icon is visible in dark mode */
body.dark-mode .datetime-input::-webkit-calendar-picker-indicator {
  filter: invert(0.8);
}

/* Mobile Enhancements */
@media (max-width: 768px) {
  .datetime-input {
    padding-right: 2.75rem;
    /* Slightly more padding on mobile for easier tapping */
  }

  .datetime-input::-webkit-calendar-picker-indicator {
    width: 1.5rem;
    /* Larger touch target on mobile */
    height: 1.5rem;
    right: 0.625rem;
  }
}

/* Mobile Enhancements */
@media (max-width: 768px) {
  .input-label {
    display: block;
    margin-bottom: 0.25rem;
  }

  .datetime-input {
    min-height: 3rem;
    /* Larger touch target */
    font-size: 1rem;
    /* More readable on mobile */
  }
}

/* Input Groups Enhancement */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}

.input-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}

/* Mobile Enhancements */
@media (max-width: 768px) {
  .input-label {
    font-size: 1rem;
    margin-bottom: 0.25rem;
  }

  .task-details {
    gap: 1.5rem;
  }

  .input-group textarea {
    min-height: 120px;
  }
}

/* Toast Notifications */
.toast-popup {
  padding: 0.75rem !important;
  font-size: 0.875rem !important;
  box-shadow: var(--shadow-md) !important;
  border: 1px solid var(--border) !important;
}

body.dark-mode .toast-popup {
  background: var(--surface) !important;
  color: var(--text) !important;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal.show {
  display: flex;
  opacity: 1;
}

.modal-content {
  background: var(--surface);
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  margin: auto;
  position: relative;
  transform: translateY(-20px);
  transition: transform 0.3s ease;
}

.modal.show .modal-content {
  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 {
  margin: 0;
  color: var(--text);
  font-size: 1.25rem;
}

.close-modal {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-light);
  cursor: pointer;
  padding: 0.5rem;
}

.modal-body {
  padding: 1.5rem;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
}

.modal-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}

/* Floating Action Button */
.fab {
  position: fixed;
  right: 2rem;
  bottom: 2rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  z-index: 100;
}

.fab:hover {
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
  .fab {
    right: 1rem;
    bottom: 1rem;
  }
}

/* Dark mode support */
body.dark-mode .modal-content {
  background: var(--surface);
}

/* Enhanced Task List Container */
.task-list-container {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: transform 0.3s ease;
}

/* Refined Controls Bar */
.controls-bar {
  background: var(--surface-light);
  padding: 1.25rem;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.5rem;
  align-items: center;
}

/* Enhanced Filter Buttons */
.filter-buttons {
  display: flex;
  gap: 0.5rem;
  padding: 0.25rem;
  background: var(--surface);
  border-radius: 8px;
}

.filter-btn {
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: 6px;
  font-weight: 500;
  color: var(--text-light);
  background: transparent;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  color: var(--primary);
  background: var(--surface-light);
}

.filter-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.badge {
  background: var(--surface-light);
  color: var(--text-light);
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Refined Search and Sort Section */
.search-sort {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.search-box {
  flex: 1;
  max-width: 400px;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  transition: all 0.2s ease;
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-box i {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  pointer-events: none;
}

/* Enhanced Sort Controls */
.sort-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface);
  padding: 0.25rem;
  border-radius: 8px;
}

.sort-controls select {
  padding: 0.625rem 1rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
}

.sort-controls select:hover {
  background: var(--surface-light);
}

#sortDirection {
  padding: 0.625rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
}

#sortDirection:hover {
  background: var(--surface-light);
  color: var(--primary);
}

/* Task List Wrapper Refinements */
.task-list-wrapper {
  padding: 1.5rem;
  min-height: 400px;
}

.task-list {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

/* Enhanced Progress Section */
.progress-section {
  margin: 0;
  padding: 1.5rem;
  background: var(--surface-light);
  border-top: 1px solid var(--border);
}

.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin: 0.75rem 0;
}

.progress-indicator {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 3px;
  transition: width 0.5s ease;
}

.progress-text {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-light);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .controls-bar {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .filter-buttons {
    width: 100%;
    justify-content: space-between;
  }

  .search-sort {
    flex-direction: column;
    width: 100%;
  }

  .search-box {
    max-width: none;
  }

  .sort-controls {
    width: 100%;
    justify-content: space-between;
  }
}

/* Clear Completed Button Enhancement */
#clearCompletedBtn {
  white-space: nowrap;
  padding: 0.625rem 1.25rem;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.2s ease;
}

#clearCompletedBtn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(239, 68, 68, 0.2);
}

/* Empty State Refinements */
.empty-state {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--text-light);
  background: var(--surface-light);
  border-radius: 12px;
  margin: 1rem 0;
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--primary);
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

/* Notification Styles */
.notification-popup {
  max-width: 400px !important;
}

.notification-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem 0;
}

.notification-item {
  display: flex;
  gap: 1rem;
  padding: 0.75rem;
  background: var(--surface-light);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.notification-item:hover {
  transform: translateX(4px);
  background: var(--surface);
}

.notification-item i {
  font-size: 1.25rem;
  padding-top: 0.25rem;
}

.notification-content {
  flex: 1;
}

.notification-content p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text);
}

.notification-content small {
  color: var(--text-light);
  font-size: 0.75rem;
}

/* User Menu Styles */
.user-menu-popup {
  max-width: 300px !important;
}

.user-menu-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 1rem;
  border: none;
  background: var(--surface-light);
  color: var(--text);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.user-menu-item:hover {
  background: var(--surface);
  transform: translateX(4px);
  color: var(--primary);
}

.user-menu-item i {
  font-size: 1rem;
  width: 1.5rem;
  text-align: center;
}

/* Additional Header Enhancements */
.header-nav {
  background: var(--surface-light);
  padding: 0.25rem;
  border-radius: 12px;
  display: flex;
  gap: 0.5rem;
}

.nav-btn {
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.nav-btn.active {
  background: var(--primary);
  color: white;
}

.nav-btn:not(.active):hover {
  background: var(--surface);
  color: var(--primary);
}

/* Text Colors */
.text-warning {
  color: var(--warning);
}

.text-success {
  color: var(--success);
}

.text-danger {
  color: var(--danger);
}

/* Calendar Styles */
.calendar-view {
  background: var(--surface);
  border-radius: 16px;
  padding: 2rem;
  margin-top: 1rem;
  box-shadow: var(--shadow-md);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.calendar-header {
  background: var(--surface-light);
  padding: 1rem;
  text-align: center;
  font-weight: 500;
  color: var(--text);
}

.calendar-day {
  background: var(--surface);
  min-height: 100px;
  padding: 0.5rem;
  position: relative;
}

.calendar-day.empty {
  background: var (--surface-light);
}

.day-number {
  font-size: 0.875rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.day-tasks {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.task-indicator {
  height: 4px;
  border-radius: 2px;
  background: var(--primary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.task-indicator:hover {
  height: 6px;
  transform: translateY(-1px);
}

.task-indicator.completed {
  background: var(--success);
  opacity: 0.5;
}

.task-indicator.high {
  background: var(--danger);
}

.task-indicator.medium {
  background: var(--warning);
}

.task-indicator.low {
  background: var(--success);
}

@media (max-width: 768px) {
  .calendar-view {
    padding: 1rem;
  }

  .calendar-day {
    min-height: 80px;
  }
}

/* Enhanced Calendar Styles */
.calendar-view {
  margin-top: 2rem;
  padding: 1.5rem;
}

.calendar-header-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.calendar-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.calendar-nav button {
  padding: 0.5rem;
  border: none;
  background: var(--surface-light);
  color: var(--text);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.calendar-nav button:hover {
  background: var(--primary);
  color: white;
}

.calendar-title {
  font-size: 1.25rem;
  font-weight: 600;
  min-width: 200px;
  text-align: center;
}

.calendar-grid {
  display: grid;
  grid-template-columns: auto repeat(7, 1fr);
  gap: 1px;
}

.week-number {
  background: var(--surface-light);
  color: var(--text-light);
  padding: 0.5rem;
  text-align: center;
  font-size: 0.75rem;
}

.calendar-day {
  min-height: 120px;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
}

.calendar-day.today {
  background: var(--surface-light);
  border: 2px solid var(--primary);
}

.calendar-day.different-month {
  opacity: 0.5;
}

.day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.day-tasks {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.calendar-task {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.calendar-task:hover {
  transform: translateX(2px);
}

.calendar-task.high {
  background: rgba(239, 68, 68, 0.1);
  border-left-color: var(--danger);
}

.calendar-task.medium {
  background: rgba(245, 158, 11, 0.1);
  border-left-color: var(--warning);
}

.calendar-task.low {
  background: rgba(34, 197, 94, 0.1);
  border-left-color: var(--success);
}

.calendar-task.completed {
  text-decoration: line-through;
  opacity: 0.6;
}

.task-count {
  font-size: 0.75rem;
  padding: 0.125rem 0.375rem;
  background: var(--primary);
  color: white;
  border-radius: 1rem;
}

.calendar-task.dragging {
  opacity: 0.5;
  background: var(--surface-light);
}

.calendar-day.drag-over {
  background: var(--surface-light);
  border: 2px dashed var(--primary);
}

/* Calendar Responsive */
@media (max-width: 768px) {
  .calendar-grid {
    grid-template-columns: repeat(7, 1fr);
  }

  .week-number {
    display: none;
  }

  .calendar-day {
    min-height: 100px;
  }
}

/* Enhanced Calendar Responsive Styles */
@media (max-width: 768px) {
  .calendar-view {
    margin: 1rem 0;
    padding: 0.5rem;
  }

  .calendar-header-controls {
    margin-bottom: 1rem;
  }

  .calendar-title {
    font-size: 1rem;
    min-width: 150px;
  }

  .calendar-grid {
    grid-template-columns: repeat(7, 1fr);
    font-size: 0.875rem;
  }

  .calendar-header {
    padding: 0.5rem 0.25rem;
    font-size: 0.75rem;
  }

  .calendar-day {
    min-height: 80px;
    padding: 0.25rem;
  }

  .day-header {
    margin-bottom: 0.25rem;
  }

  .day-number {
    font-size: 0.75rem;
  }

  .task-count {
    padding: 0.125rem 0.25rem;
    font-size: 0.625rem;
  }

  .calendar-task {
    padding: 0.125rem 0.25rem;
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Hide week numbers on mobile */
  .week-number {
    display: none;
  }

  /* Make touch targets larger */
  .calendar-nav button {
    padding: 0.75rem;
    min-width: 44px;
    min-height: 44px;
  }

  /* Optimize empty day cells */
  .calendar-day.empty {
    display: none;
  }
}

/* Optimize for very small screens */
@media (max-width: 375px) {
  .calendar-day {
    min-height: 60px;
  }

  .day-tasks {
    max-height: 40px;
    overflow-y: auto;
  }

  .calendar-task {
    margin-bottom: 0.125rem;
  }
}

/* Smart Task Display System */
.task-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 1.5rem;
  padding: 1rem;
}

.task-group {
  background: var(--surface);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.group-header {
  padding: 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.group-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.group-title i {
  font-size: 1.125rem;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--surface-light);
}

.group-count {
  padding: 0.25rem 0.75rem;
  background: var(--surface-light);
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-light);
}

.group-tasks {
  padding: 0 1.25rem 1.25rem;
  display: grid;
  gap: 1rem;
}

/* Make task items match the group container */
.task-item {
  border-radius: 12px;
  margin: 0;
  background: var(--surface-light);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .group-header {
    padding: 1rem;
  }

  .group-tasks {
    padding: 0 1rem 1rem;
  }
}

.task-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.task-main {
  display: flex;
  gap: 0.875rem;
}

.priority-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  margin-top: 0.5rem;
  background: var(--primary);
}

.priority-high .priority-dot {
  background: var(--danger);
}

.priority-medium .priority-dot {
  background: var(--warning);
}

.priority-low .priority-dot {
  background: var(--success);
}

.task-content {
  flex: 1;
  min-width: 0;
}

.task-title {
  font-size: 0.938rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.25rem;
  line-height: 1.4;
}

.task-description {
  font-size: 0.813rem;
  color: var(--text-light);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.5rem;
  background: var(--surface-light);
  border-radius: 8px;
  font-size: 0.75rem;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--text-light);
}

.meta-item i {
  font-size: 0.875rem;
  color: var(--primary);
}

.task-actions {
  display: flex;
  gap: 0.5rem;
}

.action-btn {
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-btn:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-1px);
}

.action-btn.edit:hover {
  background: var(--warning);
}

.action-btn.complete:hover {
  background: var(--success);
}

.action-btn.delete:hover {
  background: var(--danger);
}

/* Status Badges */
.status-badge {
  padding: 0.25rem 0.625rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.status-badge i {
  font-size: 0.813rem;
}

.status-upcoming {
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
}

.status-due-soon {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.status-overdue {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

/* Completed Task State */
.task-item.completed {
  background: var(--surface-light);
}

.task-item.completed .task-title {
  color: var(--text-light);
  text-decoration: line-through;
}

/* Mobile Optimization */
@media (max-width: 768px) {
  .task-list {
    grid-template-columns: 1fr;
  }

  .task-actions {
    opacity: 1;
    position: relative;
    justify-content: flex-end;
    padding-top: 0.5rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--border);
  }

  .action-btn {
    width: 2.5rem;
    height: 2.5rem;
  }
}

/* Empty State Enhancement */
.empty-group {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-light);
}

.empty-group i {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  opacity: 0.5;
}

/* Date Information Styles */
.date-info {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.relative-day {
  font-weight: 500;
  color: var(--text);
}

.actual-date {
  font-size: 0.75rem;
  color: var (--text-light);
}

@media (max-width: 768px) {
  .date-info {
    flex-direction: row;
    gap: 0.5rem;
    align-items: center;
  }

  .actual-date::before {
    content: "•";
    margin-right: 0.5rem;
    color: var(--text-light);
  }
}

/* Enhanced Task Group Styles */
.task-group {
  background: var(--surface);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease;
}

.task-group:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.group-header {
  padding: 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var (--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.group-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.group-title i {
  font-size: 1.125rem;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--surface-light);
}

.group-count {
  padding: 0.25rem 0.75rem;
  background: var(--surface-light);
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-light);
}

.group-tasks {
  padding: 0 1.25rem 1.25rem;
  display: grid;
  gap: 1rem;
}

/* Make task items match the group container */
.task-item {
  border-radius: 12px;
  margin: 0;
  background: var(--surface-light);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .group-header {
    padding: 1rem;
  }

  .group-tasks {
    padding: 0 1rem 1rem;
  }
}

/* Enhanced Task Item Styles */
.task-item {
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

.task-item.task-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Priority Indicators */
.task-priority {
  position: absolute;
  top: 0;
  right: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: white;
}

.task-priority[data-priority="high"] {
  background: var(--danger);
}

.task-priority[data-priority="medium"] {
  background: var(--warning);
}

.task-priority[data-priority="low"] {
  background: var(--success);
}

/* Responsive Optimizations */
@media (max-width: 768px) {
  .task-group {
    margin-bottom: 1rem;
  }

  .group-header {
    padding: 0.75rem 1rem;
  }

  .group-tasks {
    padding: 0.5rem;
    gap: 0.5rem;
  }
}

/* View Container Styles */
.view-container {
  animation: fadeIn 0.3s ease;
}

/* Calendar Container Styles */
.calendar-container {
  background: var(--surface);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
}

.calendar-header-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding: 0 0.5rem;
}

.calendar-nav {
  display: flex;
  gap: 0.75rem;
}

.calendar-nav button {
  padding: 0.625rem 1rem;
  border: none;
  border-radius: 8px;
  background: var(--surface-light);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
}

.calendar-nav button:hover {
  background: var(--primary);
  color: white;
}

.calendar-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Task Actions Layout Fix */
.task-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 1rem;
  margin-top: auto;
  border-top: 1px solid var(--border);
}

.action-btn {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
  .task-actions {
    padding-top: 0.75rem;
  }

  .action-btn {
    width: 2.25rem;
    height: 2.25rem;
  }
}

/* Enhanced Task Card Styles */
.task-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: 100%;
}

.task-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.task-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.priority-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--surface-light);
}

.priority-badge.high {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.priority-badge.medium {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.priority-badge.low {
  background: rgba(34, 197, 94, 0.1);
  color: var(--success);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.status-badge.completed {
  background: rgba(34, 197, 94, 0.1);
  color: var(--success);
}

.status-badge.urgent {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
  animation: pulse 2s infinite;
}

.status-badge.overdue {
  background: rgba(239, 68, 68, 0.1);
  color: var (--danger);
}

.task-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.task-timeline {
  padding: 0.75rem;
  background: var(--surface-light);
  border-radius: 8px;
}

.time-progress {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.progress-track {
  height: 4px;
  background: var (--border);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.progress-fill.overdue {
  background: var(--danger);
}

.timeline-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.813rem;
  color: var(--text-light);
}

.due-date,
.time-remaining {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.time-remaining {
  font-family: 'Roboto Mono', monospace;
  font-weight: 500;
}

.time-remaining.urgent {
  color: var(--warning);
  animation: pulse 2s infinite;
}

.time-remaining.overdue {
  color: var (--danger);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .task-header {
    flex-direction: column;
    gap: 0.75rem;
  }

  .timeline-details {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

/* Enhanced Task Description */
.task-description {
  max-height: 120px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) var(--surface-light);
  position: relative;
  padding: 0.75rem;
  padding-right: 12px;
  /* Increased padding for scrollbar */
  background: var(--surface-light);
  border-radius: 8px;
  font-size: 0.925rem;
  line-height: 1.6;
  color: var(--text-light);
}

/* Webkit Scrollbar Styling */
.task-description::-webkit-scrollbar {
  width: 4px;
}

.task-description::-webkit-scrollbar-track {
  background: var(--surface-light);
  border-radius: 2px;
}

.task-description::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 2px;
}

/* Improved fade effect */
.task-description::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 4px;
  /* Account for scrollbar width */
  height: 24px;
  background: linear-gradient(transparent, var(--surface-light));
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
}

/* Only show fade when content is overflowing and not actively scrolling */
.task-description.overflow:not(:hover):not(:focus)::after {
  opacity: 1;
}

/* Remove fade effect when scrolled to bottom */
.task-description.at-bottom::after {
  opacity: 0;
}

/* Enhanced Timer Styles */
.time-remaining {
  font-family: 'Roboto Mono', monospace;
  font-weight: 500;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: var(--surface);
}

/* Less than 3 hours - Red */
.time-remaining.critical {
  color: white;
  background: var (--danger);
  font-weight: 600;
}

/* Less than 24 hours - Yellow */
.time-remaining.warning {
  color: var(--warning);
  background: rgba(245, 158, 11, 0.1);
  font-weight: 500;
}

/* Overdue - Red with different style */
.time-remaining.overdue {
  color: white;
  background: var (--danger);
  font-style: italic;
}

/* Enhanced Timer Styles */
.time-remaining {
  font-family: 'Roboto Mono', monospace;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.time-remaining.critical {
  color: white;
  background: var (--danger);
  font-weight: 600;
}

.time-remaining.urgent {
  color: var(--warning);
  animation: pulse 2s infinite;
}

.time-remaining.overdue {
  color: white;
  background: var (--danger);
  font-style: italic;
}

/* Enhanced Calendar Header */
.calendar-header-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

.calendar-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.month-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.today-btn {
  padding: 0.5rem 1rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.today-btn:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
}

.calendar-title {
  font-size: 1.25rem;
  font-weight: 600;
  min-width: 200px;
  text-align: center;
  margin: 0;
}

#prevMonth,
#nextMonth {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  background: var(--surface-light);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

#prevMonth:hover,
#nextMonth:hover {
  background: var(--primary);
  color: white;
}

.calendar-view-options select {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-light);
  color: var(--text);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.calendar-view-options select:hover {
  border-color: var(--primary);
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
  .calendar-header-controls {
    padding: 0.75rem;
    flex-direction: column;
    align-items: stretch;
  }

  .calendar-nav {
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
  }

  .month-nav {
    width: 100%;
    justify-content: space-between;
  }

  .calendar-title {
    font-size: 1rem;
    padding: 0 0.5rem;
  }

  .today-btn {
    width: 100%;
  }

  .calendar-view-options {
    width: 100%;
  }

  .calendar-view-options select {
    width: 100%;
    text-align: center;
  }
}

/* Ultra Small Screens */
@media (max-width: 360px) {
  .calendar-header-controls {
    padding: 0.5rem;
    gap: 0.5rem;
  }

  .calendar-nav {
    gap: 0.5rem;
  }

  .calendar-title {
    font-size: 0.875rem;
  }

  #prevMonth,
  #nextMonth {
    width: 40px;
    height: 40px;
  }
}

/* Calendar Table Styles */
.calendar-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 1px;
  background: var(--border);
}

.calendar-table th {
  background: var(--surface-light);
  color: var(--text);
  font-weight: 500;
  padding: 1rem;
  text-align: center;
  font-size: 0.875rem;
}

.calendar-table td {
  background: var(--surface);
  padding: 0;
  vertical-align: top;
  height: 120px;
  width: 14.28%;
}

.calendar-table td.empty {
  background: var(--surface-light);
}

.calendar-day {
  height: 100%;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
}

.day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .calendar-table th {
    padding: 0.5rem;
    font-size: 0.75rem;
  }

  .calendar-table td {
    height: 80px;
  }
}

/* Calendar Container */
.calendar-container {
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

/* Calendar Header */
.calendar-header-controls {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.calendar-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.month-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.calendar-title {
  font-size: 1.25rem;
  font-weight: 600;
  min-width: 200px;
  text-align: center;
  margin: 0;
}

/* Calendar Navigation Buttons */
.nav-button {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: var(--surface-light);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.nav-button:hover {
  background: var(--primary);
  color: white;
}

.today-btn {
  padding: 0.5rem 1rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.today-btn:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
}

/* Calendar Table */
.calendar-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

/* Calendar Headers */
.calendar-table th {
  padding: 1rem 0.5rem;
  font-weight: 600;
  color: var(--text);
  font-size: 0.875rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
  background: var(--surface-light);
}

/* Calendar Cells */
.calendar-table td {
  padding: 0;
  border: 1px solid var(--border);
  vertical-align: top;
  height: 100px;
  position: relative;
}

.calendar-day {
  height: 100%;
  min-height: 100px;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
}

/* Day Number */
.day-number {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.5rem;
  display: inline-block;
  width: 24px;
  height: 24px;
  line-height: 24px;
  text-align: center;
  border-radius: 50%;
}

.day-number.today {
  background: var(--primary);
  color: white;
}

.day-number.different-month {
  color: var(--text-light);
  opacity: 0.5;
}

/* Tasks Container */
.day-tasks {
  flex: 1;
  overflow-y: auto;
  font-size: 0.75rem;
}

.calendar-task {
  padding: 0.25rem 0.5rem;
  margin-bottom: 0.25rem;
  border-radius: 4px;
  background: var(--surface-light);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.2s ease;
  position: relative;
}

.calendar-task:hover {
  background: var(--surface);
  transform: translateX(2px);
}

.calendar-task.completed {
  text-decoration: line-through;
  opacity: 0.7;
}

/* Priority Colors */
.calendar-task.high {
  border-left: 3px solid var(--danger);
}

.calendar-task.medium {
  border-left: 3px solid var(--warning);
}

.calendar-task.low {
  border-left: 3px solid var(--success);
}

.task-indicator {
  width: 3px;
  height: 100%;
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 2px;
}

.task-indicator.high {
  background: var(--danger);
}

.task-indicator.medium {
  background: var(--warning);
}

.task-indicator.low {
  background: var(--success);
}

.calendar-task .task-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.no-tasks {
  color: var(--text-light);
  font-size: 0.75rem;
  text-align: center;
  padding: 0.25rem;
  font-style: italic;
}

/* Calendar Cell Hover Effect */
.calendar-day {
  transition: all 0.2s ease;
}

.calendar-day:hover {
  background: var(--surface-light);
}

/* Responsive Design */
@media (max-width: 768px) {
  .calendar-header-controls {
    padding: 1rem;
    flex-direction: column;
  }

  .calendar-nav {
    width: 100%;
    justify-content: space-between;
  }

  .calendar-table td {
    height: 80px;
  }

  .calendar-day {
    min-height: 80px;
    padding: 0.25rem;
  }

  .day-number {
    font-size: 0.75rem;
    width: 20px;
    height: 20px;
    line-height: 20px;
  }
}

/* Calendar Task Styles */
.calendar-day {
  height: 100%;
  min-height: 100px;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.day-tasks {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding-right: 4px;
}

.day-tasks::-webkit-scrollbar {
  width: 4px;
}

.day-tasks::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 2px;
}

.calendar-task {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  background: var(--surface-light);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.calendar-task:hover,
.calendar-task.hover {
  background: var(--primary);
  color: white;
  transform: translateX(2px);
}

.task-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.task-dot.high {
  background: var(--danger);
}

.task-dot.medium {
  background: var(--warning);
}

.task-dot.low {
  background: var(--success);
}

.calendar-task .task-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-task.completed {
  opacity: 0.7;
}

.calendar-task.completed .task-title {
  text-decoration: line-through;
}

.calendar-task i {
  font-size: 0.75rem;
  color: var(--success);
}

.no-tasks {
  color: var(--text-light);
  font-size: 0.75rem;
  text-align: center;
  padding: 0.25rem;
  font-style: italic;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .calendar-day {
    min-height: 80px;
  }

  .calendar-task {
    padding: 0.125rem 0.375rem;
  }

  .task-dot {
    width: 4px;
    height: 4px;
  }
}

/* Enhanced Calendar Container */
.calendar-container {
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

/* Enhanced Calendar Header */
.calendar-header-controls {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.calendar-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.month-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.calendar-title {
  font-size: 1.25rem;
  font-weight: 600;
  min-width: 200px;
  text-align: center;
  margin: 0;
}

/* Calendar Navigation Buttons */
.nav-button {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: var(--surface-light);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.nav-button:hover {
  background: var(--primary);
  color: white;
}

.today-btn {
  padding: 0.5rem 1rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.today-btn:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
}

/* Calendar Table */
.calendar-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

/* Calendar Headers */
.calendar-table th {
  padding: 1rem 0.5rem;
  font-weight: 600;
  color: var(--text);
  font-size: 0.875rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
  background: var(--surface-light);
}

/* Calendar Cells */
.calendar-table td {
  padding: 0;
  border: 1px solid var(--border);
  vertical-align: top;
  height: 100px;
  position: relative;
}

.calendar-day {
  height: 100%;
  min-height: 100px;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
}

/* Day Number */
.day-number {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.5rem;
  display: inline-block;
  width: 24px;
  height: 24px;
  line-height: 24px;
  text-align: center;
  border-radius: 50%;
}

.day-number.today {
  background: var(--primary);
  color: white;
}

.day-number.different-month {
  color: var(--text-light);
  opacity: 0.5;
}

/* Tasks Container */
.day-tasks {
  flex: 1;
  overflow-y: auto;
  font-size: 0.75rem;
}

.calendar-task {
  padding: 0.25rem 0.5rem;
  margin-bottom: 0.25rem;
  border-radius: 4px;
  background: var(--surface-light);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.2s ease;
  position: relative;
}

.calendar-task:hover {
  background: var(--surface);
  transform: translateX(2px);
}

.calendar-task.completed {
  text-decoration: line-through;
  opacity: 0.7;
}

/* Priority Colors */
.calendar-task.high {
  border-left: 3px solid var(--danger);
}

.calendar-task.medium {
  border-left: 3px solid var(--warning);
}

.calendar-task.low {
  border-left: 3px solid var(--success);
}

.task-indicator {
  width: 3px;
  height: 100%;
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 2px;
}

.task-indicator.high {
  background: var(--danger);
}

.task-indicator.medium {
  background: var(--warning);
}

.task-indicator.low {
  background: var(--success);
}

.calendar-task .task-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.no-tasks {
  color: var(--text-light);
  font-size: 0.75rem;
  text-align: center;
  padding: 0.25rem;
  font-style: italic;
}

/* Calendar Cell Hover Effect */
.calendar-day {
  transition: all 0.2s ease;
}

.calendar-day:hover {
  background: var(--surface-light);
}

/* Responsive Design */
@media (max-width: 768px) {
  .calendar-header-controls {
    padding: 1rem;
    flex-direction: column;
  }

  .calendar-nav {
    width: 100%;
    justify-content: space-between;
  }

  .calendar-table td {
    height: 80px;
  }

  .calendar-day {
    min-height: 80px;
    padding: 0.25rem;
  }

  .day-number {
    font-size: 0.75rem;
    width: 20px;
    height: 20px;
    line-height: 20px;
  }
}

/* Enhanced Date Picker Styles */
.quick-date-select {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.quick-date-btn {
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-light);
  color: var(--text);
  font-size: 0.813rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quick-date-btn:hover {
  background: var(--surface);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.quick-date-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* Flatpickr Customization */
.flatpickr-calendar {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow-md) !important;
  border-radius: 12px !important;
  padding: 1rem !important;
  width: 346px !important;
  /* Increased from 330px */
}

.flatpickr-months {
  padding-bottom: 0.5rem !important;
}

.flatpickr-day {
  border-radius: 6px !important;
  margin: 2px !important;
  height: 40px !important;
  /* Increased from 38px */
  line-height: 40px !important;
  /* Increased from 38px */
}

.flatpickr-time {
  border-top: 1px solid var(--border) !important;
  margin-top: 0.5rem !important;
}

/* Mobile Optimization */
@media (max-width: 768px) {
  .flatpickr-calendar {
    width: 316px !important;
    /* Increased from 300px */
    font-size: 0.875rem !important;
  }

  .quick-date-select {
    margin-bottom: 1rem;
  }

  .quick-date-btn {
    flex: 1;
    text-align: center;
    min-width: calc(50% - 0.5rem);
  }
}

/* Dark Mode Support */
body.dark-mode .flatpickr-calendar {
  background: var(--surface) !important;
  border-color: var (--border) !important;
}

body.dark-mode .flatpickr-day {
  color: var(--text) !important;
}

body.dark-mode .flatpickr-day:hover {
  background: var(--surface-light) !important;
}

body.dark-mode .flatpickr-day.selected {
  background: var(--primary) !important;
  color: white !important;
}

/* Mobile-First Calendar Container */
.calendar-container {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0;
  /* Remove padding on container */
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
}

/* Fixed Header Controls */
.calendar-header-controls {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem;
}

/* Enhanced Calendar Table */
.calendar-table {
  min-width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}

.calendar-table th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface-light);
  padding: 0.75rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  white-space: nowrap;
}

.calendar-table td {
  width: 14.28%;
  height: auto;
  min-height: 80px;
  border: 1px solid var(--border);
  vertical-align: top;
}

/* Mobile Calendar Day Cell */
.calendar-day {
  min-height: 80px;
  height: 100%;
  padding: 0.375rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* Improved Day Number Display */
.day-number {
  min-width: 28px;
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 50%;
  margin-bottom: 0.25rem;
}

.day-number.today {
  background: var(--primary);
  color: white;
}

/* Scrollable Tasks Container */
.day-tasks {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 0.25rem;
  margin-top: 0.25rem;
}

/* Enhanced Calendar Tasks */
.calendar-task {
  padding: 0.5rem;
  margin-bottom: 0.25rem;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface-light);
  border-radius: 6px;
  font-size: 0.813rem;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Mobile Navigation Controls */
@media (max-width: 768px) {
  .calendar-nav {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    width: 100%;
  }

  .month-nav {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.5rem;
  }

  #prevMonth,
  #nextMonth {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: var(--surface-light);
    border: none;
    border-radius: 8px;
    color: var(--text);
    cursor: pointer;
  }

  .calendar-title {
    font-size: 1rem;
    text-align: center;
    padding: 0.5rem;
    margin: 0;
    white-space: nowrap;
  }

  .today-btn {
    width: 100%;
    height: 44px;
    margin-bottom: 0.5rem;
  }
}

/* Small Screen Optimizations */
@media (max-width: 480px) {
  .calendar-table {
    min-width: 480px;
    /* Ensure minimum width for scrolling */
  }

  .calendar-day {
    min-height: 60px;
  }

  .day-tasks {
    max-height: 80px;
  }

  .calendar-task {
    padding: 0.375rem 0.5rem;
    min-height: 36px;
    font-size: 0.75rem;
  }
}

/* Touch Scrolling Enhancements */
.calendar-container::-webkit-scrollbar {
  height: 6px;
}

.calendar-container::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 3px;
}

.day-tasks::-webkit-scrollbar {
  width: 4px;
}

.day-tasks::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 2px;
}

/* iOS Safari Fixes */
@supports (-webkit-touch-callout: none) {

  .calendar-container,
  .day-tasks {
    -webkit-overflow-scrolling: touch;
  }
}

/* Prevent text selection */
.calendar-container {
  user-select: none;
  -webkit-user-select: none;
}

/* Enhanced DateTime Picker Styles */
.datetime-wrapper {
  position: relative;
  width: 100%;
}

.quick-datetime-selectors {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.quick-datetime-btn {
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-light);
  color: var(--text);
  font-size: 0.813rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.quick-datetime-btn i {
  font-size: 0.875rem;
  color: var(--primary);
}

.quick-datetime-btn:hover {
  background: var(--surface);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.quick-datetime-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.quick-datetime-btn.active i {
  color: white;
}

/* Time Slot Grid */
.time-slot-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: var(--surface);
  border-radius: 8px;
}

.time-slot-btn {
  padding: 0.5rem;
  border: 1px solid var (--border);
  border-radius: 6px;
  background: var(--surface-light);
  color: var(--text);
  font-size: 0.813rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.time-slot-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Mobile Optimizations */
@media (max-width: 768px) {
  .quick-datetime-selectors {
    grid-template-columns: repeat(2, 1fr);
  }

  .time-slot-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .quick-datetime-btn,
  .time-slot-btn {
    padding: 0.75rem;
    min-height: 44px;
  }
}

/* Enhanced Flatpickr Integration */
.flatpickr-calendar.hasTime.quick-select {
  width: 100% !important;
  max-width: 300px;
}

.quick-select .flatpickr-time {
  height: auto;
  max-height: 200px;
  overflow-y: auto;
}

/* ...existing code... */

.privacy-note {
  font-size: 0.75rem;
  font-weight: normal;
  color: var(--text-light);
  margin-left: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.privacy-note i {
  font-size: 0.813rem;
  color: var(--success);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .privacy-note {
    display: block;
    margin: 0.25rem 0 0 0;
  }
}

/* ...existing code... */

.privacy-info-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--success);
  display: inline-flex;
  align-items: center;
  transition: transform 0.2s ease;
}

.privacy-info-btn:hover {
  transform: scale(1.1);
}

.privacy-info-btn i {
  font-size: 0.813rem;
}

/* SweetAlert custom styles for privacy info */
.privacy-info-popup {
  text-align: left !important;
  padding: 1.5rem !important;
}

.privacy-info-popup .privacy-details {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--surface-light);
  border-radius: 8px;
  font-size: 0.875rem;
}

.privacy-info-popup .privacy-point {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.privacy-info-popup .privacy-point i {
  color: var(--success);
  margin-top: 0.25rem;
}

/* ...existing code... */