/* =============================================
   WORK PAGE — macOS DESKTOP STYLE
   ============================================= */

/* No scrolling — single viewport */
body.desktop-page {
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
}

/* Desktop container — full viewport */
.desktop-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* ===== BACKGROUND PHOTO (full viewport, like reference) ===== */
.desktop-bg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 0;
}

.desktop-bg img {
  width: auto;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  opacity: 0.16;
  user-select: none;
  -webkit-user-drag: none;
}

body.grayscale-theme .desktop-bg img {
  opacity: 0.08;
}

/* ===== LIVE CLOCK ===== */
.desktop-clock {
  position: absolute;
  top: 18px;
  right: 80px;
  z-index: 60;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--black);
  letter-spacing: 0.5px;
  opacity: 0.7;
  user-select: none;
}

/* ===== DESKTOP ICONS CONTAINER ===== */
.desktop-icons {
  position: absolute;
  inset: 0;
  z-index: 10;
}

/* ===== DESKTOP ICON ===== */
.desktop-icon {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  gap: 8px;
  z-index: 10;
  cursor: grab;
  animation: iconAppear 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.desktop-icon:nth-child(1) { animation-delay: 0.05s; }
.desktop-icon:nth-child(2) { animation-delay: 0.15s; }
.desktop-icon:nth-child(3) { animation-delay: 0.25s; }
.desktop-icon:nth-child(4) { animation-delay: 0.35s; }
.desktop-icon:nth-child(5) { animation-delay: 0.45s; }

@keyframes iconAppear {
  from {
    opacity: 0;
    transform: scale(0.4) translateY(30px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.desktop-icon:hover {
  transform: scale(1.06);
}

/* Dragging state */
.desktop-icon.dragging {
  cursor: grabbing;
  z-index: 100 !important;
  transform: scale(1.1);
  transition: none !important;
}

.desktop-icon.dragging .icon-thumb {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

/* Icon thumbnail */
.icon-thumb {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  transition: box-shadow 0.25s ease;
  background: var(--bg);
}

.desktop-icon:hover .icon-thumb {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
}

.icon-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

/* Icon label */
.icon-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 9px;
  font-weight: 700;
  color: var(--black);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  text-align: center;
  max-width: 120px;
  line-height: 1.3;
  pointer-events: none;
  text-shadow:
    0 1px 3px rgba(255, 255, 255, 0.9),
    0 0 8px rgba(255, 255, 255, 0.6);
}

body.grayscale-theme .icon-label {
  text-shadow:
    0 1px 3px rgba(0, 0, 0, 0.9),
    0 0 8px rgba(0, 0, 0, 0.6);
}

/* ===== macOS DOCK ===== */
.dock-wrapper {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  animation: dockSlideUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s backwards;
}

@keyframes dockSlideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(60px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.dock {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(245, 245, 245, 0.25);
  backdrop-filter: blur(28px) saturate(200%);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

body.grayscale-theme .dock {
  background: rgba(30, 30, 30, 0.35);
  border-color: rgba(255, 255, 255, 0.1);
}

/* ===== DOCK ITEM (Apple squircle style) ===== */
.dock-item {
  width: 48px;
  height: 48px;
  border-radius: 22%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 18px;
  color: white;
  transition: transform 0.18s ease;
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
  -webkit-user-drag: none;
  overflow: hidden;
}

/* Dock tooltip */
.dock-item[title]::before {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) scale(0.85);
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
  z-index: 100;
  overflow: visible;
}

.dock-item[title]::after {
  content: '';
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.78);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}

.dock-item:hover::before {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

.dock-item:hover::after {
  opacity: 1;
}

/* ===== DOCK ICON — Inner SVG sizing ===== */
.dock-item svg {
  width: 26px;
  height: 26px;
}

/* ===== VS Code ===== */
.dock-item.vscode {
  background: #2c2c32;
}
.dock-item.vscode svg {
  width: 32px;
  height: 32px;
}

/* ===== Terminal ===== */
.dock-item.terminal {
  background: transparent;
  padding: 0;
}
.dock-item.terminal svg {
  width: 48px;
  height: 48px;
  border-radius: 22%;
}

/* ===== Chrome ===== */
.dock-item.chrome {
  background: #fff;
}
.dock-item.chrome svg {
  width: 38px;
  height: 38px;
}

/* ===== Figma ===== */
.dock-item.figma {
  background: #1e1e1e;
}
.dock-item.figma svg {
  width: 24px;
  height: 36px;
}

/* Dock separator */
.dock-separator {
  width: 1px;
  height: 38px;
  background: rgba(0, 0, 0, 0.12);
  margin: 0 3px;
  flex-shrink: 0;
  align-self: center;
}

body.grayscale-theme .dock-separator {
  background: rgba(255, 255, 255, 0.15);
}

/* ===== Caution / Ukraine ===== */
.dock-item.caution {
  background: linear-gradient(180deg, #ffe066 0%, #ffc107 100%);
  color: #000;
}

/* ===== Notes ===== */
.dock-item.notes {
  background: linear-gradient(180deg, #fefbea 0%, #fde68a 100%);
  color: #92400e;
  position: relative;
}

/* ===== Photos / Gallery ===== */
.dock-item.photos {
  background: conic-gradient(
    from 0deg,
    #ff6b6b, #feca57, #48dbfb, #ff9ff3, #ff6b6b
  );
  color: white;
}

/* ===== Instagram ===== */
.dock-item.instagram {
  background: radial-gradient(circle at 30% 107%,
    #fdf497 0%, #fdf497 5%,
    #fd5949 45%, #d6249f 60%, #285AEB 90%
  );
  color: white;
}

/* ===== Mail ===== */
.dock-item.mail {
  background: linear-gradient(180deg, #60a5fa 0%, #2563eb 100%);
  color: white;
}

/* ===== Trash ===== */
.dock-item.trash {
  background: linear-gradient(180deg, #f3f4f6 0%, #d1d5db 100%);
  color: #6b7280;
}

/* ===== CORNER BUTTONS ===== */
.corner-buttons {
  position: absolute;
  bottom: 18px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 50;
}

.corner-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--black);
  transition: all 0.2s ease;
  font-family: 'Montserrat', sans-serif;
}

.corner-btn:hover {
  background: rgba(255, 255, 255, 0.65);
  transform: scale(1.1);
}

.corner-btn:active {
  transform: scale(0.95);
}

body.grayscale-theme .corner-btn {
  background: rgba(50, 50, 50, 0.4);
  border-color: rgba(255, 255, 255, 0.15);
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
  .desktop-clock {
    top: 14px;
    right: 60px;
    font-size: 12px;
  }

  .desktop-bg img {
    height: 70vh;
    opacity: 0.1;
  }

  .desktop-icons {
    position: static;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px 16px;
    padding: 100px 24px 20px;
    justify-items: center;
    align-content: start;
    flex: 1;
  }

  .desktop-container {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  .desktop-icon {
    position: static !important;
    animation-delay: 0s !important;
    cursor: pointer;
  }

  .icon-thumb {
    width: 68px;
    height: 68px;
    border-radius: 14px;
  }

  .icon-label {
    font-size: 8px;
    letter-spacing: 1px;
    max-width: 90px;
  }

  /* Dock mobile */
  .dock-wrapper {
    position: relative;
    bottom: auto;
    left: auto;
    transform: none;
    display: flex;
    justify-content: center;
    padding-bottom: 12px;
  }

  .dock {
    gap: 4px;
    padding: 5px 8px;
    border-radius: 16px;
  }

  .dock-item {
    width: 38px;
    height: 38px;
    border-radius: 20%;
    font-size: 15px;
  }

  .dock-item svg {
    width: 20px;
    height: 20px;
  }

  .dock-item.vscode svg {
    width: 24px;
    height: 24px;
  }

  .dock-item.terminal svg {
    width: 38px;
    height: 38px;
  }

  .dock-item.chrome svg {
    width: 30px;
    height: 30px;
  }

  .dock-item.figma svg {
    width: 16px;
    height: 24px;
  }

  .dock-item[title]::before,
  .dock-item[title]::after {
    display: none;
  }

  .dock-separator {
    height: 30px;
  }

  .corner-buttons {
    display: none;
  }
}

@media (max-width: 480px) {
  .desktop-icons {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px 20px;
    padding: 90px 32px 16px;
  }

  .icon-thumb {
    width: 72px;
    height: 72px;
  }

  .dock-item {
    width: 34px;
    height: 34px;
    font-size: 14px;
  }

  .dock-item svg {
    width: 18px;
    height: 18px;
  }

  .dock-item.vscode svg {
    width: 22px;
    height: 22px;
  }

  .dock-item.terminal svg {
    width: 34px;
    height: 34px;
  }

  .dock-item.chrome svg {
    width: 26px;
    height: 26px;
  }

  .dock-item.figma svg {
    width: 14px;
    height: 20px;
  }
}
