@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

:root {
  --metallic-grey-100: #e0e0e0;
  --metallic-grey-200: #b3b3b3;
  --metallic-grey-400: #808080;
  --metallic-grey-600: #4d4d4d;
  --metallic-grey-800: #2d2d2d;
  --metallic-grey-900: #1a1a1a;
  
  --bg-color: #050508;
  --text-primary: #ffffff;
  --text-secondary: var(--metallic-grey-200);
  
  --glass-bg: rgba(26, 26, 26, 0.4);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-highlight: rgba(255, 255, 255, 0.05);
  
  --window-header: linear-gradient(180deg, var(--metallic-grey-600) 0%, var(--metallic-grey-800) 100%);
  --window-header-border: var(--metallic-grey-400);
  --backdrop-blur: 16px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  /* Deep space starry background pattern */
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 85% 30%, rgba(255, 255, 255, 0.05) 0%, transparent 50%),
    url("data:image/svg+xml,%3Csvg width='100' height='100' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='10' cy='10' r='1' fill='rgba%28255,255,255,0.3%29'/%3E%3Ccircle cx='50' cy='80' r='0.5' fill='rgba%28255,255,255,0.2%29'/%3E%3Ccircle cx='80' cy='30' r='1.5' fill='rgba%28255,255,255,0.1%29'/%3E%3C/svg%3E");
  background-attachment: fixed;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Glassmorphic Utilities */

.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--backdrop-blur));
  -webkit-backdrop-filter: blur(var(--backdrop-blur));
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37), inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
}

.heading-font {
  font-family: 'Space Grotesk', sans-serif;
}

/* Scrollbar styling for that computer interface feel */

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--metallic-grey-900);
}

::-webkit-scrollbar-thumb {
  background: var(--metallic-grey-600);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--metallic-grey-400);
}

/* Window UI Interactions */

.window-btn-icon {
  transition: opacity 0.2s;
}

.window-handle:hover .window-btn-icon {
  opacity: 1 !important;
}

/* Taskbar */

.taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 48px;
  background: rgba(26, 26, 26, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 8px;
  z-index: 1000;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.5);
}

.taskbar-item {
  height: 32px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

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

.taskbar-item.focused {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
}

/* Desktop container */

.desktop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 48px; /* leave space for taskbar */
  overflow: hidden;
}

.background-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.05;
  filter: blur(4px);
  pointer-events: none;
  z-index: 1;
}

/* Shooting Stars */

.shooting-star-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.shooting-star {
  position: absolute;
  width: var(--length, 150px);
  height: 1px;
  background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,1));
  filter: drop-shadow(0 0 4px rgba(255,255,255,1));
  opacity: 0;
}

.shooting-star::before {
  content: '';
  position: absolute;
  top: -1px;
  right: 0;
  width: 3px;
  height: 3px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 10px 2px rgba(255,255,255,0.8);
}

@keyframes shoot {
  0% {
    transform: rotate(var(--angle, 215deg)) translateX(0) scale(0);
    opacity: 0;
  }
  2% {
    opacity: 1;
  }
  15% {
    opacity: 0;
  }
  20% {
    transform: rotate(var(--angle, 215deg)) translateX(200vw) scale(1);
    opacity: 0;
  }
  100% {
    transform: rotate(var(--angle, 215deg)) translateX(200vw) scale(1);
    opacity: 0;
  }
}

.star-1 {
  top: 10%;
  right: 10%;
  --angle: 205deg;
  --length: 120px;
  animation: shoot 10s linear infinite;
  animation-delay: 2s;
}

.star-2 {
  top: 50%;
  right: -5%;
  --angle: 215deg;
  --length: 220px;
  animation: shoot 14s linear infinite;
  animation-delay: 7s;
}

.star-3 {
  top: -10%;
  left: 40%;
  --angle: 225deg;
  --length: 80px;
  animation: shoot 18s linear infinite;
  animation-delay: 4s;
}

.star-4 {
  top: 25%;
  left: 10%;
  --angle: 235deg;
  --length: 180px;
  animation: shoot 12s linear infinite;
  animation-delay: 9s;
}

.star-5 {
  top: 75%;
  right: 20%;
  --angle: 195deg;
  --length: 250px;
  animation: shoot 16s linear infinite;
  animation-delay: 1s;
}

/* Mobile Optimizations */

.window-panel {
  width: 450px;
  max-width: 100vw;
}

.taskbar-items-container::-webkit-scrollbar {
  display: none;
}

@media (max-width: 768px) {
  .window-panel {
    width: calc(100vw - 20px) !important;
  }
  
  .system-tray-icons {
    display: none !important;
  }
  
  .desktop-icon {
    transform: scale(0.9);
  }
}

/* Theme presets */

