/* ============================================
   Folde OS — Desktop Shell Styles
   ============================================ */

/* ---- BOOT / SPLASH ---- */
#boot-screen,
#shutdown-screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  z-index: 9999;
}

#boot-screen {
  background: var(--black);
}

#shutdown-screen {
  background: var(--white);
}

.boot-logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Boot: SVG is black-on-white, invert gives white-on-black for dark boot screen */
#boot-screen .boot-logo-img {
  width: 160px;
  height: auto;
  filter: invert(1);
}

/* Shutdown: logo natural black-on-white */
#shutdown-screen .boot-logo-img {
  width: 140px;
  height: auto;
  opacity: 0.85;
}

.boot-sub {
  font-size: 13px;
  letter-spacing: 3px;
  text-transform: uppercase;
}

#boot-screen .boot-sub {
  color: var(--gray-5);
}

#shutdown-screen .boot-sub {
  color: var(--gray-5);
}

.boot-bar-track {
  width: 160px;
  height: 1.5px;
  background: var(--gray-3);
  border-radius: 1px;
  overflow: hidden;
}

.boot-bar-fill {
  height: 100%;
  background: var(--white);
  width: 0%;
}

/* ---- LOCK SCREEN ---- */
#lock-screen {
  position: fixed;
  inset: 0;
  background: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  z-index: 9998;
}

.lock-time {
  font-size: 72px;
  font-weight: 200;
  letter-spacing: -3px;
  line-height: 1;
}

.lock-date {
  font-size: 16px;
  color: var(--gray-4);
  letter-spacing: 1px;
}

.lock-solar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--gray-4);
  padding: 8px 16px;
  border: 1px solid var(--gray-7);
  border-radius: 20px;
}

.lock-pin {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
}

.pin-dots {
  display: flex;
  gap: 12px;
}

.pin-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--gray-4);
  background: transparent;
}

.pin-dot.filled {
  background: var(--black);
  border-color: var(--black);
}

.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 64px);
  grid-template-rows: repeat(4, 64px);
  gap: 8px;
}

.pin-key {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--gray-7);
  background: var(--white);
  font-size: 20px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Instant press response — no tap delay on touch screens */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  font-family: var(--font-sans);
}

/* Strong visible press state — user knows the key registered */
.pin-key:active {
  background: var(--gray-2);
  color: var(--white);
  border-color: var(--gray-2);
}

.pin-key.key-del {
  font-size: 15px;
  color: var(--gray-4);
}

.pin-key.key-del:active {
  color: var(--white);
}

.pin-key.key-ok {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

.pin-key.key-ok:active {
  background: var(--gray-3);
  border-color: var(--gray-3);
}

/* Tap-to-enter button (no-PIN mode) */
.tap-unlock-btn {
  padding: 14px 40px;
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font-sans);
  border: 2px solid var(--black);
  border-radius: var(--radius-md);
  background: var(--black);
  color: var(--white);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.tap-unlock-btn:active {
  background: var(--gray-3);
  border-color: var(--gray-3);
}

/* Forgot PIN link below keypad */
.lock-forgot-btn {
  background: none;
  border: none;
  font-size: 12px;
  color: var(--gray-5);
  cursor: pointer;
  padding: 4px 0;
  font-family: var(--font-sans);
  text-decoration: underline;
  touch-action: manipulation;
}

.lock-forgot-btn:active {
  color: var(--gray-2);
}

/* PIN reset modal overlay */
#pin-reset-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

#pin-reset-modal.hidden {
  display: none;
}

.pin-modal-box {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 28px 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 280px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.18);
}

.pin-modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 2px;
}

.pin-modal-sub {
  font-size: 12px;
  color: var(--gray-5);
  margin-bottom: 4px;
  text-align: center;
}

/* ---- STATUS BAR ---- */
#status-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--bar-height);
  background: var(--white);
  border-bottom: 1.5px solid var(--gray-7);
  display: flex;
  align-items: center;
  padding: 0 16px;
  z-index: 1000;
  gap: 12px;
}

.status-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.status-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.status-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.os-wordmark {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.status-icon-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--gray-3);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: none;
  background: none;
}

.status-icon-btn:hover {
  background: var(--gray-9);
}

/* Solar indicator */
.solar-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--gray-3);
}

