/* ==========================================================================
   Premium Glassmorphic Dashboard Stylesheet (macOS & iOS Redesign)
   ========================================================================== */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

/* Reset and Core Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Ease transitions */
  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: all 0.2s ease;
}

/* Theme Configurations */
body.theme-midnight-nebula {
  --bg-color: #080c14;
  --blob-1: #4f46e5;
  --blob-2: #c084fc;
  --blob-3: #db2777;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --card-bg: rgba(15, 23, 42, 0.4);
  --card-border: rgba(255, 255, 255, 0.06);
  --card-border-hover: rgba(168, 85, 247, 0.4);
  --widget-bg: rgba(15, 23, 42, 0.35);
  --input-bg: rgba(15, 23, 42, 0.25);
  --badge-glow: rgba(168, 85, 247, 0.15);
}

body.theme-aurora-borealis {
  --bg-color: #021712;
  --blob-1: #059669;
  --blob-2: #0891b2;
  --blob-3: #2563eb;
  --text-primary: #f0fdf4;
  --text-secondary: #94a3b8;
  --card-bg: rgba(2, 28, 22, 0.4);
  --card-border: rgba(255, 255, 255, 0.06);
  --card-border-hover: rgba(16, 185, 129, 0.4);
  --widget-bg: rgba(2, 28, 22, 0.35);
  --input-bg: rgba(2, 28, 22, 0.25);
  --badge-glow: rgba(16, 185, 129, 0.15);
}

body.theme-solar-eclipse {
  --bg-color: #140b03;
  --blob-1: #d97706;
  --blob-2: #dc2626;
  --blob-3: #7c3aed;
  --text-primary: #fffbeb;
  --text-secondary: #a1a1aa;
  --card-bg: rgba(23, 11, 3, 0.4);
  --card-border: rgba(255, 255, 255, 0.06);
  --card-border-hover: rgba(245, 158, 11, 0.4);
  --widget-bg: rgba(23, 11, 3, 0.35);
  --input-bg: rgba(23, 11, 3, 0.25);
  --badge-glow: rgba(245, 158, 11, 0.15);
}

body.theme-cyberpunk {
  --bg-color: #0a0110;
  --blob-1: #ff007f;
  --blob-2: #00f0ff;
  --blob-3: #7000ff;
  --text-primary: #ffffff;
  --text-secondary: #a5b4fc;
  --card-bg: rgba(10, 1, 16, 0.4);
  --card-border: rgba(255, 255, 255, 0.06);
  --card-border-hover: rgba(255, 0, 127, 0.4);
  --widget-bg: rgba(10, 1, 16, 0.35);
  --input-bg: rgba(10, 1, 16, 0.25);
  --badge-glow: rgba(255, 0, 127, 0.15);
}

/* Global Styles */
body {
  font-family: var(--font-body);
  background-color: var(--bg-color);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  transition: background-color 0.8s ease, color 0.4s ease;
  margin-top: 50px; /* Spacing to start below the fixed top menu bar */
}

a {
  text-decoration: none;
  color: inherit;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Interactive Background Blobs */
.bg-blobs {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.45;
  mix-blend-mode: screen;
  animation: float-blob 25s infinite alternate ease-in-out;
  transition: background 0.8s ease;
}

.blob-1 {
  width: 600px;
  height: 600px;
  background: var(--blob-1);
  top: -15%;
  left: -10%;
  animation-duration: 30s;
}

.blob-2 {
  width: 700px;
  height: 700px;
  background: var(--blob-2);
  bottom: -20%;
  right: -10%;
  animation-duration: 35s;
  animation-delay: -7s;
}

.blob-3 {
  width: 500px;
  height: 500px;
  background: var(--blob-3);
  top: 35%;
  left: 45%;
  transform: translate(-50%, -50%);
  animation-duration: 22s;
  animation-delay: -12s;
}

@keyframes float-blob {
  0% {
    transform: translate(0px, 0px) scale(1);
  }
  50% {
    transform: translate(80px, -100px) scale(1.1);
  }
  100% {
    transform: translate(-60px, 60px) scale(0.9);
  }
}

/* ==========================================================================
   macOS Top Menu Bar Styling
   ========================================================================== */
.mac-menu-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 30px;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 9999;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  font-family: var(--font-body);
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--text-primary);
  user-select: none;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.1);
}

