.time-filter-sidebar {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #ffffff;
  animation: slideInRight 0.15s ease;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.time-filter-sidebar.inactive {
  opacity: 0.6;
}

.time-filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid #e1e4e8;
  background: #f6f8fa;
  flex-shrink: 0;
}

.time-filter-title {
  font-size: 14px;
  font-weight: 600;
  color: #24292e;
  display: flex;
  align-items: center;
  gap: 8px;
}

.time-filter-icon {
  font-size: 16px;
}

.time-filter-toggle-btn {
  padding: 6px 10px;
  border: 1px solid #e1e4e8;
  background: #ffffff;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  min-height: 32px;
}

.time-filter-toggle-btn:hover {
  background: #f6f8fa;
  border-color: #0969da;
  transform: scale(1.05);
}

/* Active state: green background */
.time-filter-sidebar.active .time-filter-toggle-btn {
  background: #dcfce7;
  border-color: #22c55e;
}

.time-filter-sidebar.active .time-filter-toggle-btn:hover {
  background: #bbf7d0;
  border-color: #16a34a;
}

/* Tab navigation */
.time-filter-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #e1e4e8;
  background: #f6f8fa;
  padding: 0 12px;
}

.time-filter-tab {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: #57606a;
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}

.time-filter-tab:hover {
  background: #ffffff;
  color: #24292e;
}

.time-filter-tab.active {
  background: #ffffff;
  color: #0969da;
  border-bottom-color: #0969da;
}

/* Tab content */
.time-filter-tab-content {
  background: #ffffff;
  overflow-y: auto;
  max-height: calc(100vh - 400px);
}

.time-filter-close-btn {
  padding: 6px 10px;
  border: 1px solid #e1e4e8;
  background: #ffffff;
  border-radius: 6px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  min-height: 32px;
  color: #57606a;
}

.time-filter-close-btn:hover {
  background: #fff1f0;
  border-color: #dc3545;
  color: #dc3545;
  transform: scale(1.05);
}

.time-filter-summary {
  padding: 12px 16px;
  background: #f0f7ff;
  border-bottom: 1px solid #e1e4e8;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.summary-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.summary-label {
  color: #57606a;
  font-weight: 500;
}

.summary-value {
  color: #24292e;
  font-weight: 600;
}

.summary-value.filtered {
  color: #0969da;
}

.time-filter-section {
  border-bottom: 1px solid #e1e4e8;
  flex-shrink: 0;
}

.time-filter-section.collapsed .section-content {
  display: none;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.section-header:hover {
  background: #f6f8fa;
}

.section-toggle {
  font-size: 10px;
  color: #57606a;
  transition: transform 0.2s;
}

.section-title {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: #24292e;
}

.section-count {
  font-size: 11px;
  color: #57606a;
  padding: 2px 8px;
  background: #e1e4e8;
  border-radius: 10px;
  font-weight: 600;
}

.section-toggle-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  background: #f6f8fa;
  border: 1px solid #e1e4e8;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
}

.section-toggle-switch:hover {
  background: #ffffff;
  border-color: #0969da;
}

.section-toggle-switch input[type="checkbox"] {
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: #0969da;
  margin: 0;
}

.section-toggle-switch span {
  color: #57606a;
  font-weight: 500;
}

.section-content {
  background: #ffffff;
}

.filter-options {
  padding: 12px 16px;
}

.select-all-row {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f6f8fa;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: #24292e;
  font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #0969da;
  margin: 0;
}

