/* Modern Custom Theme Variables */
:root {
  /* Light Theme - Vibrant Modern Colors */
  --light-gradient-1: #667eea;
  --light-gradient-2: #764ba2;
  --light-gradient-3: #f093fb;
  --light-bg-primary: #fafbff;
  --light-bg-secondary: #f5f7ff;
  --light-surface: rgba(255, 255, 255, 0.9);
  --light-surface-hover: rgba(255, 255, 255, 0.95);
  --light-text-primary: #1a1d3a;
  --light-text-secondary: #64748b;
  --light-border: rgba(148, 163, 184, 0.2);
  --light-accent: #667eea;
  --light-accent-hover: #5a67d8;
  --light-shadow-sm: 0 2px 8px rgba(102, 126, 234, 0.1);
  --light-shadow-md: 0 4px 20px rgba(102, 126, 234, 0.15);
  --light-shadow-lg: 0 10px 40px rgba(102, 126, 234, 0.2);
  --light-glow: 0 0 30px rgba(102, 126, 234, 0.3);

  /* Dark Theme - Deep Modern Colors */
  --dark-gradient-1: #0f0c29;
  --dark-gradient-2: #302b63;
  --dark-gradient-3: #24243e;
  --dark-bg-primary: #0a0b1e;
  --dark-bg-secondary: #151729;
  --dark-surface: rgba(30, 32, 54, 0.9);
  --dark-surface-hover: rgba(40, 42, 66, 0.95);
  --dark-text-primary: #e4e6f1;
  --dark-text-secondary: #94a3b8;
  --dark-border: rgba(71, 85, 105, 0.4);
  --dark-accent: #818cf8;
  --dark-accent-hover: #6366f1;
  --dark-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --dark-shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
  --dark-shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.5);
  --dark-glow: 0 0 30px rgba(129, 140, 248, 0.3);
}

/* Base Styling */
* {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family: "Plus Jakarta Sans", sans-serif;
  background: linear-gradient(
    135deg,
    var(--light-gradient-1) 0%,
    var(--light-gradient-2) 50%,
    var(--light-gradient-3) 100%
  );
  background-attachment: fixed;
  color: var(--light-text-primary);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Animated Background Orbs */
body::before,
body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.5;
  animation: float 20s infinite ease-in-out;
  pointer-events: none;
}

body::before {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #667eea 0%, transparent 70%);
  top: -200px;
  left: -200px;
}

body::after {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #f093fb 0%, transparent 70%);
  bottom: -300px;
  right: -300px;
  animation-delay: -10s;
}

/* Dark Theme Body */
html.dark body {
  background: linear-gradient(
    135deg,
    var(--dark-gradient-1) 0%,
    var(--dark-gradient-2) 50%,
    var(--dark-gradient-3) 100%
  );
  color: var(--dark-text-primary);
}