.mac-menu-left,
.mac-menu-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mac-menu-item {
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.mac-menu-item:hover {
  opacity: 1;
}

.mac-menu-item.apple-logo {
  font-size: 0.95rem;
}

.mac-menu-item.active-app {
  font-weight: 600;
}

/* Dashboard Container */
.dashboard-container {
  max-width: 1650px;
  width: 92%;
  margin: 0 auto;
  padding: 40px 24px 160px 24px; /* Adjusted padding since body has margin-top: 50px */
}

/* Header Welcome */
.dashboard-header {
  margin-bottom: 40px;
  animation: fadeInDown 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.greeting-container h1 {
  font-family: var(--font-display);
  font-size: 2.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
  background: linear-gradient(135deg, #ffffff 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.greeting-container .subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-weight: 400;
}

/* Layout Grid structure */
.dashboard-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: start;
}

@media (min-width: 1024px) {
  .dashboard-layout {
    grid-template-columns: 2.3fr 1fr;
  }
}

/* Search bar styling */
.search-container {
  position: relative;
  margin-bottom: 28px;
  animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

.search-icon {
  position: absolute;
  left: 22px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  font-size: 1.1rem;
  pointer-events: none;
  transition: var(--transition-fast);
}

#search-input {
  width: 100%;
  padding: 18px 24px 18px 58px;
  background: var(--input-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  color: var(--text-primary);
  font-size: 1.05rem;
  font-family: var(--font-body);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: var(--transition-smooth);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

#search-input::placeholder {
  color: var(--text-secondary);
  opacity: 0.6;
}

#search-input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.03), 0 10px 30px rgba(0, 0, 0, 0.2);
}

#search-input:focus + .search-icon {
  color: var(--text-primary);
  transform: translateY(-50%) scale(1.05);
}

/* Application Cards Grid */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
  animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

/* Grid Column Overrides */
.grid-cols-2 { grid-template-columns: repeat(2, 1fr) !important; }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr) !important; }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr) !important; }

/* Grid Spacing (Gap) Overrides */
.gap-tight { gap: 14px !important; }
.gap-comfortable { gap: 24px !important; }
.gap-spacious { gap: 36px !important; }

/* Individual App Card */
.app-card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 250px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: var(--transition-smooth);
  overflow: visible; /* Changed to visible to let edit/delete badges sit on border bounds */
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.15);
  cursor: pointer;
}

.app-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: inherit;
  background: radial-gradient(800px circle at var(--mouse-x, 0) var(--mouse-y, 0), rgba(255, 255, 255, 0.06), transparent 40%);
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.app-card:hover::before {
  opacity: 1;
}

.app-card:hover, .app-card.keyboard-active {
  transform: translateY(-6px);
  border-color: rgba(var(--accent-color-rgb), 0.4);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.3),
              0 0 25px 0 rgba(var(--accent-color-rgb), 0.2);
}

/* Card Glow Effect Behind Content */
.card-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(var(--accent-color-rgb), 0.2) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  z-index: 0;
  pointer-events: none;
  transition: var(--transition-smooth);
  opacity: 0.5;
}

.app-card:hover .card-glow, .app-card.keyboard-active .card-glow {
  opacity: 0.9;
  transform: translate(-50%, -50%) scale(1.3);
}

/* Card Header elements */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 2;
  position: relative;
}

/* Squircle Generic Icons & Logo Containers */
.app-logo-container,
.app-icon-squircle {
  width: 52px;
  height: 52px;
  border-radius: 22%; /* 22% Apple iOS shape */
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: linear-gradient(135deg, rgba(var(--accent-color-rgb), 0.3), rgba(var(--accent-color-rgb), 0.15));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  color: rgb(var(--accent-color-rgb));
  transition: var(--transition-smooth);
}

.app-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.app-fallback-logo {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  border-radius: inherit;
  font-weight: 700;
}

.app-logo-container i,
.app-logo-container svg,
.app-icon-squircle i,
.app-icon-squircle svg {
  font-size: 1.45rem;
  color: rgb(var(--accent-color-rgb));
  transition: var(--transition-smooth);
}

