/* ==========================================================================
   Zeon OS - TASKBAR & DOCK STYLING
   ========================================================================== */

#taskbar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100vw;
  height: var(--taskbar-height);
  background: var(--taskbar-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-top: var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  z-index: var(--z-taskbar);
  transition: all var(--transition-normal);
}

/* Floating Dock Mode */
#taskbar.dock-mode {
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: auto;
  min-width: 480px;
  max-width: 90vw;
  border-radius: var(--style-corner-radius);
  border: var(--glass-border);
  box-shadow: var(--shadow-lg);
}

/* Start Button */
.taskbar-start-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  color: var(--accent);
  background: rgba(255, 255, 255, 0.05);
  border: var(--glass-border-subtle);
  transition: all var(--transition-bounce);
}

.taskbar-start-btn:hover {
  background: var(--accent-light);
  transform: scale(1.08);
}

.taskbar-start-btn.active {
  background: var(--accent);
  color: #ffffff;
}

/* App Icons Container */
.taskbar-apps {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 100%;
  padding: 0 8px;
}

/* Taskbar App Button */
.taskbar-app-item {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.taskbar-app-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.taskbar-app-item.active {
  background-color: rgba(255, 255, 255, 0.14);
}

/* Icon wrapper — sized independently so style rules never stretch the dot */
.taskbar-app-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Running Indicator — one small minimal dot, sitting beneath the icon */
.taskbar-app-indicator {
  position: absolute;
  bottom: 1px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: var(--radius-full);
  background-color: var(--text-muted);
  transition: background-color var(--transition-fast);
}

.taskbar-app-item.running .taskbar-app-indicator,
.taskbar-app-item.active .taskbar-app-indicator {
  background-color: var(--accent);
}

/* System Tray */
.taskbar-tray {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 100%;
}

.tray-item {
  height: 34px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 12px;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.tray-item:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.tray-clock {
  font-weight: 500;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.15;
  padding: 0 10px;
}

.tray-clock-time {
  font-size: 12px;
  color: var(--text-primary);
}

.tray-clock-date {
  font-size: 10px;
  color: var(--text-muted);
}

/* Battery readout — only surfaced by the Windows 11 style taskbar */
.tray-battery {
  display: none;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
}

.tray-battery svg {
  width: 18px;
  height: 18px;
}

.tray-battery.charging svg {
  color: var(--success);
}

/* Quick Settings Flyout Tray Trigger */
.tray-status-group {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
}

/* Calendar Flyout Modal */
.calendar-flyout {
  position: absolute;
  bottom: calc(var(--taskbar-height) + 10px);
  right: 12px;
  width: 320px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-flyout);
  padding: 16px;
  display: none;
  flex-direction: column;
  gap: 12px;
  animation: slideUpFlyout 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.calendar-flyout.visible {
  display: flex;
}

@keyframes slideUpFlyout {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

.calendar-header-title {
  font-size: 14px;
  font-weight: 600;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
}

.calendar-day-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px 0;
}

.calendar-day-cell {
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.calendar-day-cell:hover {
  background: rgba(255, 255, 255, 0.1);
}

.calendar-day-cell.today {
  background: var(--accent);
  color: #ffffff;
  font-weight: 600;
}

.calendar-day-cell.other-month {
  color: var(--text-muted);
  opacity: 0.4;
}

/* ==========================================================================
   STYLE NO. 1 — COMPACT CENTERED TASKBAR
   ========================================================================== */
[data-ui-style="1"] #taskbar {
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  width: auto;
  min-width: 0;
  max-width: 90vw;
  height: auto;
  bottom: 14px;
  padding: 6px 10px;
  gap: 4px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.32);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 6px 20px rgba(20, 22, 26, 0.12);
}

[data-ui-style="1"] .taskbar-start-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: #14161a;
}

[data-ui-style="1"] .taskbar-start-btn svg {
  width: 18px;
  height: 18px;
}

[data-ui-style="1"] .taskbar-start-btn:hover {
  background: rgba(20, 22, 26, 0.08);
  transform: none;
}

[data-ui-style="1"] .taskbar-start-btn.active {
  background: rgba(20, 22, 26, 0.14);
  color: #14161a;
}

[data-ui-style="1"] .taskbar-apps {
  padding: 0 2px;
  gap: 2px;
}

