/* ==================== RESET & BASE ==================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  user-select: none;
}

/* ==================== LOGIN SCREEN ==================== */
#login-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  background: url('assets/backgrounds/login-bg.png') center/cover no-repeat;
      background-size: cover;
  background-position: top center;
  background-repeat: no-repeat;

}

.login-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 360px;
  padding: 40px 30px;
  text-align: center;
}

.login-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.5);
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.login-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.login-avatar-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 48px;
  font-weight: 300;
}

.login-name {
  margin: 0 0 24px;
  color: white;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-shadow:
    0 2px 4px rgba(0, 0, 0, 0.9),
    0 4px 12px rgba(0, 0, 0, 0.8),
    0 0 18px rgba(0, 0, 0, 0.7);
}

.password-wrap {
  width: 100%;
  position: relative;
  margin-bottom: 12px;
}

#password {
  width: 100%;
  height: 44px;
  padding: 0 50px 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  outline: none;
  font-size: 15px;
  color: white;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  transition: all 0.2s;
}

#password::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

#password:focus {
  border-color: rgba(100, 180, 255, 0.8);
  background: rgba(0, 0, 0, 0.55);
  box-shadow: 0 0 0 3px rgba(100, 180, 255, 0.15);
}

.login-arrow {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 18px;
  color: white;
  background: rgba(100, 180, 255, 0.7);
  transition: background 0.2s;
}

.login-arrow:hover {
  background: rgba(100, 180, 255, 0.95);
}

.password-hint {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  text-shadow:
    0 2px 4px rgba(0, 0, 0, 0.9),
    0 4px 12px rgba(0, 0, 0, 0.8),
    0 0 18px rgba(0, 0, 0, 0.7);
}

/* ==================== DESKTOP ==================== */
#desktop {
  position: fixed;
  inset: 0;
  background: url('assets/backgrounds/desktop-bg.png') center/cover no-repeat;
    background-size: cover;
  background-position: top center;
  background-repeat: no-repeat;

  overflow: hidden;
}

/* Desktop Icons */
#desktop-icons {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 10;
}

.desktop-icon {
  width: 100px;
  height: 118px;
  padding: 8px 6px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;

  display: grid;
  grid-template-rows: 78px 28px;
  justify-items: center;
  align-items: center;
}

.desktop-icon:hover {
  background: rgba(255, 255, 255, 0.15);
}

.desktop-icon.selected {
  background: rgba(66, 133, 244, 0.25);
  outline: 1px solid rgba(66, 133, 244, 0.5);
}

/* Fixed image area */
.desktop-icon img {
  grid-row: 1;
  width: 68px;
  height: 68px;
  object-fit: contain;
  margin: 0;
  align-self: center;
}

/* Fixed fallback area */
.icon-fallback {
  grid-row: 1;
  width: 68px;
  height: 68px;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  margin: 0;
  align-self: center;
}

/* Fixed text area */
.desktop-icon span {
  grid-row: 2;
  width: 100%;
  height: 28px;

  display: flex;
  align-items: flex-start;
  justify-content: center;

  color: white;
  font-size: 12px;
  line-height: 1.15;
  font-weight: 600;
  text-align: center;

  text-shadow:
    0 1px 3px rgba(0,0,0,0.95),
    0 2px 8px rgba(0,0,0,0.85);

  overflow: hidden;
}

/* ==================== WINDOWS ==================== */
#windows-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

#windows-container > * {
  pointer-events: auto;
}

.window {
  position: absolute;
  top: 0;
  left: 0;
  transform: none;
  min-width: 400px;
  min-height: 300px;
  width: 760px;
  height: 560px;
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 80px);
  background: #fff;
  border-radius: 0px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25), 0 1px 3px rgba(0,0,0,0.1);
  overflow: visible;
  display: flex;
  flex-direction: column;
  animation: windowOpen 0.2s ease-out;
  z-index: 100;
  border: 1px solid rgba(0,0,0,0.08);
  resize: both;
}


.window.dragging {
  opacity: 0.9;
  transition: none;
}