/* White glyph styling on hover/active states */
.app-card:hover .app-logo-container,
.app-card.keyboard-active .app-logo-container,
.app-card:hover .app-icon-squircle,
.app-card.keyboard-active .app-icon-squircle {
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 20px rgba(var(--accent-color-rgb), 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.app-card:hover .app-logo-container i,
.app-card.keyboard-active .app-logo-container i,
.app-card:hover .app-logo-container svg,
.app-card.keyboard-active .app-logo-container svg,
.app-card:hover .app-icon-squircle i,
.app-card.keyboard-active .app-icon-squircle i,
.app-card:hover .app-icon-squircle svg,
.app-card.keyboard-active .app-icon-squircle svg {
  color: #ffffff;
  transform: scale(1.05);
}

/* Orbit Inline SVG specific container */
.app-logo-svg-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.3), rgba(6, 182, 212, 0.15));
  color: #22d3ee;
  padding: 8px;
}

.app-icon-svg {
  width: 100%;
  height: 100%;
}

.card-action-icon {
  color: var(--text-secondary);
  font-size: 0.95rem;
  opacity: 0.5;
  transition: var(--transition-smooth);
}

.app-card:hover .card-action-icon, .app-card.keyboard-active .card-action-icon {
  opacity: 1;
  color: rgb(var(--accent-color-rgb));
  transform: translate(3px, -3px) scale(1.05);
}

/* Card Body Content */
.card-content {
  margin-top: 24px;
  margin-bottom: 24px;
  z-index: 2;
  position: relative;
}

.app-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.app-description {
  font-size: 0.925rem;
  color: var(--text-secondary);
  line-height: 1.55;
  font-weight: 400;
}

/* Card Footer elements */
.card-footer {
  z-index: 2;
  position: relative;
  display: flex;
}

.app-accent-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 0.775rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: var(--transition-smooth);
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-card:hover .app-accent-badge, .app-card.keyboard-active .app-accent-badge {
  box-shadow: 0 4px 12px var(--badge-glow);
}

/* Card Scale/Sizing Overrides */
.card-compact {
  min-height: 190px !important;
  padding: 18px !important;
}
.card-compact .card-content {
  margin-top: 14px !important;
  margin-bottom: 14px !important;
}
.card-compact .app-title {
  font-size: 1.15rem !important;
}
.card-compact .app-description {
  font-size: 0.85rem !important;
  line-height: 1.4 !important;
}

.card-expanded {
  min-height: 290px !important;
  padding: 34px !important;
}
.card-expanded .app-title {
  font-size: 1.45rem !important;
}
.card-expanded .app-description {
  font-size: 1.0rem !important;
}

/* Search empty state styles */
.no-results-card {
  display: none;
  grid-column: 1 / -1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--text-secondary);
  text-align: center;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
  animation: fadeIn 0.4s ease;
}

.no-results-card i {
  font-size: 3rem;
  margin-bottom: 18px;
  color: var(--text-secondary);
  opacity: 0.4;
}

.no-results-card h4 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.no-results-card p {
  font-size: 0.95rem;
  max-width: 400px;
  line-height: 1.5;
}

/* ==========================================================================
   Wiggle Edit State & Badges
   ========================================================================== */
@keyframes wiggle {
  0% {
    transform: rotate(-0.5deg) translate(-0.5px, 0.5px);
  }
  100% {
    transform: rotate(0.5deg) translate(0.5px, -0.5px);
  }
}

.edit-active .app-card:not(.add-card) {
  animation: wiggle 0.3s ease-in-out infinite alternate;
  cursor: default;
}

/* Disable hover offset in edit mode */
.edit-active .app-card:not(.add-card):hover {
  transform: none;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.15);
}

.delete-badge,
.edit-badge {
  position: absolute;
  top: -8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  z-index: 10;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  pointer-events: auto;
  opacity: 0;
  transform: scale(0);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease, background-color 0.2s ease;
}

.delete-badge {
  left: -8px;
  background-color: #ff3b30; /* Apple/iOS Red */
}

.delete-badge:hover {
  background-color: #ff453a;
  transform: scale(1.15);
}

.edit-badge {
  right: -8px;
  background-color: #007aff; /* Apple/iOS Blue */
}

.edit-badge:hover {
  background-color: #0a84ff;
  transform: scale(1.15);
}

/* Display edit and delete badges in edit mode */
.edit-active .app-card:not(.add-card) .delete-badge,
.edit-active .app-card:not(.add-card) .edit-badge {
  opacity: 1;
  transform: scale(1);
}

/* Add App Card styling */
.app-card.add-card {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 250px;
  cursor: pointer;
  box-shadow: none;
  transition: var(--transition-smooth);
}

.app-card.add-card:hover {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.add-card-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary);
  text-align: center;
}