[data-ui-style="1"] .taskbar-app-item {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: #14161a;
}

[data-ui-style="1"] .taskbar-app-icon {
  width: 18px;
  height: 18px;
}

[data-ui-style="1"] .taskbar-app-item svg {
  width: 18px;
  height: 18px;
}

[data-ui-style="1"] .taskbar-app-item:hover {
  background-color: rgba(20, 22, 26, 0.08);
  transform: none;
}

[data-ui-style="1"] .taskbar-app-item.active {
  background-color: rgba(20, 22, 26, 0.12);
}

[data-ui-style="1"] .taskbar-app-indicator,
[data-ui-style="1"] .taskbar-app-item.running .taskbar-app-indicator,
[data-ui-style="1"] .taskbar-app-item.active .taskbar-app-indicator {
  bottom: 0;
  width: 4px;
  height: 4px;
  background-color: #14161a;
  box-shadow: none;
}

[data-ui-style="1"] .tray-item {
  color: #14161a;
}

[data-ui-style="1"] .tray-clock-time {
  color: #14161a;
}

/* Keep only the launcher + pinned apps + quick settings: hide noisy tray status */
[data-ui-style="1"] #tray-network,
[data-ui-style="1"] #tray-volume,
[data-ui-style="1"] #tray-notifications,
[data-ui-style="1"] .tray-clock {
  display: none;
}

/* ==========================================================================
   STYLE NO. 2 — MINIMAL CENTERED TASKBAR
   ========================================================================== */
[data-ui-style="2"] #taskbar {
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  width: auto;
  min-width: 0;
  max-width: 90vw;
  height: auto;
  bottom: 12px;
  padding: 5px 8px;
  gap: 3px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(18, 21, 33, 0.55);
  backdrop-filter: blur(14px) saturate(130%);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.38);
}

[data-ui-style="2"] .taskbar-start-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: #F5F6FA;
}

[data-ui-style="2"] .taskbar-start-btn svg {
  width: 17px;
  height: 17px;
}

[data-ui-style="2"] .taskbar-start-btn:hover {
  background: var(--hover-surface);
  transform: none;
}

[data-ui-style="2"] .taskbar-start-btn.active {
  background: rgba(100, 125, 184, 0.22);
  color: #F5F6FA;
}

[data-ui-style="2"] .taskbar-apps {
  padding: 0 2px;
  gap: 2px;
}

[data-ui-style="2"] .taskbar-app-item {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: #E7EAF3;
}

[data-ui-style="2"] .taskbar-app-icon {
  width: 18px;
  height: 18px;
}

[data-ui-style="2"] .taskbar-app-item svg {
  width: 18px;
  height: 18px;
}

[data-ui-style="2"] .taskbar-app-item:hover {
  background-color: var(--hover-surface);
  transform: none;
}

[data-ui-style="2"] .taskbar-app-item.active {
  background-color: rgba(100, 125, 184, 0.18);
}

[data-ui-style="2"] .taskbar-app-indicator,
[data-ui-style="2"] .taskbar-app-item.running .taskbar-app-indicator,
[data-ui-style="2"] .taskbar-app-item.active .taskbar-app-indicator {
  bottom: 0;
  width: 4px;
  height: 4px;
  background-color: #647DB8;
  box-shadow: none;
}

[data-ui-style="2"] .tray-item {
  color: #E7EAF3;
}

[data-ui-style="2"] #tray-network,
[data-ui-style="2"] #tray-volume,
[data-ui-style="2"] #tray-notifications,
[data-ui-style="2"] .tray-clock {
  display: none;
}

/* ==========================================================================
   STYLE NO. 3 — ULTRA-MINIMAL PILL DOCK
   Centered capsule dock, monochrome white icons, no system tray
   ========================================================================== */
[data-ui-style="3"] #taskbar {
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  width: auto;
  min-width: 0;
  max-width: 92vw;
  height: auto;
  bottom: 24px;
  padding: 10px 22px;
  gap: 16px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(18, 18, 20, 0.55);
  backdrop-filter: blur(16px) saturate(130%);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* System tray — hosts the clock and battery readout when the Windows 11
   style taskbar is engaged; empty otherwise. */
[data-ui-style="3"] .taskbar-tray {
  display: flex;
  align-items: center;
  height: auto;
}