.window.maximized {
  top: 0 !important;
  left: 0 !important;
  transform: none !important;
  width: 100vw !important;
  height: calc(100vh - 56px) !important;
  max-width: none;
  max-height: none;
  border-radius: 0;
  border: none;
  resize: none;
}

@keyframes windowOpen {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Window Header */
.window-header {
  height: 40px;
  background: #ffc60a;
  border-bottom: 1px solid #ffc60a;
  display: flex;
  align-items: center;
  padding: 0 12px;
  cursor: grab;
  flex-shrink: 0;
}

.window-header,
.window-content {
  position: relative;
  z-index: 2;
}

.window.maximized::before {
  display: none;
}

.window-header:active {
  cursor: grabbing;
}

.window-icon {
  width: 18px;
  height: 18px;
  margin-right: 10px;
  object-fit: contain;
  opacity: 0.8;
}

.window-title {
  flex: 1;
  font-size: 13px;
  color: #3c4043;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.window-controls {
  display: flex;
  gap: 4px;
}

.window-control {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 400;
  transition: all 0.15s;
  background: transparent;
  color: #5f6368;
}

.window-control:hover {
  background: #e8eaed;
  color: #202124;
}

.window-close:hover {
  background: #ea4335;
  color: white;
}

/* Window Content */
.window-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  background: #fff;
}

.window.maximized .window-content {
  max-height: none;
}

/* ==================== TASKBAR ==================== */
#taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px; /* was 48px */
  background: linear-gradient(180deg, rgba(30, 35, 45, 0.92) 0%, rgba(15, 20, 30, 0.96) 100%);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 6px;
  z-index: 1000;
}

#start-btn {
  width: 48px;  /* was 40px */
  height: 48px; /* was 40px */
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}

#start-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

#start-btn img {
  width: 28px;  /* was 22px */
  height: 28px; /* was 22px */
  object-fit: contain;
}

/* Pinned Apps */
#taskbar-pinned {
  display: flex;
  gap: 4px;
  padding: 0 6px;
  flex-shrink: 0;
}

.taskbar-pin {
  width: 48px;  /* was 40px */
  height: 48px; /* was 40px */
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  position: relative;
  color: white;
}

.taskbar-pin:hover {
  background: rgba(255, 255, 255, 0.1);
}

.taskbar-pin img {
  width: 28px;  /* was 22px */
  height: 28px; /* was 22px */
  object-fit: contain;
}

/* Divider */
.taskbar-divider {
  width: 1px;
  height: 30px; /* was 24px */
  background: rgba(255, 255, 255, 0.1);
  margin: 0 6px;
  flex-shrink: 0;
}

#taskbar-apps {
  display: flex;
  gap: 4px;
  flex: 1;
  padding: 0 6px;
  min-width: 0;
}

.taskbar-app {
  height: 44px; /* was 36px */
  padding: 0 14px;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  color: rgba(255,255,255,0.9);
  font-size: 13px; /* was 12px */
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.15s;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  flex-shrink: 1;
  position: relative;
  font-weight: 500;
}

.taskbar-app:hover {
  background: rgba(255, 255, 255, 0.12);
}

.taskbar-app.active {
  background: rgba(66, 133, 244, 0.25);
}

.taskbar-app.active::after {
  content: '';
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px; /* was 16px */
  height: 3px; /* was 2px */
  background: #8ab4f8;
  border-radius: 2px;
}

.taskbar-app img {
  width: 24px;  /* was 18px */
  height: 24px; /* was 18px */
  object-fit: contain;
  flex-shrink: 0;
}

#taskbar-tray {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  color: rgba(255,255,255,0.85);
  font-size: 13px;
  padding: 0 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  margin-left: 8px;
  flex-shrink: 0;
}

#clock {
  font-weight: 600;
  font-size: 18px; /* was 12px */
}

#date {
  color: rgba(255, 255, 255, 0.55);
  font-size: 16px; /* was 10px */
}