.add-card-icon {
  font-size: 1.75rem;
  width: 52px;
  height: 52px;
  border-radius: 22%;
  border: 2px dashed rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
  color: var(--text-secondary);
}

.app-card.add-card:hover .add-card-icon {
  border-color: var(--text-primary);
  color: var(--text-primary);
  transform: scale(1.05);
}

.app-card.add-card:hover .add-card-title {
  color: var(--text-primary);
}

.add-card-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  transition: var(--transition-smooth);
}

/* ==========================================================================
   Glassmorphic Editor Modal Styling
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 99999; /* Higher than menu bar & dock */
  display: none; /* Flex when open */
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: fadeIn 0.25s ease-out;
}

.modal-container {
  background: rgba(25, 25, 35, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  width: 90%;
  max-width: 480px;
  padding: 30px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  color: var(--text-primary);
  transform-origin: center;
  animation: scaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 14px;
}

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.15rem;
  cursor: pointer;
  opacity: 0.6;
  transition: var(--transition-fast);
}

.modal-close-btn:hover {
  opacity: 1;
  color: var(--text-primary);
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Translucent macOS inputs */
.form-group input[type="text"],
.form-group input[type="url"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group select option {
  background-color: #1b1b26;
  color: #ffffff;
}

.form-group input[type="text"]:focus,
.form-group input[type="url"]:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.03);
}

/* Translucent Color Selector */
.color-selector-wrapper {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 8px 14px;
}

.color-selector-wrapper label {
  margin: 0;
}

.color-dot-input {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background: none;
  outline: none;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.color-dot-input::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-dot-input::-webkit-color-swatch {
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.color-dot-input:hover {
  transform: scale(1.1);
}

/* Actions with scale hover transitions */
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

.btn-macos {
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease;
}

.btn-macos:hover {
  transform: scale(1.03);
}

.btn-macos:active {
  transform: scale(0.97);
}

.btn-macos-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.btn-macos-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

.btn-macos-primary {
  background: #007aff; /* macOS Blue */
  border: none;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.btn-macos-primary:hover {
  background: #0a84ff;
  box-shadow: 0 6px 16px rgba(0, 122, 255, 0.4);
}

@keyframes scaleIn {
  from {
    transform: scale(0.95);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* ==========================================================================
   Sidebar and Widget styling (iOS Desktop Redesign)
   ========================================================================== */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

.widget-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 24px;
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2), 
              inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, box-shadow 0.3s ease;
}

.widget-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.25), 
              inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}

.widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: none; /* Zero-divider for iOS desktop module style */
  padding-bottom: 0;
  margin-bottom: 20px;
}

.widget-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.widget-title i {
  color: var(--text-secondary);
  font-size: 1rem;
  opacity: 0.8;
}

.widget-status {
  font-size: 0.75rem;
  color: var(--text-secondary);
  opacity: 0.7;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.3s ease;
}

.widget-status i {
  color: #10b981;
}

/* Clock Widget iOS Overhaul */
.clock-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
  padding: 28px 24px;
  position: relative;
  overflow: hidden;
}

.clock-card::after {
  content: '';
  position: absolute;
  top: -50%; left: -50%; width: 200%; height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.03) 0%, transparent 70%);
  pointer-events: none;
}

.clock-time {
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  background: linear-gradient(180deg, #ffffff 0%, #e2e8f0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: baseline;
  line-height: 1;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.clock-seconds {
  font-size: 1.6rem;
  font-weight: 300;
  margin-left: 2px;
  opacity: 0.7;
  background: none;
  -webkit-text-fill-color: var(--text-secondary);
}

.clock-date {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 14px;
}

/* Notepad Widget iOS Overhaul */
.notepad-card textarea {
  width: 100%;
  height: 150px;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  padding: 16px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.925rem;
  line-height: 1.6;
  resize: none;
  outline: none;
  transition: var(--transition-fast);
}

.notepad-card textarea::placeholder {
  color: var(--text-secondary);
  opacity: 0.5;
}

.notepad-card textarea:focus {
  background: rgba(0, 0, 0, 0.25);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 4px rgba(0,0,0,0.2);
}

/* Theme Picker Widget iOS Overhaul */
.theme-card {
  padding: 24px;
}

.theme-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 8px;
}

.theme-btn {
  height: 42px;
  border-radius: 14px; /* Shape matching squircle icons */
  border: 2px solid transparent;
  cursor: pointer;
  position: relative;
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.theme-btn:hover {
  transform: translateY(-4px) scale(1.08);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

.theme-btn.active {
  border-color: #ffffff;
  transform: scale(1.05);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2), 0 8px 20px rgba(0, 0, 0, 0.4);
}

/* Weather Widget Overhaul */
.weather-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
}

.weather-sunny {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.2) 0%, rgba(59, 130, 246, 0.1) 100%) !important;
  border-color: rgba(251, 191, 36, 0.25) !important;
}