[data-ui-style="3"] .tray-clock {
  display: none;
}

/* Start / system menu icon */
[data-ui-style="3"] .taskbar-start-btn {
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #FFFFFF;
  opacity: 0.85;
  transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}

[data-ui-style="3"] .taskbar-start-btn svg {
  width: 22px;
  height: 22px;
}

[data-ui-style="3"] .taskbar-start-btn:hover {
  background: transparent;
  opacity: 1;
  transform: translateY(-3px) scale(1.1);
}

[data-ui-style="3"] .taskbar-start-btn.active {
  background: transparent;
  color: #FFFFFF;
}

/* Dock icon row */
[data-ui-style="3"] .taskbar-apps {
  padding: 0;
  gap: 16px;
}

[data-ui-style="3"] .taskbar-app-item {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: transparent;
  color: #FFFFFF;
  opacity: 0.85;
  transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}

[data-ui-style="3"] .taskbar-app-icon {
  width: 22px;
  height: 22px;
}

[data-ui-style="3"] .taskbar-app-item svg {
  width: 22px;
  height: 22px;
}

[data-ui-style="3"] .taskbar-app-item:hover {
  background-color: transparent;
  opacity: 1;
  transform: translateY(-3px) scale(1.1);
}

[data-ui-style="3"] .taskbar-app-item.active {
  background-color: transparent;
}

/* Running indicator: small white dot beneath the icon */
[data-ui-style="3"] .taskbar-app-indicator,
[data-ui-style="3"] .taskbar-app-item.running .taskbar-app-indicator,
[data-ui-style="3"] .taskbar-app-item.active .taskbar-app-indicator {
  bottom: -7px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background-color: #FFFFFF;
  box-shadow: none;
}

@media (max-width: 640px) {
  [data-ui-style="3"] #taskbar {
    padding: 8px 16px;
    gap: 12px;
  }

  [data-ui-style="3"] .taskbar-apps {
    gap: 12px;
  }
}

/* ==========================================================================
   WINDOWS 11 STYLE TASKBAR
   Engaged automatically while any window is maximized, so the bar spans the
   screen edge instead of floating behind the window. No start button, no
   search — running apps sit in the middle, clock/date/battery on the right.
   ========================================================================== */
#taskbar.win11-mode {
  left: 0;
  right: auto;
  transform: none;
  width: 100vw;
  min-width: 0;
  max-width: none;
  height: var(--taskbar-height);
  bottom: 0;
  padding: 0 14px;
  gap: 0;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  background: var(--taskbar-bg);
  backdrop-filter: blur(30px) saturate(160%);
  -webkit-backdrop-filter: blur(30px) saturate(160%);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.4);
}

/* No Windows logo and no search entry point */
#taskbar.win11-mode .taskbar-start-btn {
  display: none;
}

/* Running apps, centered */
#taskbar.win11-mode .taskbar-apps {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  height: auto;
  padding: 0;
  gap: 6px;
}

#taskbar.win11-mode .taskbar-app-item {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  opacity: 1;
  color: var(--text-primary);
}

#taskbar.win11-mode .taskbar-app-icon {
  width: 24px;
  height: 24px;
}

#taskbar.win11-mode .taskbar-app-item svg {
  width: 24px;
  height: 24px;
}

#taskbar.win11-mode .taskbar-app-item:hover {
  background-color: rgba(255, 255, 255, 0.12);
  transform: none;
}

#taskbar.win11-mode .taskbar-app-item.active {
  background-color: rgba(255, 255, 255, 0.16);
}

/* Running dot pinned below the icon, clear of it at every window state */
#taskbar.win11-mode .taskbar-app-indicator {
  bottom: 1px;
  width: 4px;
  height: 4px;
}

/* Clock, date and battery, grouped at the right edge */
#taskbar.win11-mode .taskbar-tray {
  margin-left: auto;
  gap: 6px;
  height: auto;
}

#taskbar.win11-mode .tray-clock {
  display: flex;
}

#taskbar.win11-mode .tray-item {
  color: var(--text-primary);
}

#taskbar.win11-mode .tray-clock-time {
  color: var(--text-primary);
}

#taskbar.win11-mode .tray-clock-date {
  color: var(--text-secondary);
}

#taskbar.win11-mode .tray-battery {
  display: flex;
}
