/* Web specific enhancements & header */
.web-header {
  position: relative;
  height: 54px;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
}

.logo-text-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Header Navigation Menu */
.header-nav-menu {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 14px;
  padding-left: 14px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  position: relative;
  z-index: 105;
}

.header-nav-item {
  background: transparent;
  border: 1px solid transparent;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 8px;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-family: inherit;
  outline: none;
  text-decoration: none !important;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: auto !important;
}

.header-nav-item *,
.header-nav-item span {
  cursor: pointer !important;
  pointer-events: none;
}

.header-nav-item:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
  cursor: pointer !important;
}

.header-nav-item:active {
  transform: translateY(0);
}

.header-nav-item.nav-item-premium {
  color: #fbbf24;
  font-weight: 600;
}

.header-nav-item.nav-item-premium:hover {
  color: #fef08a;
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.35);
  cursor: pointer !important;
}

.nav-premium-icon {
  font-size: 12px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.web-online-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.web-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 15px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  border-radius: 9px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
  box-sizing: border-box;
}

.web-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  transform: translateY(-1px);
}

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

.web-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ========================================================
   Tasks Workspace Layout (Free: Primary + Right Ad; Premium: 100% Full Width)
   ======================================================== */
.tasks-workspace-layout {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  width: 100%;
  position: relative;
  margin-top: 0;
}

.tasks-primary-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 0;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), flex 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tasks-primary-col > .task-creator-card:first-child {
  margin-top: 0;
}

/* Shared Ad Container & Card Aesthetics */
.zen-ad-container {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.zen-ad-right {
  width: 300px;
  min-width: 300px;
  max-width: 300px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 0;
  padding-top: 0;
  position: sticky;
  top: 0;
  z-index: 20;
  flex-shrink: 0;
  align-self: flex-start;
}

.zen-ad-right > .zen-ad-card:first-child {
  margin-top: 0;
}

.zen-ad-bottom {
  position: fixed;
  bottom: 12px;
  left: 250px;
  right: 0;
  z-index: 90;
  padding: 0 30px;
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: none !important;
  border-top: none !important;
  box-shadow: none !important;
  display: flex;
  justify-content: center;
  pointer-events: none;
  transition: all 0.3s ease;
}

body.theme-light .zen-ad-bottom {
  background: transparent !important;
  border: none !important;
  border-top: none !important;
  box-shadow: none !important;
}

.zen-ad-bottom .zen-ad-card.horizontal {
  pointer-events: auto;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  padding: 6px 14px;
}

body.theme-light .zen-ad-bottom .zen-ad-card.horizontal {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(203, 213, 225, 0.85);
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.1);
}

/* Ensure clearance at the bottom of the scrollable main content so last tasks never get blocked by the fixed ad */
.main-content {
  padding-bottom: 220px !important;
}

body.is-premium .main-content {
  padding-bottom: 24px !important;
}

.zen-ad-card {
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.zen-ad-card:hover {
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.zen-ad-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px 6px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.zen-ad-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #64748b;
}

.zen-ad-upgrade-btn {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(234, 88, 12, 0.15));
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.zen-ad-upgrade-btn:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.3), rgba(234, 88, 12, 0.3));
  color: #fef08a;
  border-color: rgba(245, 158, 11, 0.6);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}

.zen-ad-content {
  width: 100%;
  overflow: hidden;
}

/* Polished AdSense Placeholder Slots */
.ad-placeholder-box {
  border: 1.5px dashed rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.45);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.ad-placeholder-box:hover {
  border-color: rgba(99, 102, 241, 0.45);
  background: rgba(15, 23, 42, 0.6);
}

.ad-placeholder-box.vertical {
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 18px 16px;
  gap: 6px;
}

.ad-placeholder-box.vertical .ad-ph-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #818cf8;
  margin-bottom: 4px;
}

.ad-placeholder-box.vertical .ad-ph-icon svg {
  width: 24px;
  height: 24px;
}

.ad-placeholder-box.horizontal {
  min-height: 75px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  gap: 16px;
}

