/* ==================== ZENITHOS SYSTEM DESIGN ENGINE ==================== */

:root {
  --global-font: "Rubik", sans-serif;
  --theme-grad: linear-gradient(135deg, #ff3366, #7000ff);
  --glass-bg: rgba(255, 255, 255, 0.12);
  --glass-border: rgba(255, 255, 255, 0.2);
  --dark-glass: rgba(15, 15, 20, 0.65);
  --radius-max: 9999px; /* Absolute rounded design paradigm */
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--global-font);
  user-select: none;
  transition: font-family 0.3s ease;
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"><path d="M4.5 3V18.5L9.2 13.8L15 21L18 19L12.5 12L18.5 11L4.5 3Z" fill="%23ffffff" stroke="%23000000" stroke-width="2" stroke-linejoin="round"/></svg>'), auto;
}

body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: var(--theme-grad);
  background-size: 400% 400%;
  animation: gradientBG 20s ease infinite;
  position: relative;
}

@keyframes gradientBG {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

#desktop {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

/* ==================== WINDOW SYSTEMS ==================== */

.window {
  width: 580px;
  height: 440px;
  background: var(--glass-bg);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  position: absolute;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: opacity 0.35s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
              top 0.4s cubic-bezier(0.16, 1, 0.3, 1), left 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
              width 0.4s cubic-bezier(0.16, 1, 0.3, 1), height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 40px; /* Highly curved system corners */
  z-index: 10;
}

.window.maximized {
  top: 20px !important;
  left: 20px !important;
  width: calc(100% - 40px) !important;
  height: calc(100% - 120px) !important;
}

.window-header {
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  cursor: move;
}

.window-title {
  color: #fff;
  font-size: 1.1rem;
  font-weight: 500;
}

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

.control-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-max);
  border: none;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 12px;
  transition: all 0.3s ease;
}

.control-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.maximize-btn svg {
  width: 10px;
  height: 10px;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.window.maximized .maximize-btn svg {
  transform: rotate(180deg) scale(0.8);
}

.window-content {
  padding: 24px;
  color: #fff;
  flex-grow: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ==================== SYSTEM WIDGET LAYER ==================== */

#widget-grid {
  position: absolute;
  top: 150px;
  right: 30px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  z-index: 2;
  width: 240px;
}

.sys-widget {
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 30px;
  padding: 16px;
  color: #fff;
}

.widget-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: rgba(255,255,255,0.7);
}

.widget-data {
  font-size: 1.1rem;
}

#widget-sticky {
  width: 100%;
  height: 80px;
  background: transparent;
  border: none;
  color: #fff;
  resize: none;
  outline: none;
  font-size: 0.85rem;
}

/* ==================== NAVIGATION DOCKS & BARS ==================== */

#system-clock {
  position: absolute;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 3.5rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 4px 15px rgba(0,0,0,0.25);
  text-align: center;
  pointer-events: none;
  z-index: 1;
}

#system-clock .date {
  font-size: 1.1rem;
  font-weight: 400;
  opacity: 0.8;
  display: block;
  margin-top: 5px;
}

#taskbar {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  height: 64px;
  background: var(--glass-bg);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 10px;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  border-radius: var(--radius-max); /* Perfect pill capsule shape */
}

.taskbar-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-max);
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1.2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.taskbar-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.15) translateY(-4px);
}

/* ==================== CONTROL & DASHBOARD APP MENUS ==================== */

#start-menu {
  position: absolute;
  bottom: 95px;
  left: 50%;
  transform: translateX(-50%) translateY(30px) scale(0.95);
  width: 480px;
  height: 520px;
  background: var(--dark-glass);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 999;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 40px;
}

#start-menu.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0) scale(1);
}

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

.start-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-max);
  background: linear-gradient(45deg, #ff007f, #7f00ff);
}

.start-user-info h3 { color: #fff; font-size: 1rem; }
.start-user-info p { color: rgba(255, 255, 255, 0.5); font-size: 0.8rem; }

.start-apps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 16px 0;
  overflow-y: auto;
  flex-grow: 1;
  padding-right: 4px;
}