.weather-cloudy {
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.2) 0%, rgba(71, 85, 105, 0.1) 100%) !important;
  border-color: rgba(148, 163, 184, 0.2) !important;
}

.weather-rainy {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(30, 41, 59, 0.15) 100%) !important;
  border-color: rgba(59, 130, 246, 0.2) !important;
}

.weather-stormy {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.25) 0%, rgba(15, 23, 42, 0.3) 100%) !important;
  border-color: rgba(168, 85, 247, 0.25) !important;
}

.weather-header-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.weather-location {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
}

.weather-condition {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.weather-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.weather-temp-container {
  display: flex;
  align-items: baseline;
}

.weather-temp {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
}

.weather-unit {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.weather-icon-large {
  font-size: 2.75rem;
  animation: float-icon 3s infinite ease-in-out;
}

.weather-details-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.weather-detail-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.weather-detail-item i {
  font-size: 0.9rem;
  color: var(--text-primary);
  opacity: 0.7;
}

/* Animations */
@keyframes float-icon {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.weather-wind-icon {
  display: inline-block;
  animation: sway 2s infinite ease-in-out alternate;
}

@keyframes sway {
  0% { transform: rotate(-8deg); }
  100% { transform: rotate(8deg); }
}

.weather-rain-drops {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin-top: 4px;
}

.weather-drop {
  width: 2px;
  height: 6px;
  background: currentColor;
  border-radius: 1px;
  animation: rain-fall 1s infinite linear;
}

.weather-drop:nth-child(2) { animation-delay: 0.2s; }
.weather-drop:nth-child(3) { animation-delay: 0.4s; }

@keyframes rain-fall {
  0% { transform: translateY(-5px); opacity: 0; }
  50% { opacity: 1; }
  100% { transform: translateY(5px); opacity: 0; }
}

@media (max-width: 340px) {
  .weather-body {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

/* System Resource Widget Overhaul */
.resource-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.resource-gauges-container {
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.resource-gauge-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
}

.resource-svg-container {
  position: relative;
  width: 70px;
  height: 70px;
}

.resource-svg-container svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.resource-circle-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 6;
}

.resource-circle-val {
  fill: none;
  stroke: rgb(var(--accent-color-rgb));
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
}

.resource-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.resource-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}

.resource-cpu .resource-circle-val {
  stroke: #a855f7;
}

.resource-mem .resource-circle-val {
  stroke: #10b981;
}

.resource-net .resource-circle-val {
  stroke: #06b6d4;
}

/* Bookmarks Widget Overhaul */
.bookmark-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bookmark-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 4px;
}

.bookmark-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 8px 12px;
  transition: var(--transition-fast);
}

.bookmark-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(var(--accent-color-rgb), 0.2);
  box-shadow: 0 0 12px rgba(var(--accent-color-rgb), 0.05);
}

.bookmark-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  flex: 1;
}

.bookmark-link i {
  color: rgba(var(--accent-color-rgb), 0.7);
  font-size: 0.9rem;
  transition: var(--transition-fast);
}

.bookmark-item:hover .bookmark-link i {
  color: rgb(var(--accent-color-rgb));
  transform: scale(1.1);
}

.bookmark-delete-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  opacity: 0.4;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  border-radius: 4px;
  transition: var(--transition-fast);
}

.bookmark-delete-btn:hover {
  opacity: 1;
  color: #ff3b30;
  background: rgba(255, 59, 48, 0.15);
}

.bookmark-input-group {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.bookmark-input-group input {
  flex: 1;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.85rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: var(--transition-fast);
}

.bookmark-input-group input::placeholder {
  color: var(--text-secondary);
  opacity: 0.5;
}

.bookmark-input-group input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.03);
}

.bookmark-add-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
}

.bookmark-add-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.bookmark-add-btn:active {
  transform: translateY(0);
}

/* ==========================================================================
   macOS Bottom Dock styling
   ========================================================================== */
