/* Main Desktop Environment */
.desktop-env {
  position: fixed;
  inset: 0;
  overflow: hidden;
  animation: desktop-fade-in 0.55s var(--ease-win) both;
}

@keyframes desktop-fade-in {
  from { opacity: 0; transform: scale(1.02); }
  to { opacity: 1; transform: scale(1); }
}

.wallpaper-layer {
  position: absolute;
  inset: 0;
  background: url('../assets/wallpapers/bloom-light.jpg') center/cover no-repeat;
  transition: background-image 0.45s ease;
}

/* Desktop Icons Grid */
.desktop-area {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: var(--taskbar-h);
  z-index: 1;
}

.desktop-icons {
  position: absolute;
  inset: 10px;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 6px 4px;
}

.desktop-icon {
  width: 82px;
  padding: 8px 4px 6px;
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: default;
  border: 1px solid transparent;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.desktop-icon:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.22);
}

.desktop-icon.selected {
  background: rgba(0, 120, 212, 0.34);
  border-color: rgba(96, 205, 255, 0.65);
}

.desktop-icon img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.32));
  pointer-events: none;
}

.desktop-icon span {
  font-size: 12px;
  color: #fff;
  text-align: center;
  line-height: 1.25;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85), 0 0 2px rgba(0, 0, 0, 0.9);
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.marquee-box {
  position: fixed;
  background: rgba(0, 120, 212, 0.22);
  border: 1px solid rgba(0, 120, 212, 0.85);
  pointer-events: none;
  z-index: 5;
}

/* Taskbar */
.taskbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--taskbar-h);
  background: var(--bg-acrylic);
  backdrop-filter: blur(36px) saturate(180%);
  -webkit-backdrop-filter: blur(36px) saturate(180%);
  border-top: 1px solid var(--border-subtle);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 6px 0 10px;
  z-index: 5000;
}

.tb-left {
  display: flex;
  align-items: center;
}

.tb-widget-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 10px;
  border: none;
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s ease;
}

.tb-widget-trigger:hover {
  background: var(--bg-hover);
}

.tb-weather-ico {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.tb-weather-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
}

.tb-temp {
  font-size: 12px;
  font-weight: 600;
}

.tb-cond {
  font-size: 11px;
  color: var(--text-secondary);
}

.tb-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.tb-apps {
  display: flex;
  align-items: center;
  gap: 3px;
}

.tb-icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 5px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease;
}

.tb-icon-btn:hover {
  background: var(--bg-hover);
}

.tb-icon-btn.active {
  background: var(--bg-active);
}

.tb-icon-btn img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  transition: transform 0.18s var(--ease-bounce);
}

.tb-icon-btn:active img {
  transform: scale(0.8);
}

.tb-icon-btn.running::after {
  content: '';
  position: absolute;
  bottom: 2px;
  width: 6px;
  height: 3px;
  border-radius: 2px;
  background: var(--text-muted);
  transition: width 0.2s var(--ease-win), background 0.2s ease;
}

.tb-icon-btn.focused::after {
  width: 16px;
  background: var(--accent);
}

/* Taskbar Search Pill */
.tb-search-pill {
  height: 32px;
  width: 168px;
  margin: 0 3px;
  padding: 0 12px;
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.tb-search-pill:hover {
  background: var(--bg-surface);
  border-color: var(--border-strong);
}

/* Taskbar Right / System Tray */
.tb-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  height: 100%;
}

.tb-tray-btn, .tb-tray-pill, .tb-clock-btn {
  height: 38px;
  border: none;
  border-radius: 5px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease;
  padding: 0 7px;
}

.tb-tray-btn:hover, .tb-tray-pill:hover, .tb-clock-btn:hover {
  background: var(--bg-hover);
}

.tb-tray-pill {
  gap: 8px;
  padding: 0 9px;
}

.tb-lang {
  font-size: 12px;
  font-weight: 500;
  min-width: 28px;
}

.tb-clock-btn {
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
  padding: 0 10px;
  font-size: 12px;
}

.tb-show-desktop {
  width: 6px;
  height: 100%;
  border: none;
  border-left: 1px solid var(--border-subtle);
  background: transparent;
  cursor: pointer;
  margin-left: 4px;
}

.tb-show-desktop:hover {
  background: var(--bg-hover);
}

/* Flyout Panels Shared */
.flyout-panel {
  position: fixed;
  background: var(--bg-acrylic-strong);
  backdrop-filter: blur(44px) saturate(190%);
  -webkit-backdrop-filter: blur(44px) saturate(190%);
  border: 1px solid var(--border-flyout);
  border-radius: 10px;
  box-shadow: var(--shadow-flyout);
  z-index: 4800;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.28s var(--ease-win), opacity 0.2s ease;
}