html.dark body::before {
  background: radial-gradient(circle, #302b63 0%, transparent 70%);
}

html.dark body::after {
  background: radial-gradient(circle, #24243e 0%, transparent 70%);
}

/* Float Animation */
@keyframes float {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(30px, -30px) scale(1.1);
  }
  66% {
    transform: translate(-20px, 20px) scale(0.9);
  }
}

/* Modern Glass Effect */
.glass {
  background: var(--light-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--light-border);
  box-shadow: var(--light-shadow-md);
}

html.dark .glass {
  background: var(--dark-surface);
  border: 1px solid var(--dark-border);
  box-shadow: var(--dark-shadow-md);
}

/* Hover Glass Effect */
.glass-hover {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-hover:hover {
  background: var(--light-surface-hover);
  transform: translateY(-2px);
  box-shadow: var(--light-shadow-lg);
}

html.dark .glass-hover:hover {
  background: var(--dark-surface-hover);
  box-shadow: var(--dark-shadow-lg);
}

/* App Icon Modern Style */
.app-card {
  position: relative;
  overflow: hidden;
}

.app-card::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  transform: rotate(45deg);
  transition: all 0.5s;
  opacity: 0;
}

.app-card:hover::before {
  animation: shine 0.5s ease-in-out;
}

@keyframes shine {
  0% {
    transform: translateX(-100%) translateY(-100%) rotate(45deg);
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translateX(100%) translateY(100%) rotate(45deg);
    opacity: 0;
  }
}

/* Icon Gradient Backgrounds */
.icon-gradient-1 {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.icon-gradient-2 {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.icon-gradient-3 {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.icon-gradient-4 {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.icon-gradient-5 {
  background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
}

.icon-gradient-6 {
  background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.icon-gradient-7 {
  background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
}

.icon-gradient-8 {
  background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
}

/* Pulse Animation for Notifications */
@keyframes pulse-ring {
  0% {
    transform: scale(0.5);
    opacity: 1;
  }
  80%,
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

.pulse-dot {
  position: relative;
}

.pulse-dot::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 50%;
  background: currentColor;
  animation: pulse-ring 2s infinite;
}

/* Modern Scrollbar */
.custom-scrollbar {
  scrollbar-width: thin;
  scrollbar-color: rgba(102, 126, 234, 0.5) rgba(102, 126, 234, 0.1);
}

.custom-scrollbar::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: rgba(102, 126, 234, 0.1);
  border-radius: 10px;
  margin: 10px 0;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(102, 126, 234, 0.5);
  border-radius: 10px;
  border: 3px solid transparent;
  background-clip: padding-box;
  transition: all 0.3s ease;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: rgba(102, 126, 234, 0.8);
  background-clip: padding-box;
}

/* Dark theme scrollbar */
html.dark .custom-scrollbar {
  scrollbar-color: rgba(129, 140, 248, 0.5) rgba(129, 140, 248, 0.1);
}

html.dark .custom-scrollbar::-webkit-scrollbar-track {
  background: rgba(129, 140, 248, 0.1);
}

html.dark .custom-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(129, 140, 248, 0.5);
}

html.dark .custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: rgba(129, 140, 248, 0.8);
}

/* Scrollbar corner style */
.custom-scrollbar::-webkit-scrollbar-corner,
.show-scrollbar::-webkit-scrollbar-corner {
  background: transparent;
}

/* Smooth scroll behavior */
.custom-scrollbar,
.show-scrollbar {
  scroll-behavior: smooth;
}

/* Firefox scrollbar support */
@supports (scrollbar-width: thin) {
  .custom-scrollbar {
    scrollbar-width: thin;
  }

  .show-scrollbar {
    scrollbar-width: auto;
    scrollbar-color: rgba(102, 126, 234, 0.5) rgba(102, 126, 234, 0.1);
  }

  html.dark .show-scrollbar {
    scrollbar-color: rgba(129, 140, 248, 0.5) rgba(129, 140, 248, 0.1);
  }
}

/* Text Colors */
.text-primary {
  color: var(--light-text-primary);
}

html.dark .text-primary {
  color: var(--dark-text-primary);
}

.text-secondary {
  color: var(--light-text-secondary);
}

html.dark .text-secondary {
  color: var(--dark-text-secondary);
}

/* Modern Button Styles */
.btn-primary {
  background: linear-gradient(
    135deg,
    var(--light-accent) 0%,
    var(--light-gradient-2) 100%
  );
  color: white;
  font-weight: 600;
  box-shadow: var(--light-shadow-md);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.5s;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--light-glow);
}

html.dark .btn-primary {
  background: linear-gradient(
    135deg,
    var(--dark-accent) 0%,
    var(--dark-gradient-2) 100%
  );
  box-shadow: var(--dark-shadow-md);
}

html.dark .btn-primary:hover {
  box-shadow: var(--dark-glow);
}

/* Search Input Modern Style */
.search-input {
  background: var(--light-surface);
  border: 2px solid transparent;
  background-clip: padding-box;
  position: relative;
}

.search-input:focus {
  border-color: var(--light-accent);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

html.dark .search-input {
  background: var(--dark-surface);
}

html.dark .search-input:focus {
  border-color: var(--dark-accent);
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.1);
}

/* Notification Dot Animation */
.notification-dot {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

/* Scrollbar fade-in animation */
@keyframes fadeInScrollbar {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.show-scrollbar {
  position: relative;
}

.show-scrollbar::-webkit-scrollbar-thumb {
  animation: fadeInScrollbar 0.5s ease-in-out;
  position: relative;
}

/* Add pulse effect on scrollbar when hovering content */
.show-scrollbar:hover::-webkit-scrollbar-thumb {
  animation: scrollbarPulse 2s ease-in-out infinite;
}

@keyframes scrollbarPulse {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

/* System Tray Style */
.system-tray {
  background: var(--light-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--light-border);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

html.dark .system-tray {
  background: var(--dark-surface);
  border-top: 1px solid var(--dark-border);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
}

/* Always show scrollbar for better UX */
.show-scrollbar {
  overflow-y: scroll !important;
}

.show-scrollbar::-webkit-scrollbar {
  width: 12px;
}

.show-scrollbar::-webkit-scrollbar-track {
  background: rgba(102, 126, 234, 0.05);
  border-radius: 10px;
  margin: 10px 0;
  border: 1px solid rgba(102, 126, 234, 0.1);
  backdrop-filter: blur(10px);
}

.show-scrollbar::-webkit-scrollbar-thumb {
  background: linear-gradient(
    180deg,
    rgba(102, 126, 234, 0.3) 0%,
    rgba(102, 126, 234, 0.5) 100%
  );
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
  box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.show-scrollbar::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(
    180deg,
    rgba(102, 126, 234, 0.5) 0%,
    rgba(102, 126, 234, 0.7) 100%
  );
  background-clip: padding-box;
  box-shadow: 0 0 8px rgba(102, 126, 234, 0.4);
}

.show-scrollbar::-webkit-scrollbar-thumb:active {
  background: linear-gradient(
    180deg,
    rgba(102, 126, 234, 0.6) 0%,
    rgba(102, 126, 234, 0.8) 100%
  );
  background-clip: padding-box;
}

html.dark .show-scrollbar::-webkit-scrollbar-track {
  background: rgba(129, 140, 248, 0.05);
  border: 1px solid rgba(129, 140, 248, 0.1);
  backdrop-filter: blur(10px);
}

html.dark .show-scrollbar::-webkit-scrollbar-thumb {
  background: linear-gradient(
    180deg,
    rgba(129, 140, 248, 0.3) 0%,
    rgba(129, 140, 248, 0.5) 100%
  );
  box-shadow: inset 0 0 3px rgba(255, 255, 255, 0.1);
}

html.dark .show-scrollbar::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(
    180deg,
    rgba(129, 140, 248, 0.5) 0%,
    rgba(129, 140, 248, 0.7) 100%
  );
  box-shadow: 0 0 8px rgba(129, 140, 248, 0.4);
}

html.dark .show-scrollbar::-webkit-scrollbar-thumb:active {
  background: linear-gradient(
    180deg,
    rgba(129, 140, 248, 0.6) 0%,
    rgba(129, 140, 248, 0.8) 100%
  );
}

/* Windows-like Application Styles */
.desktop-app-window {
  position: fixed;
  background: var(--light-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--light-border);
  border-radius: 12px;
  box-shadow: var(--light-shadow-lg);
  overflow: hidden;
  min-width: 400px;
  min-height: 300px;
  resize: both;
  z-index: 1000;
}

html.dark .desktop-app-window {
  background: var(--dark-surface);
  border: 1px solid var(--dark-border);
  box-shadow: var(--dark-shadow-lg);
}

.window-titlebar {
  background: var(--light-surface);
  border-bottom: 1px solid var(--light-border);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: move;
  user-select: none;
}

html.dark .window-titlebar {
  background: var(--dark-surface);
  border-bottom: 1px solid var(--dark-border);
}

.window-title {
  font-weight: 600;
  color: var(--light-text-primary);
  font-size: 14px;
}

html.dark .window-title {
  color: var(--dark-text-primary);
}

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

.window-control {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.window-control:hover {
  transform: scale(1.1);
}

.window-control.close {
  background: #ff5f57;
}

.window-control.minimize {
  background: #ffbd2e;
}

.window-control.maximize {
  background: #28ca42;
}

.window-content {
  height: calc(100% - 49px);
  overflow: auto;
  padding: 20px;
  background: transparent;
}

.taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--light-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--light-border);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  z-index: 2000;
}

html.dark .taskbar {
  background: var(--dark-surface);
  border-top: 1px solid var(--dark-border);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
}

.taskbar-item {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  background: var(--light-surface);
  border: 1px solid var(--light-border);
}

html.dark .taskbar-item {
  background: var(--dark-surface);
  border: 1px solid var(--dark-border);
}

.taskbar-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--light-shadow-md);
}

html.dark .taskbar-item:hover {
  box-shadow: var(--dark-shadow-md);
}

.taskbar-item.active::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  background: var(--light-accent);
  border-radius: 50%;
}

html.dark .taskbar-item.active::after {
  background: var(--dark-accent);
}

.desktop-icon {
  position: fixed;
  width: 80px;
  height: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 8px;
  border-radius: 12px;
  transition: all 0.3s ease;
  user-select: none;
}

.desktop-icon:hover {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.desktop-icon-image {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
  font-size: 24px;
  color: white;
}

.desktop-icon-label {
  font-size: 12px;
  font-weight: 500;
  color: white;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  line-height: 1.2;
}

.desktop-icons-container {
  position: fixed;
  top: 100px;
  left: 30px;
  display: grid;
  grid-template-columns: repeat(auto-fill, 100px);
  gap: 20px;
  z-index: 100;
}

.window-focused {
  z-index: 1001 !important;
}

.window-minimized {
  transform: scale(0.1);
  opacity: 0;
  pointer-events: none;
}