.app-icon-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  padding: 12px 6px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.2s ease;
  color: #fff;
  border-radius: 24px;
  font-size: 0.8rem;
  text-align: center;
}

.app-icon-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-3px);
}

.app-dot {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-max);
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  color: #fff;
  font-size: 1.1rem;
}

.start-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
}

/* ==================== SYSTEM INPUT CONTROLS ==================== */

.input-field {
  width: 100%;
  padding: 12px 18px;
  border-radius: var(--radius-max);
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.1);
  color: #fff;
  outline: none;
}

.primary-btn {
  padding: 10px 20px;
  border-radius: var(--radius-max);
  border: none;
  background: #fff;
  color: #000;
  font-weight: 600;
  transition: all 0.2s ease;
}

.primary-btn:hover {
  transform: scale(1.05);
  opacity: 0.9;
}

.option-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ==================== INTERACTIVE SYSTEM MODULE APPS ==================== */

/* Terminal Module */
.term-log {
  flex-grow: 1;
  background: rgba(0,0,0,0.4);
  border-radius: 20px;
  padding: 16px;
  font-family: monospace;
  color: #00ff66;
  font-size: 0.85rem;
  overflow-y: auto;
  max-height: 200px;
}

/* Incremental Clicker Module */
.counter-val {
  font-size: 2.5rem;
  font-weight: 700;
  text-align: center;
  margin: 10px 0;
}

/* Virtual Keyboard Module */
.keyboard-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 4px 0;
}

.key-btn {
  padding: 8px;
  min-width: 32px;
  height: 36px;
  border-radius: var(--radius-max);
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: none;
  font-weight: bold;
  transition: background 0.2s;
}

.key-btn:hover {
  background: rgba(255, 255, 255, 0.35);
}

/* ==================== CONTEXT MENU MODULE ==================== */

#context-menu {
  position: absolute;
  width: 200px;
  background: rgba(18, 18, 24, 0.85);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  display: none;
  flex-direction: column;
  padding: 8px;
  z-index: 1001;
  border-radius: 20px;
}

.context-item {
  padding: 8px 16px;
  color: #fff;
  font-size: 0.85rem;
  transition: all 0.2s ease;
  border-radius: 12px;
}

.context-item:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateX(3px);
}

/* ==================== ALERT NOTIFICATIONS ==================== */

#notification-layer {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 10000;
}

.toast-banner {
  background: rgba(20, 20, 25, 0.85);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 16px 24px;
  width: 280px;
  color: #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  transform: translateX(350px);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 30px;
}

.toast-banner.active {
  transform: translateX(0);
}

.toast-banner #toast-title {
  font-weight: bold;
  display: block;
  font-size: 0.95rem;
  margin-bottom: 4px;
  color: #ff3366;
}

.toast-banner p {
  font-size: 0.85rem;
  opacity: 0.8;
}

/* Custom Rounded Scrollbars */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-max);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-max);
}

/* App Drawer Overlay */
.app-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 10, 15, 0.7);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-drawer-overlay.active {
    display: flex;
    opacity: 1;
}

.drawer-content {
    width: 85%;
    max-width: 900px;
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.app-drawer-overlay.active .drawer-content {
    transform: scale(1);
}

.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 40px;
    margin-top: 50px;
    padding: 20px;
}

.app-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    font-family: 'Righteous', sans-serif; /* Applied Requested Font */
    color: white;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.app-item:hover .purple-btn {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 15px 30px rgba(112, 0, 255, 0.4);
}

/* Purple Button Styling */
.purple-btn {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #7000ff, #440099);
    border-radius: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 28px;
    margin-bottom: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.search-bar input {
    width: 100%;
    padding: 15px 25px;
    border-radius: 50px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-family: 'Rubik', sans-serif;
    font-size: 1.1rem;
    outline: none;
    border: 1px solid rgba(255,255,255,0.1);
}
