/* Calendar View Styles — Outlook/Toggl Track inspired */

.calendar-container {
  background: var(--bg-card);
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255,255,255,0.02);
}

.calendar-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.calendar-nav-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.calendar-nav-btn:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.calendar-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  min-width: 200px;
  text-align: center;
}

.calendar-today-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.calendar-today-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* Calendar Grid */
.calendar-grid {
  display: grid;
  grid-template-columns: 60px repeat(7, 1fr);
  min-height: 600px;
}

/* Day Header */
.calendar-day-headers {
  display: grid;
  grid-template-columns: 60px repeat(7, 1fr);
  border-bottom: 2px solid var(--border-subtle);
}

.calendar-day-header {
  padding: 12px 8px;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.calendar-day-header.today {
  color: var(--accent);
}

.calendar-day-header .day-number {
  display: block;
  font-size: 1.3rem;
  font-weight: 800;
  margin-top: 2px;
  color: var(--text-primary);
}

.calendar-day-header.today .day-number {
  color: white;
  background: var(--accent);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 2px auto 0;
}

.calendar-time-gutter {
  border-right: 1px solid var(--border-subtle);
}

/* Time Labels */
.calendar-time-label {
  height: 60px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 0 8px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  transform: translateY(-8px);
}

/* Day Columns */
.calendar-day-column {
  position: relative;
  border-right: 1px solid var(--border-subtle);
  min-height: 100%;
}

.calendar-day-column:last-child {
  border-right: none;
}

.calendar-hour-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border-subtle);
}

.calendar-hour-line.half {
  background: rgba(255,255,255,0.02);
  border-top: 1px dashed var(--border-subtle);
  opacity: 0.5;
}

/* Time Entry Blocks */
.calendar-entry {
  position: absolute;
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 0.7rem;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.15s ease;
  z-index: 1;
  border-left: 3px solid;
  min-height: 20px;
  box-sizing: border-box;
}

.calendar-entry:hover {
  z-index: 10;
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.calendar-entry .entry-title {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.calendar-entry .entry-time {
  font-size: 0.65rem;
  opacity: 0.8;
  white-space: nowrap;
}

.calendar-entry .entry-duration {
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
}

/* Entry Color Themes */
.calendar-entry.theme-blue {
  background: rgba(99, 102, 241, 0.15);
  border-left-color: #6366f1;
  color: #a5b4fc;
}

.calendar-entry.theme-green {
  background: rgba(34, 197, 94, 0.15);
  border-left-color: #22c55e;
  color: #86efac;
}

.calendar-entry.theme-orange {
  background: rgba(245, 158, 11, 0.15);
  border-left-color: #f59e0b;
  color: #fcd34d;
}

.calendar-entry.theme-red {
  background: rgba(239, 68, 68, 0.15);
  border-left-color: #ef4444;
  color: #fca5a5;
}

.calendar-entry.theme-purple {
  background: rgba(168, 85, 247, 0.15);
  border-left-color: #a855f7;
  color: #d8b4fe;
}

.calendar-entry.theme-cyan {
  background: rgba(6, 182, 212, 0.15);
  border-left-color: #06b6d4;
  color: #67e8f9;
}

.calendar-entry.theme-field {
  background: rgba(245, 158, 11, 0.2);
  border-left-color: #f59e0b;
  color: #fcd34d;
}

.calendar-entry.theme-noproject {
  background: rgba(156, 163, 175, 0.15);
  border-left-color: #9ca3af;
  color: #d1d5db;
}

/* Now indicator */
.calendar-now-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--error);
  z-index: 5;
}

.calendar-now-line::before {
  content: '';
  position: absolute;
  left: -4px;
  top: -4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--error);
}

/* View Toggle */
.view-toggle {
  display: flex;
  background: var(--bg-secondary);
  border-radius: 10px;
  padding: 3px;
  border: 1px solid var(--border-subtle);
}

.view-toggle-btn {
  padding: 6px 14px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.view-toggle-btn.active {
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.view-toggle-btn:hover:not(.active) {
  color: var(--text-primary);
  background: rgba(255,255,255,0.05);
}

/* Tooltip */
.calendar-tooltip {
  position: fixed;
  z-index: 1000;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 12px 16px;
  max-width: 280px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  pointer-events: none;
  font-size: 0.8rem;
}

.calendar-tooltip .tooltip-title {
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.calendar-tooltip .tooltip-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 0;
  color: var(--text-secondary);
}

/* Scrollable body */
.calendar-body {
  max-height: 650px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--border-subtle) transparent;
}

.calendar-body::-webkit-scrollbar {
  width: 6px;
}

.calendar-body::-webkit-scrollbar-track {
  background: transparent;
}

.calendar-body::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 3px;
}

/* Empty day state */
.calendar-empty-day {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--text-muted);
  font-size: 0.7rem;
  opacity: 0.3;
}
