/* Desktop look & feel */
:root {
  --dock-height: 68px;
  --win-radius: 12px;
  --win-shadow: 0 24px 48px rgba(0,0,0,.35), 0 12px 24px rgba(0,0,0,.35);
  /* Mustard + Black theme */
  --mustard-300: #f0c96a;
  --mustard-500: #e0aa3e; /* primary */
  --mustard-700: #c9971a;
  --ink-900: #0b0b0d;   /* near black */
  --ink-800: #111115;
  --ink-700: #17181d;
  --ink-600: #1f2128;
  --fg: #f6f5f2;
  --muted: #b9b7b0;
  --bg-gradient: radial-gradient(1200px 800px at 20% 10%, rgba(224,170,62,.12), transparent 60%),
                  radial-gradient(1200px 800px at 80% 90%, rgba(224,170,62,.08), transparent 60%),
                  linear-gradient(120deg, #0b0b0d 0%, #1a1b20 100%);
}

body.gt-desktop-body {
  margin: 0;
  background: var(--ink-900);
  color: var(--fg);
  overflow: hidden;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

.desktop {
  position: fixed;
  inset: 0;
  background: var(--bg-gradient);
  background-size: cover;
  background-position: center;
}

/* When a custom background is provided */
.desktop.custom-bg {
  /* Layer the gradient on top of the image */
  background-image: linear-gradient(120deg, rgba(11,11,13,.75) 0%, rgba(26,27,32,.65) 100%), var(--desktop-bg-url);
  background-size: cover;
  background-position: center;
}

/* Logout button */
.logout-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(224,170,62,.28);
  background: rgba(255,255,255,.06);
  color: var(--fg);
  transition: background .2s, transform .08s ease;
}
.logout-btn:hover { background: rgba(224,170,62,.18); }
.logout-btn:active { transform: translateY(1px); }

.windows {
  position: absolute;
  inset: 0;
  padding: 24px;
  padding-bottom: calc(var(--dock-height) + 24px);
  z-index: 1;
}

/* Window */
.win {
  position: absolute;
  width: 980px;
  height: 640px;
  background: rgba(17,17,23,.86);
  border: 1px solid rgba(224,170,62,.18);
  backdrop-filter: blur(12px) saturate(140%);
  border-radius: var(--win-radius);
  box-shadow: var(--win-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform-origin: 50% 50%;
  animation: winIn .22s ease-out;
  transition: left .3s ease, top .3s ease, width .3s ease, height .3s ease, right .3s ease, bottom .3s ease;
}
@keyframes winIn { from { transform: scale(.96); opacity:.0 } to { transform: scale(1); opacity:1 } }

.win-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: linear-gradient(to bottom, rgba(224,170,62,.18), rgba(224,170,62,.05));
  border-bottom: 1px solid rgba(224,170,62,.22);
  cursor: move;
}
.win-header .win-traffic,
.win-header .win-actions { cursor: default; }
.win-traffic {
  display: flex;
  gap: 8px;
}
.win-traffic .dot { width: 12px; height: 12px; border-radius: 50%; display:inline-block; }
.win-traffic .dot.close { background:#ff5f57; }
.win-traffic .dot.min { background:#febc2e; }
.win-traffic .dot.max { background:#28c840; }
.win-traffic .dot { cursor: pointer; box-shadow: inset 0 -2px 0 rgba(0,0,0,.15); transition: transform .08s ease, filter .12s ease; }
.win-traffic .dot:hover { filter: brightness(1.1); transform: translateY(-1px); }

.win-title { flex: 1; text-align:center; font-weight:600; font-size: 14px; color: var(--fg); opacity:.95; user-select:none }

.win-actions { display:flex; gap: 6px; }
.win-actions .btn {
  color: var(--fg); background: rgba(224,170,62,.08); border: 1px solid rgba(224,170,62,.35);
  border-radius: 8px; padding: 2px 8px; font-size: 12px; line-height: 20px;
}
.win-actions .btn:hover { background: rgba(224,170,62,.16); }

.win-body { flex:1; background: var(--ink-800); }
.win-body iframe { width:100%; height:100%; border:0; background:white; }

/* Resize handle */
.win-resize { position: absolute; right: 4px; bottom: 4px; width: 14px; height: 14px; cursor: nwse-resize; opacity:.7 }
.win-resize::after { content:''; position:absolute; inset:0; background: linear-gradient(135deg, transparent 50%, rgba(255,255,255,.5) 50%); border-radius: 2px; }

/* Launchpad */
.launchpad { position:absolute; inset:0; backdrop-filter: blur(24px) saturate(140%); background: rgba(10,12,26,.35); display:flex; flex-direction: column; opacity:1; transition: opacity .18s ease; z-index: 5000; }
.launchpad.hidden { opacity:0; pointer-events:none; }
.lp-top { display:flex; justify-content:center; padding: 24px 24px 8px 24px; }
.search-wrap { display:flex; align-items:center; gap:8px; background: rgba(255,255,255,.06); padding:8px 12px; border-radius: 12px; width: min(720px, 92vw); border: 1px solid rgba(224,170,62,.25); }
.search-wrap input { flex:1; background: transparent; border:0; outline:0; color: #fff; }
.search-wrap:focus-within { box-shadow: 0 0 0 2px rgba(224,170,62,.65) inset; }

.lp-actions { display:flex; align-items:center; margin-left: 12px; }
.btn-logout { display:inline-flex; align-items:center; gap:8px; padding:8px 12px; border-radius: 10px; border: 1px solid rgba(224,170,62,.28); background: rgba(255,255,255,.06); color: var(--fg); transition: background .2s, transform .08s ease; }
.btn-logout:hover { background: rgba(224,170,62,.18); }
.btn-logout:active { transform: translateY(1px); }

.company-banner { display:flex; justify-content:center; margin-top: 12px; padding: 0 16px; }
.company-inner { display:flex; flex-direction: column; align-items:center; gap: 10px; padding: 16px 20px; border-radius: 14px; background: linear-gradient(180deg, rgba(224,170,62,.12), rgba(224,170,62,.06)); border: 1px solid rgba(224,170,62,.28); box-shadow: 0 12px 28px rgba(0,0,0,.35), inset 0 0 0 1px rgba(224,170,62,.15); max-width: 860px; width: 100%; }
.company-logo img { height: 56px; width:auto; object-fit: contain; filter: drop-shadow(0 2px 4px rgba(0,0,0,.35)); border-radius: 8px; }
.company-text { display:flex; flex-direction:column; align-items:center; gap: 8px; text-align:center; }
.company-name { font-weight: 800; letter-spacing:.6px; color: var(--mustard-300); font-size: 20px; text-transform: uppercase; }
.company-sep { width: 160px; height: 1px; background: linear-gradient(90deg, rgba(224,170,62,.0), rgba(224,170,62,.5), rgba(224,170,62,.0)); border-radius: 1px; }
.info-list { display:flex; justify-content:center; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; }
.info-item { display:flex; align-items:center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: rgba(17,17,23,.6); border: 1px solid rgba(224,170,62,.22); color: var(--fg); font-size: 12px; }
.info-item i { color: var(--mustard-500); }
.company-actions { margin-top: 6px; }
.company-actions .btn { border-color: rgba(224,170,62,.35) !important; color: var(--fg); }
.company-actions .btn:hover { background: rgba(224,170,62,.18); }

.lp-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(160px, 200px)); justify-content: center; justify-items: center; gap: 24px; padding: 32px 24px 28px; max-width: 1200px; margin: 0 auto; }
.app-icon { width: 200px; display:flex; flex-direction:column; align-items:center; gap:12px; padding:18px 14px; border-radius: 16px; background: rgba(17,17,23,.55); border: 1px solid rgba(224,170,62,.18); backdrop-filter: blur(10px) saturate(130%); box-shadow: 0 10px 20px rgba(0,0,0,.28), inset 0 0 0 1px rgba(255,255,255,.02); transition: transform .14s ease, background .22s, box-shadow .22s, border-color .22s; cursor:pointer; user-select:none; position: relative; overflow: hidden; }
.app-icon::before { content:''; position:absolute; inset: -20%; background: radial-gradient(400px 200px at 10% -10%, rgba(224,170,62,.18), rgba(224,170,62,0) 60%); pointer-events:none; transition: transform .3s ease, opacity .3s ease; opacity:.85; }
.app-icon:hover { transform: translateY(-3px); background: rgba(17,17,23,.7); border-color: rgba(224,170,62,.28); box-shadow: 0 16px 28px rgba(0,0,0,.35), 0 6px 14px rgba(0,0,0,.25); }
.app-icon:active { transform: translateY(-1px) scale(.99); }
.app-icon:focus-visible { outline: none; box-shadow: 0 0 0 2px rgba(224,170,62,.65), 0 12px 24px rgba(0,0,0,.35); }
.app-icon:hover::before { transform: translateY(6px); opacity: 1; }
.app-emoji { font-size: 30px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.35)); }
.app-label { font-size: 13.5px; font-weight: 600; letter-spacing:.2px; text-align:center; color: var(--fg); opacity:.95; }

/* Subtle entry animation with stagger */
@keyframes cardIn { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.lp-grid .app-icon { animation: cardIn .28s ease both; }
.lp-grid .app-icon:nth-child(1) { animation-delay: .02s; }
.lp-grid .app-icon:nth-child(2) { animation-delay: .05s; }
.lp-grid .app-icon:nth-child(3) { animation-delay: .08s; }
.lp-grid .app-icon:nth-child(4) { animation-delay: .11s; }
.lp-grid .app-icon:nth-child(5) { animation-delay: .14s; }
.lp-grid .app-icon:nth-child(6) { animation-delay: .17s; }

@media (max-width: 768px) {
  .lp-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 18px; padding-top: 24px; }
  .app-icon { width: 100%; }
}

/* Dock */
.dock { position: absolute; left: 50%; transform: translateX(-50%); bottom: 12px; height: var(--dock-height); backdrop-filter: blur(16px) saturate(130%); background: rgba(17,17,23,.65); border: 1px solid rgba(224,170,62,.28); border-radius: 16px; box-shadow: 0 18px 36px rgba(0,0,0,.5); display:flex; align-items:center; gap: 10px; padding: 10px; z-index: 10000; }
.dock-item { width: 44px; height: 44px; border-radius: 10px; display:grid; place-items:center; color:var(--fg); background: rgba(224,170,62,.08); border:1px solid rgba(224,170,62,.25); box-shadow: inset 0 -2px 0 rgba(0,0,0,.2); transition: all .2s ease; }
.dock-item:hover { background: rgba(224,170,62,.16); }
.dock-item.active { background: rgba(224,170,62,.25); border-color: rgba(224,170,62,.4); }
.dock-apps { display:flex; gap: 10px; margin: 0 6px; }
.dock-right { display:flex; gap: 10px; }

/* Auto-hide behavior */
.dock { transition: transform .18s ease, opacity .18s ease, border-color .2s ease; }
.dock.hidden { transform: translate(-50%, 120%); opacity: 0; pointer-events: none; }
.hotzone {
  position: absolute; left: 0; right: 0; bottom: 0; height: 14px;
  /* invisible, used to detect hover near bottom */
  z-index: 10001;
}

/* Tiling helpers */
.tile-left { left:24px; top:24px; bottom: calc(var(--dock-height) + 24px); width: calc(50% - 36px); height: auto; }
.tile-right { right:24px; top:24px; bottom: calc(var(--dock-height) + 24px); width: calc(50% - 36px); height: auto; }
.tile-full { left:24px; right:24px; top:24px; bottom: calc(var(--dock-height) + 24px); width:auto; height:auto; }
.tile-grid { position: absolute; }

/* When dock is hidden, let full-screen windows touch the bottom (overlay under dock when it shows) */
.dock-hidden .tile-full { bottom: 24px; }
.dock-hidden .tile-left { bottom: 24px; }
.dock-hidden .tile-right { bottom: 24px; }

/* Utility */
.hide { display:none !important; }
