/* === EDS'OS — CORE STYLES === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --accent: #6c63ff;
  --accent2: #00d4ff;
  --bg-dark: #0a0a1a;
  --bg-mid: #111128;
  --bg-panel: rgba(15,15,35,0.92);
  --bg-glass: rgba(20,20,50,0.80);
  --border: rgba(108,99,255,0.25);
  --text: #e8e8f0;
  --text-dim: #8888aa;
  --danger: #ff4757;
  --success: #2ed573;
  --warning: #ffa502;
  --taskbar-h: 48px;
  --radius: 12px;
  --shadow: 0 20px 60px rgba(0,0,0,0.6);
}

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  font-family: 'Inter', sans-serif;
  background: var(--bg-dark);
  color: var(--text);
  user-select: none;
}

/* === BOOT SCREEN === */
#boot-screen {
  position: fixed; inset: 0;
  background: var(--bg-dark);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  flex-direction: column;
  animation: bootFade 0.5s ease 3s forwards;
}
@keyframes bootFade { to { opacity: 0; pointer-events: none; } }

.boot-logo { text-align: center; }
.boot-icon {
  font-size: 64px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: 16px;
  animation: bootPulse 1s ease infinite alternate;
}
@keyframes bootPulse { to { filter: brightness(1.4); } }
.boot-logo h1 { font-size: 2.5rem; font-weight: 700; letter-spacing: 0.1em; margin-bottom: 6px; }
.boot-logo p { color: var(--text-dim); margin-bottom: 32px; }
.boot-bar {
  width: 220px; height: 3px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px; margin: 0 auto;
  overflow: hidden;
}
.boot-progress {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 2px;
  animation: bootLoad 2.8s cubic-bezier(0.4,0,0.2,1) forwards;
}
@keyframes bootLoad { from { width: 0; } to { width: 100%; } }

/* === LOCK SCREEN === */
#lock-screen {
  position: fixed; inset: 0; z-index: 9000;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  animation: none;
}
.lock-bg {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #0a0a1a 0%, #1a0a2e 50%, #0a1a2e 100%);
}
.lock-bg::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%236c63ff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.lock-content { position: relative; text-align: center; }
.lock-avatar {
  width: 90px; height: 90px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; margin: 0 auto 20px;
  box-shadow: 0 0 40px rgba(108,99,255,0.5);
}
#lock-time { font-size: 5rem; font-weight: 200; letter-spacing: -2px; margin-bottom: 8px; }
#lock-date { color: var(--text-dim); font-size: 1rem; margin-bottom: 30px; }
.lock-hint {
  color: rgba(255,255,255,0.4);
  font-size: 0.85rem;
  animation: lockPulse 2s ease infinite;
}
@keyframes lockPulse { 0%,100%{opacity:0.4} 50%{opacity:1} }

/* === DESKTOP === */
#desktop {
  position: fixed; inset: 0;
  padding-bottom: var(--taskbar-h);
  overflow: hidden;
}
#wallpaper {
  position: absolute; inset: 0;
  background:
    url('../pictures/wallpaper-default.svg') center/cover no-repeat,
    radial-gradient(ellipse at 20% 50%, rgba(108,99,255,0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(0,212,255,0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 60% 80%, rgba(255,71,87,0.08) 0%, transparent 40%),
    linear-gradient(135deg, #060612 0%, #0d0d24 40%, #060618 100%);
  z-index: 0;
}
#wallpaper::after {
  content: '';
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,0.04) 1px, transparent 0);
  background-size: 40px 40px;
}

/* === DESKTOP ICONS === */
#desktop-icons {
  position: absolute;
  top: 12px; left: 12px; bottom: 12px;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 6px;
  z-index: 10;
  max-height: calc(100vh - var(--taskbar-h) - 24px);
  overflow: hidden;
  width: fit-content;
}
.desk-icon {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; padding: 10px 6px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
  width: 82px;
}
.desk-icon:hover { background: rgba(108,99,255,0.18); }
.desk-icon:active { background: rgba(108,99,255,0.3); transform: scale(0.95); }
.desk-icon.selected {
  background: rgba(108,99,255,0.22);
  outline: 1px solid rgba(108,99,255,0.5);
}
.desk-icon-img {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, rgba(108,99,255,0.3), rgba(0,212,255,0.2));
  border: 1px solid rgba(108,99,255,0.3);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  color: var(--accent2);
  transition: transform 0.2s, box-shadow 0.2s;
  backdrop-filter: blur(10px);
}
.desk-icon:hover .desk-icon-img {
  transform: scale(1.08);
  box-shadow: 0 8px 24px rgba(108,99,255,0.4);
}
.ai-icon { background: linear-gradient(135deg, rgba(108,99,255,0.5), rgba(255,71,87,0.3)) !important; }
.desk-icon span {
  font-size: 0.7rem; font-weight: 500;
  color: rgba(255,255,255,0.9);
  text-align: center;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
  line-height: 1.2;
  max-width: 78px;
  word-break: break-word;
}