.ad-placeholder-box.horizontal .ad-ph-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #38bdf8;
  flex-shrink: 0;
}

.ad-placeholder-box.horizontal .ad-ph-icon svg {
  width: 20px;
  height: 20px;
}

.ad-ph-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ad-ph-title {
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
}

.ad-ph-size {
  font-size: 11.5px;
  font-weight: 500;
  color: #38bdf8;
  font-family: monospace;
}

.ad-ph-note {
  font-size: 11px;
  color: #64748b;
}

/* ========================================================
   CRITICAL: PREMIUM BEHAVIOR
   When Premium is active on <body>:
   1. All ad banners are completely hidden (display: none).
   2. .tasks-primary-col expands 100% full width automatically.
   ======================================================== */
body.is-premium .zen-ad-container,
body.is-premium #ad-right-col,
body.is-premium #ad-bottom-bar,
.is-premium .zen-ad-container {
  display: none !important;
}

body.is-premium .tasks-primary-col,
.is-premium .tasks-primary-col {
  width: 100% !important;
  max-width: 100% !important;
  flex: 1 1 100% !important;
}

/* Responsive handling on small screens */
@media (max-width: 1100px) {
  .tasks-workspace-layout {
    flex-direction: column;
  }
  .zen-ad-right {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    position: static;
  }
  .ad-placeholder-box.vertical {
    min-height: 90px;
    padding: 14px 20px;
    flex-direction: row;
    justify-content: flex-start;
  }
  .ad-placeholder-box.vertical .ad-ph-icon {
    margin-bottom: 0;
  }
}

@media (max-width: 900px) {
  .zen-ad-bottom {
    left: 0;
    padding: 0 16px;
    bottom: 8px;
  }
}

/* ========================================================
   CATEGORY MANAGEMENT ENHANCEMENTS
   ======================================================== */
.sidebar-categories-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Sidebar Category Items - Strictly aligned without jumping */
.cat-item {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  height: 38px !important;
  min-height: 38px !important;
  max-height: 38px !important;
  padding: 0 12px !important;
  box-sizing: border-box !important;
}

.cat-item-left {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  min-width: 0 !important;
  flex: 1 !important;
}

.cat-icon-badge {
  font-size: 15px !important;
  width: 16px !important;
  min-width: 16px !important;
  max-width: 16px !important;
  height: 16px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  text-align: center !important;
  line-height: 1 !important;
}

.cat-name {
  font-size: 13px !important;
  font-weight: 500 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  flex: 1 !important;
  min-width: 0 !important;
  color: inherit !important;
}

.cat-item .nav-count {
  margin-left: 8px !important;
  flex-shrink: 0 !important;
}

/* Manage Categories Button */
.add-cat-row-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 36px;
  margin-top: 6px;
  border-radius: 8px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
  color: #94a3b8;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.add-cat-row-btn:hover {
  border-color: rgba(99, 102, 241, 0.6);
  background: rgba(99, 102, 241, 0.15);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.25);
}

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

/* Manage Categories Modal Styling */
.category-modal-container {
  width: 500px;
  max-width: 95vw;
}

.category-modal-container .modal-body {
  max-height: calc(85vh - 70px);
  overflow-y: auto;
  padding: 16px 20px 22px;
}

.manage-cat-section {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 14px 16px;
}

.manage-cat-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 6px;
}

.section-tag-icon {
  font-size: 13px;
}

.manage-cat-input-icon {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  color: #f8fafc;
  cursor: pointer;
  transition: all 0.2s ease;
}

.manage-cat-input-icon:focus {
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.25);
}

.manage-cat-input-name {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  color: #f8fafc;
  transition: all 0.2s ease;
}

.manage-cat-input-name:focus {
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.25);
}

.manage-cat-count-badge {
  background: rgba(255, 255, 255, 0.1);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  color: #94a3b8;
  font-weight: 500;
}

.cat-emoji-picker {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  background: rgba(15, 23, 42, 0.4);
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.cat-emoji-btn {
  height: 34px;
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.15s ease;
}

.cat-emoji-btn:hover {
  background: rgba(99, 102, 241, 0.25);
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-1px) scale(1.12);
}