/* ==================== START MENU ==================== */
#start-menu {
  position: fixed;
  bottom: 56px;
  left: 0;
  width: 280px;
  background: linear-gradient(180deg, rgba(35, 40, 55, 0.95) 0%, rgba(20, 25, 40, 0.98) 100%);
  backdrop-filter: blur(30px);
  border-radius: 8px 8px 0 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.4);
  z-index: 999;
  overflow: hidden;
}

.start-menu-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.start-menu-header img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.start-menu-header span {
  color: white;
  font-size: 15px;
  font-weight: 500;
}

.start-menu-apps {
  padding: 6px;
}

.start-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  color: white;
}

.start-menu-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.start-menu-item img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.start-menu-item span {
  font-size: 13px;
  font-weight: 400;
}

.start-menu-footer {
  padding: 10px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

#shutdown-btn {
  width: 100%;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background: transparent;
  color: white;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

#shutdown-btn:hover {
  background: rgba(234, 67, 53, 0.2);
  border-color: rgba(234, 67, 53, 0.4);
}

.page-shell {
  display: flex;
  flex-direction: column;
  background: #fff;
  min-height: 100%;
}

.app-bar {
  height: 56px;
  background: #fff;
  border-bottom: 1px solid #dadce0;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.app-bar-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.app-bar-title {
  font-size: 20px;
  font-weight: 400;
  color: #202124;
  letter-spacing: -0.2px;
}

.app-bar-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

.app-bar-btn {
  padding: 8px 16px;
  border: 1px solid #dadce0;
  border-radius: 4px;
  background: #fff;
  color: #5f6368;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.app-bar-btn:hover {
  background: #f8f9fa;
  border-color: #bdc1c6;
}

.app-bar-btn.primary {
  background: #1a73e8;
  color: white;
  border-color: #1a73e8;
}

.app-bar-btn.primary:hover {
  background: #1557b0;
  border-color: #1557b0;
}

/* Content area */
.app-content {
  padding: 24px 32px;
  flex: 1;
  overflow-y: auto;
}

/* Cards - clean Google Material style */
.material-card {
  background: #fff;
  border-radius: 8px;
  border: 1px solid #dadce0;
  padding: 24px;
  margin-bottom: 16px;
  transition: box-shadow 0.2s;
}

.material-card:hover {
  box-shadow: 0 1px 6px rgba(60,64,67,0.1);
}

.material-card-title {
  font-size: 16px;
  font-weight: 500;
  color: #202124;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.material-card-text {
  font-size: 14px;
  line-height: 1.6;
  color: #5f6368;
}

/* Grid layout */
.material-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* Chips/Tags - Google style */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 16px;
  background: #f1f3f4;
  color: #3c4043;
  font-size: 12px;
  font-weight: 500;
  margin: 2px;
  transition: all 0.15s;
}

.chip:hover {
  background: #e8eaed;
}