/* === TASKBAR === */
#taskbar {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--taskbar-h);
  background: rgba(8,8,20,0.9);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex; align-items: center;
  gap: 4px; padding: 0 8px;
  z-index: 8000;
}
#start-btn {
  display: flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none; border-radius: 8px;
  color: white; font-size: 0.85rem; font-weight: 600;
  padding: 6px 14px; cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: opacity 0.2s, transform 0.1s;
  white-space: nowrap;
}
#start-btn:hover { opacity: 0.9; }
#start-btn:active { transform: scale(0.95); }
#taskbar-apps {
  display: flex; align-items: center; gap: 4px;
  flex: 1; overflow-x: auto;
  scrollbar-width: none;
}
#taskbar-apps::-webkit-scrollbar { display: none; }
.taskbar-item {
  display: flex; align-items: center; gap: 6px;
  background: rgba(108,99,255,0.15);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px; cursor: pointer;
  font-size: 0.78rem; color: var(--text);
  white-space: nowrap;
  transition: background 0.2s;
  max-width: 160px;
}
.taskbar-item.active {
  background: rgba(108,99,255,0.35);
  border-color: var(--accent);
}
.taskbar-item:hover { background: rgba(108,99,255,0.25); }
.taskbar-item i { font-size: 12px; color: var(--accent2); }
#taskbar-tray {
  margin-left: auto;
  padding: 0 12px;
  color: var(--text-dim);
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
}

/* === START MENU === */
#start-menu {
  position: fixed; bottom: var(--taskbar-h); left: 0;
  width: 380px;
  background: rgba(10,10,26,0.97);
  backdrop-filter: blur(30px);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  z-index: 8500;
  padding: 20px;
  box-shadow: var(--shadow);
}
.start-header {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 16px;
}
.start-avatar {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.start-username { font-weight: 600; font-size: 0.95rem; }
.start-subtitle { color: var(--text-dim); font-size: 0.75rem; }
.start-search-wrap {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 12px;
  margin-bottom: 14px;
}
.start-search-wrap i { color: var(--text-dim); }
#start-search {
  background: none; border: none; outline: none;
  color: var(--text); font-size: 0.88rem; width: 100%;
  font-family: 'Inter', sans-serif;
}
.start-categories {
  display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap;
}
.start-cat {
  padding: 4px 12px; border-radius: 20px;
  font-size: 0.75rem; cursor: pointer;
  border: 1px solid var(--border);
  color: var(--text-dim);
  transition: all 0.2s;
}
.start-cat.active, .start-cat:hover {
  background: var(--accent); border-color: var(--accent); color: white;
}
.start-apps {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 6px; max-height: 280px; overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}
.start-app-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border-radius: 8px; cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
}
.start-app-item:hover {
  background: rgba(108,99,255,0.15);
  border-color: var(--border);
}
.start-app-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
}
.start-app-name { font-size: 0.8rem; font-weight: 500; }
.start-app-cat { font-size: 0.68rem; color: var(--text-dim); }
.start-footer {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--border);
}
.start-footer-btn {
  background: rgba(255,255,255,0.05); border: 1px solid var(--border);
  color: var(--text); border-radius: 8px;
  padding: 7px 14px; cursor: pointer; font-size: 0.8rem;
  font-family: 'Inter', sans-serif;
  transition: background 0.2s;
}
.start-footer-btn:hover { background: rgba(255,255,255,0.1); }

/* === NOTIFICATIONS === */
#notifications {
  position: fixed; top: 16px; right: 16px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 9500; pointer-events: none;
  max-width: 320px;
}
.notif {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  display: flex; align-items: flex-start; gap: 12px;
  pointer-events: all;
  animation: notifIn 0.3s ease;
  box-shadow: var(--shadow);
}
@keyframes notifIn { from { transform: translateX(100%); opacity: 0; } }
.notif.out { animation: notifOut 0.3s ease forwards; }
@keyframes notifOut { to { transform: translateX(110%); opacity: 0; } }
.notif-icon { font-size: 18px; flex-shrink: 0; margin-top: 2px; }
.notif-icon.success { color: var(--success); }
.notif-icon.error { color: var(--danger); }
.notif-icon.info { color: var(--accent2); }
.notif-title { font-weight: 600; font-size: 0.85rem; margin-bottom: 2px; }
.notif-msg { color: var(--text-dim); font-size: 0.78rem; }

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(108,99,255,0.4); border-radius: 2px; }

/* === SELECTION === */
::selection { background: rgba(108,99,255,0.4); }

/* === RESPONSIVE — MOBILE === */
@media (max-width: 768px) {
  :root { --taskbar-h: 42px; }

  #desktop-icons {
    top: 8px; left: 8px;
    gap: 4px;
  }
  .desk-icon { width: 68px; padding: 8px 4px; }
  .desk-icon-img { width: 40px; height: 40px; font-size: 16px; }
  .desk-icon span { font-size: 0.62rem; max-width: 64px; }

  #taskbar { padding: 0 4px; gap: 2px; }
  #start-btn { padding: 5px 10px; font-size: 0.78rem; }
  #start-btn span { display: none; }
  .taskbar-item { padding: 3px 8px; font-size: 0.72rem; max-width: 120px; }
  .taskbar-item span { display: none; }
  #taskbar-tray { font-size: 0.75rem; padding: 0 8px; }

  #start-menu {
    width: calc(100vw - 16px);
    left: 8px;
    bottom: var(--taskbar-h);
    max-height: 70vh;
    overflow-y: auto;
    border-radius: 12px 12px 0 0;
  }
  .start-apps { grid-template-columns: 1fr; max-height: 200px; }

  #notifications { right: 8px; left: 8px; max-width: none; }
}

@media (max-width: 480px) {
  .desk-icon { width: 60px; }
  .desk-icon-img { width: 36px; height: 36px; font-size: 14px; border-radius: 10px; }
  .desk-icon span { font-size: 0.58rem; }

  #start-menu { padding: 14px; }
  .start-header { margin-bottom: 10px; }
  .start-avatar { width: 36px; height: 36px; font-size: 14px; }
}