.cat-emoji-btn.active {
  background: rgba(99, 102, 241, 0.4);
  border-color: #818cf8;
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.4);
}


.manage-cat-list {
  max-height: 230px;
  overflow-y: auto;
  padding-right: 2px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.manage-cat-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(30, 41, 59, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  transition: all 0.18s ease;
}

.manage-cat-card:hover {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(255, 255, 255, 0.16);
}

.manage-cat-card-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.manage-cat-card-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.manage-cat-card-name {
  font-size: 13.5px;
  font-weight: 600;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.manage-cat-card-tag.system {
  font-size: 10.5px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  font-weight: 600;
}

.manage-cat-card-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.manage-cat-task-count {
  font-size: 11.5px;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 500;
}

.manage-cat-protected-text {
  font-size: 11px;
  color: #64748b;
  font-style: italic;
  padding-right: 4px;
}

.manage-cat-del-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.manage-cat-del-btn:hover {
  background: #ef4444;
  border-color: #ef4444;
  color: #ffffff;
  transform: scale(1.04);
}

.manage-cat-edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #60a5fa;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.manage-cat-edit-btn:hover {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #ffffff;
  transform: scale(1.04);
}

.manage-cat-save-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.manage-cat-save-btn:hover {
  background: #10b981;
  border-color: #10b981;
  color: #ffffff;
  transform: scale(1.04);
}

.manage-cat-cancel-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #cbd5e1;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.manage-cat-cancel-btn:hover {
  background: rgba(148, 163, 184, 0.25);
  color: #ffffff;
  transform: scale(1.04);
}

.manage-cat-card.is-editing {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(99, 102, 241, 0.45);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.manage-cat-edit-input {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid #6366f1;
  border-radius: 6px;
  color: #f8fafc;
  font-size: 13px;
  padding: 4px 8px;
  outline: none;
  width: 100%;
  transition: all 0.2s ease;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.manage-cat-edit-input:focus {
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.35);
}

.manage-cat-edit-icon-input {
  width: 36px;
  min-width: 36px;
  text-align: center;
  font-size: 16px;
  padding: 4px 2px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid #6366f1;
  border-radius: 6px;
  color: #f8fafc;
  outline: none;
  transition: all 0.2s ease;
}

.manage-cat-edit-icon-input:focus {
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.35);
}

/* Audio Autoplay Unblock Emergency Banner */
.audio-unlock-banner {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999999;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.95), rgba(220, 38, 38, 0.95));
  border: 1px solid rgba(254, 202, 202, 0.4);
  box-shadow: 0 10px 30px rgba(220, 38, 38, 0.4), 0 0 20px rgba(239, 68, 68, 0.5);
  border-radius: 14px;
  padding: 12px 20px;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  animation: pulse-ring 1.8s infinite ease-in-out;
  max-width: 90vw;
}

@keyframes pulse-ring {
  0% { transform: translateX(-50%) scale(1); box-shadow: 0 8px 24px rgba(220, 38, 38, 0.4); }
  50% { transform: translateX(-50%) scale(1.02); box-shadow: 0 12px 36px rgba(239, 68, 68, 0.7); }
  100% { transform: translateX(-50%) scale(1); box-shadow: 0 8px 24px rgba(220, 38, 38, 0.4); }
}

.audio-banner-content {
  display: flex;
  align-items: center;
  gap: 14px;
}

.audio-banner-icon {
  font-size: 26px;
  animation: bell-swing 1s infinite alternate ease-in-out;
}

@keyframes bell-swing {
  0% { transform: rotate(-15deg); }
  100% { transform: rotate(15deg); }
}

.audio-banner-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.audio-banner-text strong {
  font-size: 14px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #fff;
}

.audio-banner-text span {
  font-size: 12px;
  color: #fecaca;
}

.audio-banner-btn {
  background: #ffffff;
  color: #dc2626;
  border: none;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s ease, background 0.15s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.audio-banner-btn:hover {
  background: #fef2f2;
  transform: scale(1.04);
}




