/**
 * Today View Styles
 * Unified daily focus dashboard
 */

/* === Container === */
.today-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* === Loading State === */
.today-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  color: var(--content-text-secondary, #6b7280);
}

.today-loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border-color, #e5e7eb);
  border-top-color: var(--primary-color, #667eea);
  border-radius: 50%;
  animation: today-spin 0.8s linear infinite;
  margin-bottom: 1rem;
}

@keyframes today-spin {
  to { transform: rotate(360deg); }
}

/* === Error State === */
.today-error {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--content-text-secondary, #6b7280);
}

.today-error button {
  margin-top: 1rem;
}

/* === Empty State === */
.today-empty {
  text-align: center;
  padding: 4rem 2rem;
}

.today-empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.today-empty h3 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  color: var(--content-text, #1f2937);
}

.today-empty p {
  margin: 0;
  color: var(--content-text-secondary, #6b7280);
}

/* === Header === */
.today-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.today-date {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--content-text, #1f2937);
}

.today-refresh-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--hover-bg, #f3f4f6);
  border-radius: 8px;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--content-text-secondary, #6b7280);
  transition: all 0.15s ease;
}

.today-refresh-btn:hover {
  background: var(--border-color, #e5e7eb);
  color: var(--content-text, #1f2937);
}

.today-refresh-btn:active {
  transform: rotate(180deg);
}

/* === Sections Container === */
.today-sections {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* === Section === */
.today-section {
  background: var(--content-bg, white);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  box-shadow: var(--card-shadow, 0 1px 3px rgba(0,0,0,0.05));
  border: 1px solid var(--border-color, #e5e7eb);
}

.today-section-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color, #f3f4f6);
}

.today-section-icon {
  font-size: 1.125rem;
}

.today-section-header h3 {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--content-text, #1f2937);
  flex: 1;
}

.today-section-count {
  font-size: 0.75rem;
  color: var(--content-text-secondary, #9ca3af);
  background: var(--hover-bg, #f3f4f6);
  padding: 0.125rem 0.5rem;
  border-radius: 10px;
}

.today-section-link {
  display: block;
  text-align: center;
  padding: 0.625rem;
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  color: var(--primary-color, #667eea);
  text-decoration: none;
  border-top: 1px solid var(--border-color, #f3f4f6);
}

.today-section-link:hover {
  text-decoration: underline;
}

/* === List Items === */
.today-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.today-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--border-color, #f3f4f6);
}

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

.today-item-title {
  flex: 1;
  font-size: 0.875rem;
  color: var(--content-text, #1f2937);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.today-item-completing {
  opacity: 0.6;
  pointer-events: none;
}

.today-item-completing .today-task-check {
  border-color: var(--primary-color, #667eea);
  background: var(--primary-color, #667eea);
  color: white;
}

.today-item-removed {
  opacity: 0;
  transform: translateX(30px);
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin-top: 0;
  margin-bottom: 0;
  border: none;
  transition: all 0.3s ease;
}

.today-empty-message {
  justify-content: center;
  color: var(--content-text-secondary, #6b7280);
  font-style: italic;
}

.today-check-done {
  margin-right: 0.5rem;
}

/* === Task Items === */
.today-task-item {
  padding: 0.5rem 0;
}

.today-task-check {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-color, #d1d5db);
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--content-text-secondary, #9ca3af);
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.today-task-check:hover {
  border-color: var(--primary-color, #667eea);
  background: color-mix(in srgb, var(--primary-color, #667eea) 10%, transparent);
  color: var(--primary-color, #667eea);
}

.today-task-check .today-check-icon {
  font-size: 0.875rem;
  line-height: 1;
}

.today-task-check:hover .today-check-icon::before {
  content: '✓';
}

.today-item-badge {
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.today-item-badge.overdue {
  background: #fef2f2;
  color: #dc2626;
}

.today-item-badge.today {
  background: #fef3c7;
  color: #d97706;
}

.today-item-overdue .today-item-title {
  color: #dc2626;
}

.today-task-item.high-priority .today-item-title {
  font-weight: 500;
}

/* === Event Items === */
.today-event-item {
  flex-wrap: wrap;
}

.today-event-time {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--primary-color, #667eea);
  min-width: 70px;
}

.today-event-location {
  width: 100%;
  font-size: 0.75rem;
  color: var(--content-text-secondary, #9ca3af);
  margin-left: calc(70px + 0.75rem);
  margin-top: 0.125rem;
}

/* === Meal Items === */
.today-meals-list {
  display: grid;
  gap: 0.5rem;
}

.today-meal-item {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  padding: 0.5rem 0.75rem;
  background: var(--hover-bg, #f9fafb);
  border-radius: 8px;
  border-bottom: none;
}

.today-meal-type {
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: capitalize;
  color: var(--content-text-secondary, #6b7280);
}

.today-meal-item .today-item-title {
  font-weight: 500;
}

/* === Habit Items === */
.today-habits-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.today-habit-btn {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-color, #e5e7eb);
  background: var(--content-bg, white);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 0.8125rem;
  color: var(--content-text, #1f2937);
}

.today-habit-btn:hover {
  border-color: var(--habit-color, #667eea);
  background: color-mix(in srgb, var(--habit-color, #667eea) 8%, transparent);
}

.today-habit-btn:active {
  transform: scale(0.97);
}

.today-habit-icon {
  font-size: 1rem;
}

.today-habit-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.today-habit-completing {
  opacity: 0.6;
  pointer-events: none;
  transform: scale(0.95);
}

.today-habit-completed {
  opacity: 0;
  transform: scale(0.8);
  pointer-events: none;
  transition: all 0.3s ease;
}

.today-habits-done {
  padding: 0.75rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--content-text-secondary, #6b7280);
}

/* === Shopping Items === */
.today-shopping-item {
  flex-direction: column;
  align-items: stretch;
  gap: 0.375rem;
}

.today-shopping-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.today-shopping-store {
  font-size: 0.75rem;
  color: var(--content-text-secondary, #9ca3af);
}

.today-shopping-progress {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.today-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--border-color, #e5e7eb);
  border-radius: 3px;
  overflow: hidden;
}

.today-progress-fill {
  height: 100%;
  background: var(--primary-color, #667eea);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.today-shopping-count {
  font-size: 0.75rem;
  color: var(--content-text-secondary, #9ca3af);
  white-space: nowrap;
}

/* === Subscription Items === */
.today-subscription-item {
  justify-content: space-between;
}

.today-subscription-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.today-subscription-cost {
  font-weight: 600;
  color: var(--content-text, #1f2937);
}

.today-subscription-date {
  font-size: 0.75rem;
  color: var(--content-text-secondary, #9ca3af);
}

.today-item-highlight {
  background: #fef3c7;
  margin: 0 -0.5rem;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  border-radius: 6px;
}

[data-theme="dark"] .today-item-highlight {
  background: #78350f33;
}

/* === Responsive === */
@media (max-width: 600px) {
  .today-container {
    padding: 1rem;
  }
  
  .today-date {
    font-size: 1.25rem;
  }
  
  .today-section {
    padding: 0.875rem 1rem;
  }
  
  .today-habit-btn {
    flex: 1;
    min-width: calc(50% - 0.25rem);
    justify-content: center;
  }
  
  .today-event-location {
    margin-left: 0;
  }
  
  .today-event-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  
  .today-event-time {
    min-width: auto;
  }
}