.chip-blue { background: #e8f0fe; color: #1967d2; }
.chip-blue:hover { background: #d2e3fc; }

.chip-green { background: #e6f4ea; color: #137333; }
.chip-green:hover { background: #ceead6; }

.chip-red { background: #fce8e6; color: #c5221f; }
.chip-red:hover { background: #fad2cf; }

.chip-yellow { background: #fef7e0; color: #b06000; }
.chip-yellow:hover { background: #feefc3; }

/* Lists */
.material-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.material-list li {
  padding: 12px 0;
  border-bottom: 1px solid #f1f3f4;
  font-size: 14px;
  color: #3c4043;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.material-list li:last-child {
  border-bottom: none;
}

.material-list li::before {
  content: 'check_circle';
  font-family: 'Material Icons';
  color: #34a853;
  font-size: 18px;
  flex-shrink: 0;
}

/* Collapsible - clean accordion */
.accordion {
  border: 1px solid #dadce0;
  border-radius: 8px;
  overflow: hidden;
  margin-top: 16px;
}

.accordion-header {
  width: 100%;
  padding: 14px 18px;
  background: #f8f9fa;
  border: none;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #3c4043;
  transition: background 0.15s;
  text-align: left;
}

.accordion-header:hover {
  background: #f1f3f4;
}

.accordion-arrow {
  font-size: 12px;
  color: #5f6368;
  transition: transform 0.2s;
  margin-left: auto;
}

.accordion-header.active .accordion-arrow {
  transform: rotate(180deg);
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background: #fff;
}

.accordion-body.active {
  max-height: 600px;
}

.accordion-body ul {
  margin: 0;
  padding: 16px 18px 16px 36px;
  list-style: disc;
}

.accordion-body li {
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.6;
  color: #5f6368;
}

/* Thumbnails */
.thumb-link {
  display: block;
  margin-top: 16px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #dadce0;
  transition: box-shadow 0.2s;
}

.thumb-link:hover {
  box-shadow: 0 4px 12px rgba(60,64,67,0.15);
}

.thumb-link img {
  width: 100%;
  display: block;
  transition: transform 0.3s;
}

.thumb-link:hover img {
  transform: scale(1.02);
}

/* Resize handle indicator */
.window::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 50%, rgba(0,0,0,0.15) 50%);
  border-bottom-right-radius: 8px;
  pointer-events: none;
  z-index: 10;
}

.window.maximized::after {
  display: none;
}

/* Window decoration element - per-window customizable */
.window-decor {
  position: absolute;
  pointer-events: none;
  z-index: 80;
  background-repeat: no-repeat;
  background-position: center;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Maximized windows hide the decoration */
.window.maximized .window-decor {
  display: none !important;
}

/* ==================== WINDOW RESIZE ==================== */
.resize-handle {
  position: absolute;
  z-index: 1000;
}

.resize-handle.n {
  top: 0; left: 8px; right: 8px; height: 6px;
  cursor: ns-resize;
}
.resize-handle.s {
  bottom: 0; left: 8px; right: 8px; height: 6px;
  cursor: ns-resize;
}
.resize-handle.e {
  right: 0; top: 8px; bottom: 8px; width: 6px;
  cursor: ew-resize;
}
.resize-handle.w {
  left: 0; top: 8px; bottom: 8px; width: 6px;
  cursor: ew-resize;
}
.resize-handle.ne {
  top: 0; right: 0; width: 10px; height: 10px;
  cursor: nesw-resize;
}
.resize-handle.nw {
  top: 0; left: 0; width: 10px; height: 10px;
  cursor: nwse-resize;
}
.resize-handle.se {
  bottom: 0; right: 0; width: 10px; height: 10px;
  cursor: nwse-resize;
}
.resize-handle.sw {
  bottom: 0; left: 0; width: 10px; height: 10px;
  cursor: nesw-resize;
}

.window.resizing {
  transition: none !important;
  user-select: none;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
  .material-grid {
    grid-template-columns: 1fr;
  }

  .window {
    min-width: 95vw;
    width: 95vw;
  }

  .app-content {
    padding: 16px;
  }

  #desktop-icons {
    top: 8px;
    left: 8px;
  }

  .desktop-icon {
    width: 64px;
  }

  .desktop-icon img,
  .icon-fallback {
    width: 36px;
    height: 36px;
  }

  .desktop-icon span {
    font-size: 10px;
  }

  #taskbar-pinned {
    display: none;
  }

  .taskbar-divider {
    display: none;
  }
}

/* ==================== RESIZE HANDLES ==================== */
.resize-handle {
  position: absolute;
  z-index: 1000;
}

.resize-handle.se {
  bottom: 0;
  right: 0;
  width: 16px;
  height: 16px;
  cursor: se-resize;
}

.resize-handle.se::after {
  content: '';
  position: absolute;
  bottom: 3px;
  right: 3px;
  width: 8px;
  height: 8px;
  border-right: 2px solid rgba(0,0,0,0.3);
  border-bottom: 2px solid rgba(0,0,0,0.3);
  border-radius: 0 0 2px 0;
}

.resize-handle.e {
  top: 40px;
  right: 0;
  width: 6px;
  bottom: 0;
  cursor: e-resize;
}

.resize-handle.s {
  bottom: 0;
  left: 0;
  right: 0;
  height: 6px;
  cursor: s-resize;
}