.preset-buttons {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.preset-btn {
  padding: 8px 12px;
  border: 1px solid #e1e4e8;
  background: #ffffff;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  color: #24292e;
  text-align: left;
}

.preset-btn:hover {
  background: #f6f8fa;
  border-color: #0969da;
  color: #0969da;
  transform: translateX(2px);
}

/* Horizontal compact preset buttons */
.preset-buttons-horizontal {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.preset-btn-compact {
  padding: 6px 12px;
  border: 1px solid #e1e4e8;
  background: #ffffff;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  color: #24292e;
  white-space: nowrap;
}

.preset-btn-compact:hover {
  background: #f6f8fa;
  border-color: #0969da;
  color: #0969da;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Year buttons without checkboxes */
.year-buttons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(55px, 1fr));
  gap: 4px;
}

.year-button {
  padding: 6px 8px;
  border: 2px solid #e1e4e8;
  background: #ffffff;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  color: #57606a;
}

.year-button:hover {
  background: #f6f8fa;
  border-color: #d0d7de;
}

.year-button.active {
  background: #ddf4ff;
  border-color: #0969da;
  color: #0969da;
}

.year-button.active:hover {
  background: #b6e3ff;
  border-color: #0550ae;
}

/* Month buttons */
.month-buttons-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.month-button {
  padding: 6px 4px;
  border: 2px solid #e1e4e8;
  background: #ffffff;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  color: #57606a;
}

.month-button:hover {
  background: #f6f8fa;
  border-color: #d0d7de;
}

.month-button.active {
  background: #ddf4ff;
  border-color: #0969da;
  color: #0969da;
}

.month-button.active:hover {
  background: #b6e3ff;
  border-color: #0550ae;
}

/* Week buttons */
.week-buttons-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.week-button {
  padding: 5px 2px;
  border: 1px solid #e1e4e8;
  background: #ffffff;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  color: #57606a;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.week-button:hover {
  background: #f6f8fa;
  border-color: #d0d7de;
}

.week-button.active {
  background: #ddf4ff;
  border-color: #0969da;
  color: #0969da;
}

.week-button.active:hover {
  background: #b6e3ff;
  border-color: #0550ae;
}

/* Day buttons */
.day-buttons-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.day-button {
  padding: 5px 3px;
  border: 1px solid #e1e4e8;
  background: #ffffff;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  color: #57606a;
  min-width: 0;
}

.day-button:hover {
  background: #f6f8fa;
  border-color: #d0d7de;
}

.day-button.active {
  background: #ddf4ff;
  border-color: #0969da;
  color: #0969da;
}

.day-button.active:hover {
  background: #b6e3ff;
  border-color: #0550ae;
}

.day-button.weekend {
  background: #f6f8fa;
}

.day-button.weekend.active {
  background: #ddf4ff;
}

.year-grid,
.month-grid,
.week-grid,
.day-grid {
  display: grid;
  gap: 6px;
}

.year-grid {
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
}

.month-grid {
  grid-template-columns: repeat(3, 1fr);
}

.week-grid {
  grid-template-columns: repeat(4, 1fr);
}

.day-grid {
  grid-template-columns: repeat(7, 1fr);
}

.year-checkbox,
.month-checkbox,
.week-checkbox,
.day-checkbox {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid #e1e4e8;
  background: #ffffff;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 12px;
  font-weight: 500;
  color: #24292e;
}

.year-checkbox:hover,
.month-checkbox:hover,
.week-checkbox:hover,
.day-checkbox:hover {
  background: #f6f8fa;
  border-color: #d0d7de;
}

.year-checkbox input[type="checkbox"]:checked + span,
.month-checkbox input[type="checkbox"]:checked + span,
.week-checkbox input[type="checkbox"]:checked + span,
.day-checkbox input[type="checkbox"]:checked + span {
  color: #0969da;
}

.year-checkbox input[type="checkbox"]:checked,
.month-checkbox input[type="checkbox"]:checked,
.week-checkbox input[type="checkbox"]:checked,
.day-checkbox input[type="checkbox"]:checked {
  accent-color: #0969da;
}

.year-checkbox input[type="checkbox"],
.month-checkbox input[type="checkbox"],
.week-checkbox input[type="checkbox"],
.day-checkbox input[type="checkbox"] {
  width: 14px;
  height: 14px;
  cursor: pointer;
  margin: 0;
}

.year-checkbox {
  flex-direction: column;
  gap: 4px;
}

.month-checkbox,
.week-checkbox {
  flex-direction: column;
  gap: 4px;
}

.day-checkbox {
  flex-direction: column;
  gap: 4px;
  padding: 10px 4px;
}

.day-checkbox.weekend {
  background: #f6f8fa;
}

.day-checkbox.weekend:hover {
  background: #ffffff;
}

.hour-range {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hour-input-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hour-input-group label {
  font-size: 12px;
  font-weight: 500;
  color: #57606a;
  min-width: 40px;
}

.hour-input-group input[type="number"] {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #e1e4e8;
  border-radius: 6px;
  font-size: 13px;
  color: #24292e;
  background: #ffffff;
  transition: all 0.2s;
  max-width: 80px;
}

.hour-input-group input[type="number"]:hover:not(:disabled) {
  border-color: #d0d7de;
}

.hour-input-group input[type="number"]:focus {
  outline: none;
  border-color: #0969da;
  box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.1);
}

.hour-input-group input[type="number"]:disabled {
  background: #f6f8fa;
  color: #57606a;
  cursor: not-allowed;
}

.hour-input-group span {
  font-size: 12px;
  color: #57606a;
}

.time-filter-actions {
  display: flex;
  gap: 8px;
  padding: 16px;
  border-top: 1px solid #e1e4e8;
  background: #f6f8fa;
  flex-shrink: 0;
}

.time-filter-actions .btn {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid #e1e4e8;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.time-filter-actions .btn-secondary {
  background: #ffffff;
  color: #24292e;
}

.time-filter-actions .btn-secondary:hover {
  background: #f6f8fa;
  border-color: #d0d7de;
}

.time-filter-actions .btn-primary {
  background: #0969da;
  color: #ffffff;
  border-color: #0969da;
}

.time-filter-actions .btn-primary:hover {
  background: #0860ca;
  border-color: #0860ca;
}

.time-filter-sidebar::-webkit-scrollbar {
  width: 8px;
}

.time-filter-sidebar::-webkit-scrollbar-track {
  background: #f6f8fa;
}

.time-filter-sidebar::-webkit-scrollbar-thumb {
  background: #d0d7de;
  border-radius: 4px;
}

.time-filter-sidebar::-webkit-scrollbar-thumb:hover {
  background: #57606a;
}

@media (max-width: 768px) {
  .year-grid {
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  }
  
  .month-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .week-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .day-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .time-filter-header,
  .time-filter-summary,
  .filter-options,
  .time-filter-actions {
    padding: 12px;
  }
}