.dock-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  justify-content: center;
  width: auto;
  max-width: 90vw;
}

.dock {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5),
              0 0 40px rgba(255, 255, 255, 0.01) inset;
  transition: padding 0.3s ease;
}

/* Dock Shelf Line Behind Dock */
.dock::before {
  content: '';
  position: absolute;
  left: 5%;
  right: 5%;
  bottom: 0px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  pointer-events: none;
}

.dock-item {
  position: relative;
  width: 50px;
  height: 50px;
  border-radius: 14px;
  cursor: pointer;
  transform-origin: bottom center;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              margin 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.dock-item a {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.dock-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.dock-fallback-icon {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  border-radius: inherit;
  box-shadow: inset 0 2px 4px rgba(255,255,255,0.1);
}

/* Dock tooltips */
.dock-tooltip {
  position: absolute;
  top: -48px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #ffffff;
  padding: 6px 14px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1000;
}

.dock-item:hover .dock-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Subtle Active Indicator Dot below Dock Items */
.dock-item::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  opacity: 0;
  transition: var(--transition-smooth);
}

.dock-item:hover::after {
  opacity: 1;
  background: rgb(var(--accent-color-rgb));
  box-shadow: 0 0 8px rgb(var(--accent-color-rgb));
}

/* ==========================================================================
   Responsive Media Queries & Mobile Optimizations
   ========================================================================== */
@media (max-width: 768px) {
  .mac-menu-bar {
    padding: 0 12px;
  }
  .mac-menu-left .mac-menu-item:not(.apple-logo):not(.active-app) {
    display: none; /* Hide less important menu items on small screens */
  }

  .dashboard-container {
    padding: 30px 16px 120px 16px;
  }
  
  .greeting-container h1 {
    font-size: 2.2rem;
  }
  
  .greeting-container .subtitle {
    font-size: 0.95rem;
  }
  
  .app-card {
    padding: 24px;
    min-height: 220px;
  }
}

@media (max-width: 480px) {
  .dock-container {
    bottom: 12px;
    width: 95%;
  }

  .dock {
    gap: 8px;
    padding: 8px 12px;
    border-radius: 20px;
    overflow-x: auto;
    width: 100%;
    scrollbar-width: none; /* Hide standard Firefox scrollbar */
    -ms-overflow-style: none; /* IE/Edge */
    justify-content: flex-start;
  }

  .dock::-webkit-scrollbar {
    display: none; /* Hide Chrome/Safari scrollbar */
  }

  .dock-item {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
  }
  
  .dock-tooltip {
    display: none; /* Hide tooltips on phone since hover isn't applicable */
  }
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   Advanced Customization Layouts & Dynamic Grid Overrides
   ========================================================================== */

/* App Card Layout Overrides */
.colspan-1 { grid-column: span 1; }
.colspan-2 { grid-column: span 2 !important; }
.colspan-3 { grid-column: span 3 !important; }
.colspan-4 { grid-column: span 4 !important; }

.rowspan-1 { grid-row: span 1; }
.rowspan-2 { grid-row: span 2 !important; }

/* Sidebar Layout Positions */
@media (min-width: 1024px) {
  .dashboard-layout.sidebar-left {
    grid-template-columns: 1fr 2.3fr !important;
  }
  .dashboard-layout.sidebar-left .sidebar {
    grid-column: 1;
  }
  .dashboard-layout.sidebar-left .main-content {
    grid-column: 2;
  }

  .dashboard-layout.sidebar-top {
    grid-template-columns: 1fr !important;
  }
  .dashboard-layout.sidebar-top .sidebar {
    grid-row: 1;
    margin-bottom: 20px;
  }
  .dashboard-layout.sidebar-top .main-content {
    grid-row: 2;
  }

  .dashboard-layout.sidebar-hidden {
    grid-template-columns: 1fr !important;
  }
  .dashboard-layout.sidebar-hidden .sidebar {
    display: none !important;
  }
}

/* Sidebar Grid Layouts */
.sidebar-widgets-grid {
  display: grid;
  grid-template-columns: repeat(var(--sidebar-cols, 1), 1fr);
  gap: 24px;
  width: 100%;
}

.widget-colspan-1 { grid-column: span 1; }
.widget-colspan-2 { grid-column: span 2 !important; }

/* Drag and Drop Visual Feedback */
.app-card.dragging,
.widget-card.dragging {
  opacity: 0.4 !important;
  transform: scale(0.97) rotate(1deg) !important;
  border: 2px dashed rgba(255, 255, 255, 0.35) !important;
  box-shadow: none !important;
  animation: none !important;
}

.app-card.drag-over,
.widget-card.drag-over {
  border-color: rgba(255, 255, 255, 0.45) !important;
  background: rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.15) !important;
}

/* Edit Mode styling for Dynamic Widgets */
.edit-active .widget-card {
  animation: wiggle 0.3s ease-in-out infinite alternate;
  cursor: default;
}
.edit-active .widget-card:hover {
  transform: none;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.edit-active .widget-card .delete-badge,
.edit-active .widget-card .edit-badge {
  opacity: 1;
  transform: scale(1);
}

/* ==========================================================================
   New Premium Widgets Styling
   ========================================================================== */

/* Calculator Widget */
.calculator-widget {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.calc-display {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 12px 16px;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  text-align: right;
  color: #ffffff;
  min-height: 58px;
  overflow-x: auto;
  white-space: nowrap;
}
.calc-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.calc-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 1.05rem;
  font-weight: 600;
  padding: 12px 0;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}
.calc-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.05);
}
.calc-btn:active {
  transform: scale(0.95);
}
.calc-btn.op-btn {
  background: rgba(255, 159, 10, 0.15);
  border-color: rgba(255, 159, 10, 0.3);
  color: #ff9f0a;
}
.calc-btn.op-btn:hover {
  background: rgba(255, 159, 10, 0.25);
}
.calc-btn.eq-btn {
  background: #ff9f0a;
  border: none;
  color: #ffffff;
}
.calc-btn.eq-btn:hover {
  background: #ffb03a;
}
.calc-btn.clear-btn {
  background: rgba(255, 69, 58, 0.15);
  border-color: rgba(255, 69, 58, 0.3);
  color: #ff453a;
}
.calc-btn.clear-btn:hover {
  background: rgba(255, 69, 58, 0.25);
}