.flyout-panel.open {
  opacity: 1;
  pointer-events: auto;
}

/* Start Menu */
.start-menu {
  left: 50%;
  bottom: calc(var(--taskbar-h) + 12px);
  width: min(636px, 95vw);
  height: min(670px, calc(100vh - var(--taskbar-h) - 24px));
  transform: translateX(-50%) translateY(28px) scale(0.98);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.start-menu.open {
  transform: translateX(-50%) translateY(0) scale(1);
}

.start-search-wrap {
  margin: 24px 28px 16px;
  position: relative;
  display: flex;
  align-items: center;
}

.start-search-icon {
  position: absolute;
  left: 14px;
  color: var(--text-secondary);
  pointer-events: none;
}

#start-search-input {
  width: 100%;
  height: 36px;
  padding: 0 16px 0 40px;
  border-radius: 18px;
  border: 1px solid var(--border-strong);
  border-bottom: 2px solid var(--accent);
  background: var(--bg-surface);
  font-size: 13.5px;
  outline: none;
}

#start-main-view, #start-all-apps-view, #start-search-results {
  flex: 1;
  padding: 0 28px 16px;
  overflow-y: auto;
}

.start-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 13.5px;
  font-weight: 600;
}

.start-pill-btn {
  padding: 4px 10px;
  border-radius: 5px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  font-size: 12px;
  cursor: pointer;
}

.start-pill-btn:hover {
  background: var(--bg-hover);
}

.start-pinned-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}

.start-app-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 4px;
  border-radius: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: background 0.12s ease, transform 0.12s ease;
}

.start-app-tile:hover {
  background: var(--bg-hover);
}

.start-app-tile:active {
  transform: scale(0.94);
}

.start-app-tile img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.start-app-tile span {
  font-size: 11.5px;
  text-align: center;
  line-height: 1.2;
}

.start-recommended-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px 14px;
}

.start-rec-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.start-rec-item:hover {
  background: var(--bg-hover);
}

.start-rec-item img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.start-rec-info strong {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
}

.start-rec-info small {
  color: var(--text-muted);
  font-size: 11px;
}

.start-all-apps-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.start-list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
}

.start-list-row:hover {
  background: var(--bg-hover);
}

.start-list-row img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.start-footer {
  height: 60px;
  padding: 0 36px;
  background: rgba(0, 0, 0, 0.04);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.start-user-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-radius: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}

.start-user-btn:hover {
  background: var(--bg-hover);
}

.start-user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.start-power-wrap {
  position: relative;
}

.start-power-btn {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.start-power-btn:hover {
  background: var(--bg-hover);
}

.power-popup {
  position: absolute;
  right: 0;
  bottom: 44px;
  width: 148px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  box-shadow: var(--shadow-flyout);
  padding: 5px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 50;
}

.power-popup button {
  padding: 8px 10px;
  border: none;
  border-radius: 5px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-size: 13px;
}

.power-popup button:hover {
  background: var(--bg-hover);
}

/* Quick Settings Flyout */
.quick-settings {
  right: 12px;
  bottom: calc(var(--taskbar-h) + 12px);
  width: 356px;
  transform: translateY(20px);
  overflow: hidden;
}

.quick-settings.open {
  transform: translateY(0);
}

.qs-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px 10px;
  padding: 18px 18px 14px;
}

.qs-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 11.5px;
}

.qs-tile-btn {
  width: 100%;
  height: 46px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  transition: background 0.15s ease, color 0.15s ease;
}

.qs-tile.active .qs-tile-btn {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}

.qs-sliders {
  padding: 8px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.qs-slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.qs-slider-row input[type="range"] {
  flex: 1;
  accent-color: var(--accent);
  cursor: pointer;
}

.qs-footer {
  height: 46px;
  padding: 0 18px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.03);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
}

.qs-settings-btn {
  border: none;
  background: transparent;
  width: 32px;
  height: 32px;
  border-radius: 5px;
  cursor: pointer;
}

.qs-settings-btn:hover {
  background: var(--bg-hover);
}

/* Calendar & Notifications Flyout */
.calendar-panel {
  right: 12px;
  bottom: calc(var(--taskbar-h) + 12px);
  width: 344px;
  transform: translateX(36px);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.calendar-panel.open {
  transform: translateX(0);
}

.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  margin-bottom: 8px;
}

.notif-clear-btn {
  border: none;
  background: var(--bg-card);
  padding: 3px 9px;
  border-radius: 4px;
  font-size: 11.5px;
  cursor: pointer;
}

.notif-list {
  max-height: 150px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.notif-empty {
  text-align: center;
  padding: 20px 0;
  color: var(--text-muted);
  font-size: 12.5px;
}

.notif-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  padding: 9px 11px;
  font-size: 12px;
}

.notif-card strong {
  display: block;
  margin-bottom: 2px;
}