.theme-nebula {
  --bg-color: #050508;
  --text-primary: #ffffff;
  --text-secondary: var(--metallic-grey-200);
  --glass-bg: rgba(26, 26, 26, 0.4);
  --window-header: linear-gradient(180deg, var(--metallic-grey-600) 0%, var(--metallic-grey-800) 100%);
  --window-header-border: var(--metallic-grey-400);
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 85% 30%, rgba(255, 255, 255, 0.05) 0%, transparent 50%),
    url("data:image/svg+xml,%3Csvg width='100' height='100' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='10' cy='10' r='1' fill='rgba%28255,255,255,0.3%29'/%3E%3Ccircle cx='50' cy='80' r='0.5' fill='rgba%28255,255,255,0.2%29'/%3E%3Ccircle cx='80' cy='30' r='1.5' fill='rgba%28255,255,255,0.1%29'/%3E%3C/svg%3E") !important;
}

.theme-neon {
  --bg-color: #0c0216;
  --text-primary: #bf55ec;
  --text-secondary: #00e6ff;
  --glass-bg: rgba(18, 5, 32, 0.55);
  --window-header: linear-gradient(180deg, #8a2be2 0%, #4b0082 100%);
  --window-header-border: rgba(138, 43, 226, 0.4);
  background-image: 
    radial-gradient(circle at 50% 50%, rgba(138, 43, 226, 0.18) 0%, transparent 70%),
    url("data:image/svg+xml,%3Csvg width='40' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M 0 0 L 40 0 L 40 40 L 0 40 Z' fill='none' stroke='rgba%28138,43,226,0.06%29' stroke-width='0.5'/%3E%3C/svg%3E") !important;
}

.theme-obsidian {
  --bg-color: #050505;
  --text-primary: #c8c8c8;
  --text-secondary: #6a6a6e;
  --glass-bg: rgba(10, 10, 12, 0.82);
  --glass-border: rgba(255, 255, 255, 0.04);
  --window-header: linear-gradient(180deg, #18181a 0%, #0a0a0c 100%);
  --window-header-border: rgba(255, 255, 255, 0.05);
  /* Carbon fiber weave pattern + subtle warm vignette */
  background-image:
    radial-gradient(ellipse at 20% 80%, rgba(180, 120, 60, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(100, 140, 200, 0.03) 0%, transparent 50%),
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.012) 0px,
      rgba(255, 255, 255, 0.012) 1px,
      transparent 1px,
      transparent 4px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.012) 0px,
      rgba(255, 255, 255, 0.012) 1px,
      transparent 1px,
      transparent 4px
    ) !important;
  background-size: 100% 100%, 100% 100%, 4px 4px, 4px 4px !important;
  background-color: #050505 !important;
}

/* Obsidian — subtle warm ambient pulse on the desktop */

.theme-obsidian .desktop::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 60vw;
  height: 60vh;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse, rgba(200, 160, 100, 0.025) 0%, transparent 70%);
  animation: obsidian-pulse 12s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
}

@keyframes obsidian-pulse {
  0% { opacity: 0.4; transform: translate(-50%, -50%) scale(0.9); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
}

/* Obsidian — refined glass panels with frosted edge highlight */

.theme-obsidian .glass-panel {
  box-shadow:
    0 8px 32px 0 rgba(0, 0, 0, 0.6),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.03),
    inset 0 -1px 0 0 rgba(0, 0, 0, 0.4);
}

/* Obsidian — taskbar gets a sharper, more premium edge */

.theme-obsidian .taskbar {
  background: rgba(8, 8, 10, 0.85);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.7);
}

.theme-matrix {
  --bg-color: #020602;
  --text-primary: #33ff33;
  --text-secondary: #00bb00;
  --glass-bg: rgba(2, 10, 2, 0.7);
  --window-header: linear-gradient(180deg, #004400 0%, #011401 100%);
  --window-header-border: rgba(51, 255, 51, 0.3);
  background-image: 
    linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), 
    radial-gradient(circle at 50% 50%, rgba(51, 255, 51, 0.08) 0%, transparent 60%),
    url("data:image/svg+xml,%3Csvg width='100' height='100' xmlns='http://www.w3.org/2000/svg'%3E%3Ctext x='10' y='20' fill='rgba%2851,255,51,0.03%29' font-family='monospace' font-size='10'%3E10101%3C/text%3E%3Ctext x='50' y='70' fill='rgba%2851,255,51,0.02%29' font-family='monospace' font-size='10'%3E010%3C/text%3E%3Ctext x='80' y='40' fill='rgba%2851,255,51,0.03%29' font-family='monospace' font-size='10'%3E11%3C/text%3E%3C/svg%3E") !important;
  background-size: 100% 4px, 100% 100%, 100px 100px !important;
}

/* CRT Green matrix styling overrides */

.theme-matrix, .theme-matrix * {
  text-shadow: 0 0 3px rgba(51, 255, 51, 0.3) !important;
}