/* To-Do Checklist Widget */
.todo-widget {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.todo-list-container {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
  padding-right: 4px;
}
.todo-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  transition: var(--transition-fast);
}
.todo-item:hover {
  background: rgba(255, 255, 255, 0.04);
}
.todo-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  flex: 1;
}
.todo-checkbox {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}
.todo-item.completed .todo-checkbox {
  border-color: #10b981;
  background: #10b981;
}
.todo-checkbox i {
  font-size: 0.65rem;
  color: #ffffff;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.todo-item.completed .todo-checkbox i {
  opacity: 1;
}
.todo-text {
  font-size: 0.9rem;
  color: var(--text-primary);
  transition: var(--transition-fast);
  user-select: none;
}
.todo-item.completed .todo-text {
  color: var(--text-secondary);
  text-decoration: line-through;
  opacity: 0.6;
}
.todo-delete-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  opacity: 0.4;
  padding: 4px;
  transition: var(--transition-fast);
}
.todo-delete-btn:hover {
  opacity: 1;
  color: #ff3b30;
}
.todo-input-wrapper {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.todo-input {
  flex: 1;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.85rem;
  outline: none;
  transition: var(--transition-fast);
}
.todo-input:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Countdown Timer Widget */
.countdown-widget {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
}
.countdown-display {
  display: flex;
  gap: 8px;
  justify-content: center;
  width: 100%;
}
.countdown-segment {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 8px;
  min-width: 56px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}
.countdown-val {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
}
.countdown-lbl {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-top: 2px;
}
.countdown-ended {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: #10b981;
  margin-top: 6px;
}

/* ==========================================================================
   Dynamic Background Patterns (Premium Overlays)
   ========================================================================== */
.bg-pattern-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1; /* Placed above glow blobs (-2) and below dashboard elements */
  pointer-events: none;
  opacity: 0.75;
  transition: opacity 0.5s ease, background 0.5s ease;
}

/* 1. Dotted Matrix Pattern */
.bg-pattern-overlay.pattern-dots {
  background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1.5px, transparent 1.5px);
  background-size: 28px 28px;
}

/* 2. Cyber Grid Line Pattern */
.bg-pattern-overlay.pattern-grid {
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* 3. Diagonal Stripes Pattern */
.bg-pattern-overlay.pattern-stripes {
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 15px,
    rgba(255, 255, 255, 0.015) 15px,
    rgba(255, 255, 255, 0.015) 30px
  );
}