.cal-section {
  border-top: 1px solid var(--border-subtle);
  padding-top: 12px;
}

.cal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  margin-bottom: 10px;
}

.cal-nav button {
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  font-size: 10px;
}

.cal-nav button:hover {
  background: var(--bg-hover);
}

.cal-weekdays, .cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  gap: 3px;
}

.cal-weekdays span {
  font-size: 11.5px;
  color: var(--text-muted);
  padding: 4px 0;
}

.cal-day {
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 12.5px;
  cursor: default;
}

.cal-day:hover {
  background: var(--bg-hover);
}

.cal-day.other-month {
  color: var(--text-muted);
  opacity: 0.5;
}

.cal-day.today {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

/* Widgets Panel (Left) */
.widgets-panel {
  left: 12px;
  top: 12px;
  bottom: calc(var(--taskbar-h) + 12px);
  width: min(460px, 92vw);
  transform: translateX(-110%);
  padding: 20px;
  overflow-y: auto;
}

.widgets-panel.open {
  transform: translateX(0);
}

.widgets-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}

#widgets-time-greeting {
  font-size: 20px;
  font-weight: 600;
}

#widgets-date-sub {
  font-size: 12.5px;
  color: var(--text-secondary);
}

.widgets-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.widget-tile {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 14px;
}

.wt-loc, .wt-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.wt-main {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.wt-main img {
  width: 38px;
  height: 38px;
}

.wt-temp {
  font-size: 30px;
  font-weight: 600;
}

.wt-big {
  font-size: 36px;
  font-weight: 600;
  color: var(--accent);
  line-height: 1.1;
  margin-bottom: 4px;
}

.wt-desc {
  font-size: 11.5px;
  color: var(--text-muted);
}

.wt-quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wt-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  cursor: pointer;
  font-size: 12px;
}

.wt-chip:hover {
  background: var(--bg-hover);
}

.wt-chip img {
  width: 16px;
  height: 16px;
}

.wt-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wt-bar-row {
  display: grid;
  grid-template-columns: 36px 1fr 38px;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.wt-bar {
  height: 7px;
  background: var(--bg-hover);
  border-radius: 4px;
  overflow: hidden;
}

.wt-bar > div {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.5s ease;
}

/* Context Menu */
.context-menu {
  position: fixed;
  min-width: 210px;
  background: var(--bg-acrylic-strong);
  backdrop-filter: blur(36px) saturate(180%);
  border: 1px solid var(--border-flyout);
  border-radius: 8px;
  box-shadow: var(--shadow-flyout);
  padding: 5px;
  z-index: 8000;
  animation: ctx-in 0.14s var(--ease-win) both;
}

@keyframes ctx-in {
  from { opacity: 0; transform: scale(0.95) translateY(-4px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.ctx-item {
  width: 100%;
  padding: 7px 11px;
  border: none;
  border-radius: 5px;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
}

.ctx-item:hover {
  background: var(--bg-hover);
}

.ctx-sep {
  height: 1px;
  background: var(--border-subtle);
  margin: 4px 6px;
}

/* Task View Overlay */
.taskview-overlay {
  position: fixed;
  inset: 0 0 var(--taskbar-h) 0;
  background: rgba(15, 20, 30, 0.55);
  backdrop-filter: blur(22px);
  z-index: 4600;
  padding: 36px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: ctx-in 0.2s var(--ease-win) both;
}

.taskview-header {
  color: #fff;
  font-size: 16px;
  font-weight: 500;
}

.taskview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

.tv-card {
  background: var(--bg-surface);
  border-radius: 10px;
  border: 2px solid transparent;
  padding: 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.tv-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}

.tv-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.tv-card-head img {
  width: 20px;
  height: 20px;
}

.tv-card-body {
  height: 110px;
  border-radius: 6px;
  background: var(--bg-surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 12px;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  right: 16px;
  bottom: calc(var(--taskbar-h) + 16px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 7500;
  pointer-events: none;
}

.win-toast {
  width: 320px;
  background: var(--bg-acrylic-strong);
  backdrop-filter: blur(36px);
  border: 1px solid var(--border-flyout);
  border-radius: 8px;
  box-shadow: var(--shadow-flyout);
  padding: 12px 14px;
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  animation: toast-in 0.3s var(--ease-win) both;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

.win-toast img {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.win-toast-body strong {
  display: block;
  font-size: 13px;
  margin-bottom: 2px;
}

.win-toast-body p {
  font-size: 12px;
  color: var(--text-secondary);
}

@media (max-width: 720px) {
  .tb-weather-text, .tb-search-pill span { display: none; }
  .tb-search-pill { width: 38px; padding: 0; justify-content: center; }
  .start-pinned-grid { grid-template-columns: repeat(4, 1fr); }
}
