/* ==========================================================================
   Zeon OS - CONTEXT MENUS & NOTIFICATION CENTER
   ========================================================================== */

/* System Context Menu — thick frosted glass so the desktop never bleeds through */
.context-menu {
  position: fixed;
  z-index: var(--z-context-menu);
  width: 200px;
  background: var(--menu-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: contextFade 0.12s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes contextFade {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.context-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--radius-xs);
  font-size: 12.5px;
  color: var(--text-primary);
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.context-menu-item:hover {
  background-color: var(--accent);
  color: #ffffff;
}

.context-menu-item.danger:hover {
  background-color: var(--danger);
  color: #ffffff;
}

.context-menu-icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.context-menu-divider {
  height: 1px;
  background: var(--glass-border-subtle);
  margin: 4px 6px;
}

/* Toast Notifications Container */
#notification-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: var(--z-notification);
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 320px;
  max-width: calc(100vw - 32px);
  pointer-events: none;
}

.toast-notification {
  pointer-events: auto;
  background: var(--bg-surface-elevated);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 12px 14px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  animation: toastSlideIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.toast-notification.closing {
  opacity: 0;
  transform: translateX(40px);
}

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

.toast-icon {
  width: 22px;
  height: 22px;
  color: var(--accent);
  margin-top: 2px;
  flex-shrink: 0;
}

.toast-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.toast-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.toast-message {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.35;
}

.toast-close {
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
}

.toast-close:hover {
  color: var(--text-primary);
}

/* Quick Settings Flyout Panel — opens above the bottom-right trigger */
.quick-settings-flyout {
  position: absolute;
  bottom: 122px;
  right: 14px;
  width: 340px;
  border-radius: var(--radius-xl);
  background: var(--menu-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-flyout);
  padding: 16px;
  display: none;
  flex-direction: column;
  gap: 16px;
  animation: slideUpFlyout 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.quick-settings-flyout.visible {
  display: flex;
}

/* Style No. 3 keeps its tighter 12px corners */
[data-ui-style="3"] .quick-settings-flyout {
  border-radius: var(--radius-md);
}

/* Quick Settings trigger — pinned to the bottom-right of the desktop, clear of
   the taskbar in every UI style */
.quick-settings-fab {
  position: fixed;
  right: 14px;
  bottom: 70px;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--menu-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  box-shadow: var(--shadow-lg);
  color: var(--text-primary);
  z-index: var(--z-flyout);
  transition: transform var(--transition-fast);
}

.quick-settings-fab:hover {
  transform: translateY(-2px) scale(1.04);
}

.quick-settings-fab svg {
  width: 20px;
  height: 20px;
}

/* Fullscreen / maximized: the floating trigger and its flyout retreat so
   nothing hovers over the app owning the screen */
body.win11-mode .quick-settings-fab,
body.win11-mode .quick-settings-flyout {
  display: none;
}

.quick-tiles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.quick-tile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: var(--glass-border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.quick-tile:hover {
  background: rgba(255, 255, 255, 0.1);
}

.quick-tile.disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.quick-tile.disabled:hover {
  background: transparent;
  transform: none;
}

.quick-tile.active {
  background: var(--accent);
  color: #ffffff;
}

/* Style No. 3 — accent is pure white, so active tile text inverts to black */
[data-ui-style="3"] .quick-tile.active {
  color: var(--text-invert);
}

.quick-tile-icon {
  width: 20px;
  height: 20px;
}

.quick-tile-label {
  font-size: 12px;
  font-weight: 500;
}

.quick-slider-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quick-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quick-slider {
  flex: 1;
  height: 6px;
  accent-color: var(--accent);
  cursor: pointer;
}

[data-theme="dark"] .quick-slider,
[data-ui-style="2"] .quick-slider,
[data-ui-style="3"] .quick-slider,
:root:not([data-theme="light"]) .quick-slider {
  accent-color: #ffffff;
}

[data-theme="light"] .quick-slider {
  accent-color: #0f172a;
}

[data-theme="dark"] .quick-tile.active,
[data-ui-style="2"] .quick-tile.active,
[data-ui-style="3"] .quick-tile.active,
:root:not([data-theme="light"]) .quick-tile.active {
  background: #ffffff !important;
  color: #0f172a !important;
}

[data-theme="light"] .quick-tile.active {
  background: #0f172a !important;
  color: #ffffff !important;
}

/* Modal Overlay for alerts & confirmations */
.os-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modalFade 0.2s ease;
}

@keyframes modalFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.os-modal-box {
  width: 400px;
  max-width: 90vw;
  background: var(--bg-surface-solid);
  border: var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.os-modal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.os-modal-body {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.os-modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.os-modal-actions button {
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-contrast, #ffffff);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  border: 1px solid transparent;
}
.btn-primary:hover {
  background: var(--accent-hover);
}

.os-modal-actions .modal-choice-btn {
  background: #4b5563;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 500;
}
.os-modal-actions .modal-choice-btn:hover {
  background: #374151;
}
.os-modal-actions .modal-choice-cancel,
.os-modal-actions .modal-cancel-btn {
  background: #dc2626;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 500;
}
.os-modal-actions .modal-choice-cancel:hover,
.os-modal-actions .modal-cancel-btn:hover {
  background: #b91c1c;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-danger {
  background: var(--danger);
  color: #ffffff;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
}

/* -------------------------------------------------------------
   THEME BUTTON RULES:
   Dark mode: all buttons are WHITE (with dark text/icons)
   Light mode: all buttons are DARK (with white text/icons)
   ------------------------------------------------------------- */

/* Dark Mode Buttons -> WHITE */
[data-theme="dark"] .btn-primary,
[data-ui-style="2"] .btn-primary,
[data-ui-style="3"] .btn-primary,
:root:not([data-theme="light"]) .btn-primary,
[data-theme="dark"] .btn-secondary,
[data-ui-style="2"] .btn-secondary,
[data-ui-style="3"] .btn-secondary,
:root:not([data-theme="light"]) .btn-secondary,
[data-theme="dark"] .modal-choice-btn,
[data-ui-style="2"] .modal-choice-btn,
[data-ui-style="3"] .modal-choice-btn,
:root:not([data-theme="light"]) .modal-choice-btn,
[data-theme="dark"] .gallery-btn.primary,
[data-ui-style="2"] .gallery-btn.primary,
[data-ui-style="3"] .gallery-btn.primary,
:root:not([data-theme="light"]) .gallery-btn.primary,
[data-theme="dark"] .segment-btn.active,
[data-ui-style="2"] .segment-btn.active,
[data-ui-style="3"] .segment-btn.active,
:root:not([data-theme="light"]) .segment-btn.active,
[data-theme="dark"] .position-cell.active,
[data-ui-style="2"] .position-cell.active,
[data-ui-style="3"] .position-cell.active,
:root:not([data-theme="light"]) .position-cell.active {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #ffffff !important;
}

[data-theme="dark"] .btn-primary:hover,
[data-ui-style="2"] .btn-primary:hover,
[data-ui-style="3"] .btn-primary:hover,
:root:not([data-theme="light"]) .btn-primary:hover,
[data-theme="dark"] .btn-secondary:hover,
[data-ui-style="2"] .btn-secondary:hover,
[data-ui-style="3"] .btn-secondary:hover,
:root:not([data-theme="light"]) .btn-secondary:hover,
[data-theme="dark"] .modal-choice-btn:hover,
[data-ui-style="2"] .modal-choice-btn:hover,
[data-ui-style="3"] .modal-choice-btn:hover,
:root:not([data-theme="light"]) .modal-choice-btn:hover {
  background: #f1f5f9 !important;
  color: #000000 !important;
}

/* Light Mode Buttons -> DARK */
[data-theme="light"] .btn-primary,
[data-theme="light"] .btn-secondary,
[data-theme="light"] .modal-choice-btn,
[data-theme="light"] .gallery-btn.primary,
[data-theme="light"] .segment-btn.active,
[data-theme="light"] .position-cell.active {
  background: #0f172a !important;
  color: #ffffff !important;
  border: 1px solid #0f172a !important;
}

[data-theme="light"] .btn-primary:hover,
[data-theme="light"] .btn-secondary:hover,
[data-theme="light"] .modal-choice-btn:hover {
  background: #1e293b !important;
  color: #ffffff !important;
}