.solar-bar {
  width: 32px;
  height: 8px;
  border: 1.5px solid var(--gray-4);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.solar-bar-fill {
  height: 100%;
  background: var(--black);
  border-radius: 1px;
}

.solar-bar-cap {
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 5px;
  background: var(--gray-4);
  border-radius: 1px;
}

/* ---- DESKTOP ---- */
#desktop {
  position: fixed;
  inset: 0;
  padding-top: var(--bar-height);
  padding-bottom: var(--dock-height);
  background: var(--white);
  overflow: hidden;
}

/* Home screen */
#home-screen {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 32px 24px 16px;
  gap: 32px;
}

.home-greeting {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.home-greeting h2 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.home-greeting p {
  font-size: 14px;
  color: var(--gray-4);
}

/* Widget row */
.widget-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.widget-row-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.widget {
  border: 1.5px solid var(--gray-7);
  border-radius: var(--radius-md);
  padding: 16px;
  background: var(--white);
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
}

.widget:hover {
  background: var(--gray-9);
}

.widget-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gray-5);
  font-weight: 600;
}

.widget-value {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1;
}

.widget-sub {
  font-size: 12px;
  color: var(--gray-4);
}

/* App grid */
.app-grid-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gray-5);
  font-weight: 600;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.app-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 12px 8px;
  border-radius: var(--radius-md);
  border: 1.5px solid transparent;
}

.app-icon:hover {
  background: var(--gray-9);
  border-color: var(--gray-7);
}

.app-icon:active {
  background: var(--gray-8);
}

.app-icon-img {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--black);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  border: 1.5px solid var(--gray-2);
}

.app-icon-label {
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  color: var(--gray-2);
  line-height: 1.2;
}

/* ---- DOCK ---- */
#dock {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--dock-height);
  background: var(--white);
  border-top: 1.5px solid var(--gray-7);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  z-index: 1000;
}

.dock-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1.5px solid transparent;
  min-width: 60px;
}

.dock-item:hover {
  background: var(--gray-9);
  border-color: var(--gray-7);
}

.dock-item.active {
  background: var(--black);
  border-color: var(--black);
}

.dock-item.active .dock-icon,
.dock-item.active .dock-label {
  color: var(--white);
}

.dock-icon {
  font-size: 22px;
  line-height: 1;
}

.dock-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-3);
}

/* ---- APP WINDOW ---- */
#app-layer {
  position: fixed;
  inset: 0;
  padding-top: var(--bar-height);
  padding-bottom: var(--dock-height);
  z-index: 500;
  pointer-events: none;
}

.app-window {
  position: absolute;
  inset: 0;
  background: var(--white);
  display: flex;
  flex-direction: column;
  pointer-events: all;
  overflow: hidden;
}

.app-window.hidden {
  display: none;
}

.app-titlebar {
  height: 44px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  border-bottom: 1.5px solid var(--gray-7);
  flex-shrink: 0;
}

.app-back-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--gray-7);
  font-size: 16px;
  cursor: pointer;
  background: var(--white);
  color: var(--gray-2);
}

.app-back-btn:hover {
  background: var(--gray-9);
}

.app-title {
  font-size: 15px;
  font-weight: 600;
  flex: 1;
}

.app-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

/* ---- NOTIFICATION TOAST ---- */
#toast-area {
  position: fixed;
  top: calc(var(--bar-height) + 8px);
  right: 12px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--black);
  color: var(--white);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  max-width: 280px;
  line-height: 1.4;
}

/* ---- QUICK PANEL ---- */
#quick-panel {
  position: fixed;
  top: var(--bar-height);
  right: 0;
  width: 300px;
  background: var(--white);
  border-left: 1.5px solid var(--gray-7);
  border-bottom: 1.5px solid var(--gray-7);
  border-bottom-left-radius: var(--radius-md);
  z-index: 1500;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.quick-section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gray-5);
  font-weight: 600;
}

.quick-toggles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.quick-toggle {
  padding: 12px;
  border: 1.5px solid var(--gray-7);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  background: var(--white);
  color: var(--gray-2);
}

.quick-toggle.on {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

.quick-slider-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.quick-slider-label {
  font-size: 12px;
  color: var(--gray-3);
  display: flex;
  justify-content: space-between;
}

.quick-slider {
  width: 100%;
  accent-color: var(--black);
  cursor: pointer;
}
