/* ========== NOTIFICATIONS MODAL STYLES ========== */

/* Notifications Modal - workspace style window */
.notifications-modal {
  width: 860px;
  max-width: 95vw;
  height: 670px;
  max-height: 90vh;
  background: linear-gradient(145deg, #1a1d24, #12141a);
  border-radius: 16px;
  border: 1px solid rgba(59, 130, 246, 0.25);
  z-index: 10100 !important;
  padding: 0;
}

/* Override base filter-modal display to ensure proper hiding when inactive */
.notifications-modal:not(.active) {
  display: none !important;
}

.notifications-modal.active {
  display: flex !important;
  flex-direction: column;
}

.notifications-modal .filter-modal-header {
  padding: 16px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(0,0,0,0.2);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 16px;
}

.notifications-modal .filter-modal-header h2 {
  font-size: 16px;
  font-weight: 500;
  color: #fff;
  margin: 0;
  flex: 1;
}

.notifications-modal .filter-modal-body {
  flex: 1;
  display: flex;
  padding: 0;
  overflow: hidden;
}

.notifications-modal .filter-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255,255,255,0.06);
  background: rgba(0,0,0,0.2);
  flex-shrink: 0;
}

/* Close button positioning */
.notifications-modal .filter-modal-close {
  position: relative;
  top: 0;
  right: 0;
}

#notifications-modal-overlay {
  z-index: 10099 !important;
}

/* Hide sections by default - JS will show them with inline styles */
/* These use lower specificity so inline style.display can override */
#notification-settings-section,
#notification-timeframes-section,
#notification-watchlist-section,
#notifications-unlink-btn {
  display: none;
}

/* telegram-not-linked and telegram-linked are controlled by JS inline styles */

/* Hide entire telegram section when linked */
.notifications-modal #telegram-status-section.hidden {
  display: none !important;
}

/* ========== WORKSPACE LAYOUT ========== */

/* Left sidebar - categories */
.notif-categories {
  width: 200px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px 16px;
  background: rgba(0,0,0,0.15);
  border-right: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
  overflow-y: auto;
}

.notif-category {
  background: transparent;
  padding: 12px 16px;
  border-radius: 8px;
  cursor: pointer;
  color: rgb(166 169 190);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  border: 1px solid transparent;
  user-select: none;
}


.notif-category:hover {
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.85);
}

.notif-category.active {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.4);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.25);
}

/* Right panel - subcategories */
.notif-subcategories-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.notif-subcategories-header {
  padding: 20px 24px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-shrink: 0;
}

.notif-subcategories-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  margin: 0 0 4px 0;
}

.notif-subcategories-header .header-hint {
  font-size: 13px;
  color: rgba(255,255,255,0.45);
  font-weight: 400;
}

.notif-subcategories-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
}

/* Individual subcategory item */
.notif-subcategory-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-radius: 10px;
  margin-bottom: 10px;
  transition: all 0.2s;
}

.notif-subcategory-item:hover {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.08);
}

.notif-subcategory-info {
  flex: 1;
}

.notif-subcategory-name {
  font-size: 14px;
  font-weight: 400;
  color: rgb(255 255 255);
  margin-bottom: 4px;
}

.notif-subcategory-desc {
  font-size: 12px;
  color: rgb(115 119 138);
  line-height: 1.4;
}

.notif-subcategory-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Smaller toggle switches for notifications modal */
.notifications-modal .smc-toggle-switch {
  width: 42px;
  height: 22px;
  padding-top: 0;
}

.notifications-modal .smc-toggle-slider {
  border-radius: 22px;
}

.notifications-modal .smc-toggle-slider:before {
  height: 16px;
  width: 16px;
  left: 3px;
  top: 2px;
}

.notifications-modal .smc-toggle-switch input:checked + .smc-toggle-slider:before {
  transform: translateX(19px);
}

/* Telegram Status Section - hidden by default */
#telegram-status-section {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.15s;
}

#telegram-status-section.visible {
  visibility: visible;
  opacity: 1;
}

.telegram-status {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 32px 40px;
  max-width: 500px;
  width: 100%;
}

.telegram-not-linked h3 {
  margin: 0 0 8px 0;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.02em;
}

.telegram-not-linked p {
  margin: 0 0 20px 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
}

.telegram-steps {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}

.telegram-step {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
}

.telegram-step .step-num {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #fff;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

.telegram-step a {
  color: #818cf8;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.telegram-step a:hover {
  color: #a5b4fc;
}

.telegram-step code {
  background: rgba(99, 102, 241, 0.25);
  color: #c7d2fe;
  padding: 3px 10px;
  border-radius: 6px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 13px;
  font-weight: 500;
}

.telegram-verify-box {
  display: flex;
  gap: 12px;
}

.telegram-verify-input {
  flex: 1;
  padding: 14px 18px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: #fff;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 16px;
  letter-spacing: 2px;
  outline: none;
  transition: all 0.2s;
}

.telegram-verify-input:focus {
  border-color: rgba(99, 102, 241, 0.5);
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.telegram-verify-input::placeholder {
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 0;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
}

.telegram-verify-btn {
  padding: 14px 28px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.telegram-verify-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

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

.telegram-verify-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Telegram Linked State */
.telegram-linked {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.telegram-linked-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.telegram-linked-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2) 0%, rgba(34, 197, 94, 0.1) 100%);
  border-radius: 50%;
  font-size: 24px;
}

.telegram-linked-info strong {
  display: block;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 2px;
}

.telegram-username {
  font-size: 14px;
  color: #60a5fa;
}

.notifications-master-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.notifications-master-toggle:hover {
  background: rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.12);
}

.notifications-master-toggle span:first-child {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
}

/* ========== SIGNAL TYPES ========== */

.notification-types-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Type Group Container */
.notification-type-group {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s;
}

.notification-type-group:hover {
  border-color: rgba(255, 255, 255, 0.1);
}

.notification-type-group.active {
  border-color: rgba(99, 102, 241, 0.3);
  background: rgba(99, 102, 241, 0.05);
}

/* Type Item (Parent) */
.notification-type-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  cursor: pointer;
  transition: background 0.2s;
  margin: 0;
}

.notification-type-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.notification-type-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.notification-type-icon {
  font-size: 20px;
  width: 32px;
  text-align: center;
}

.notification-type-name {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
}

/* Subfilters */
.notification-subfilters {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 16px 16px;
  animation: slideDown 0.2s ease;
}

.notification-type-group.active .notification-subfilters {
  display: flex;
}

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

.notification-subfilter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.notification-subfilter:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.8);
}

.notification-subfilter input {
  display: none;
}

.notification-subfilter:has(input:checked) {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.4);
  color: #c7d2fe;
}

.notification-subfilter:has(input:checked):hover {
  background: rgba(99, 102, 241, 0.25);
  border-color: rgba(99, 102, 241, 0.5);
}

/* ========== TIMEFRAMES ========== */

#notification-timeframes-section .filter-modal-timeframes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#notification-timeframes-section .filter-modal-timeframe {
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: all 0.15s;
}

#notification-timeframes-section .filter-modal-timeframe:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

#notification-timeframes-section .filter-modal-timeframe:has(input:checked) {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.4);
  color: #c7d2fe;
}

#notification-timeframes-section .filter-modal-timeframe input {
  display: none;
}

/* ========== WATCHLIST ========== */

.section-hint {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 400;
}

.section-desc {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  margin: 0 0 14px 0;
  line-height: 1.5;
}

.watchlist-input-wrapper {
  margin-bottom: 12px;
}

.watchlist-input-wrapper input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
}

.watchlist-input-wrapper input:focus {
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.watchlist-input-wrapper input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.watchlist-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.watchlist-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.1) 100%);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: #c7d2fe;
}

.watchlist-tag-remove {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  transition: all 0.15s;
}

.watchlist-tag-remove:hover {
  background: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

/* ========== WORKSPACE LAYOUT ADDITIONS ========== */

.notif-workspace {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Footer styling for workspace */
.notifications-modal .filter-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}

.notifications-modal .footer-buttons {
  display: flex;
  gap: 12px;
}

/* Scrollbar styling */
.notif-categories::-webkit-scrollbar,
.notif-subcategories-list::-webkit-scrollbar {
  width: 6px;
}

.notif-categories::-webkit-scrollbar-track,
.notif-subcategories-list::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.02);
  border-radius: 3px;
}

.notif-categories::-webkit-scrollbar-thumb,
.notif-subcategories-list::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
}

.notif-categories::-webkit-scrollbar-thumb:hover,
.notif-subcategories-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.15);
}

/* ========== BUTTONS ========== */

#notifications-unlink-btn {
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.25);
  background: transparent;
}

#notifications-unlink-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.4);
}

/* Tracking button state in coin panel */
.coin-notify-btn.tracking {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.15) 0%, rgba(34, 197, 94, 0.08) 100%) !important;
  border-color: rgba(34, 197, 94, 0.3) !important;
  color: #86efac !important;
}

.coin-notify-btn.tracking:hover {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2) 0%, rgba(34, 197, 94, 0.12) 100%) !important;
  border-color: rgba(34, 197, 94, 0.4) !important;
}

/* ========== MOBILE ========== */

@media (max-width: 768px) {
  .notifications-modal {
    max-width: 100%;
    width: 100%;
    height: auto;
    max-height: 90vh;
    border-radius: 20px 20px 0 0;
  }
  
  /* Reorganize modal body layout for mobile */
  .notifications-modal .filter-modal-body {
    flex-direction: column;
    overflow-y: auto;
  }
  
  .notif-workspace {
    flex-direction: column;
    flex: 1;
    min-height: 0;
  }
  
  .notif-categories {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 12px;
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    gap: 8px;
    flex-shrink: 0;
  }
  
  .notif-category {
    padding: 8px 14px;
    font-size: 13px;
  }
  
  .notif-subcategories-panel {
    max-height: 250px;
    min-height: 200px;
    flex: 1;
  }
  
  .notif-subcategories-header {
    padding: 16px 20px 10px;
  }
  
  .notif-subcategories-list {
    padding: 12px 20px;
  }
  
  .notif-subcategory-item {
    padding: 12px 14px;
  }
  
  /* Watchlist section - positioned at bottom with separator */
  #notification-watchlist-section {
    order: 10;
    flex-shrink: 0;
    margin-top: auto;
    padding: 10px 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.15);
    max-height: 120px;
    overflow-y: auto;
  }
  
  /* Watchlist separator line */
  #notification-watchlist-section::before {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
    margin: 0 auto 8px;
  }
  
  .watchlist-title {
    font-size: 12px;
    text-align: left;
    margin-bottom: 8px;
  }
  
  /* Hide hint and input on mobile */
  .watchlist-hint {
    display: none;
  }
  
  .watchlist-input-wrapper {
    display: none;
  }
  
  .watchlist-tags {
    justify-content: flex-start;
    max-height: 50px;
    overflow-y: auto;
    gap: 6px;
  }
  
  .watchlist-tag {
    padding: 4px 8px;
    font-size: 11px;
  }
  
  .notifications-modal .filter-modal-footer {
    flex-direction: column;
    gap: 12px;
  }
  
  .notifications-modal .footer-buttons {
    width: 100%;
    justify-content: center;
  }
  
  /* Override button padding for notifications modal */
  .notifications-modal .filter-modal-btn-secondary,
  .notifications-modal .filter-modal-btn-primary {
    padding: 12px 20px;
    flex: 1;
    min-width: 0;
  }
  
  .telegram-status {
    padding: 20px;
    margin: 16px;
  }
  
  .telegram-verify-box {
    flex-direction: column;
  }
  
  .telegram-verify-btn {
    width: 100%;
    padding: 16px;
  }
}

/* ========== PREMIUM BADGE ========== */
.premium-badge {
  display: inline-block;
  padding: 2px 6px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #000;
  border-radius: 4px;
  margin-right: 6px;
  vertical-align: middle;
}

.premium-feature {
  position: relative;
  border: 1px solid rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.05);
}

.premium-feature:not(.unlocked) {
  opacity: 0.6;
}

.premium-feature:not(.unlocked) input[type="checkbox"] {
  pointer-events: none;
}

.premium-feature.unlocked {
  opacity: 1;
  border-color: rgba(245, 158, 11, 0.5);
}

/* ========== WATCHLIST SECTION ========== */
#notification-watchlist-section {
  padding: 16px 24px;
  border-top: 1px solid rgba(255,255,255,0.06);
  background: rgba(0,0,0,0.1);
}

.watchlist-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin: 0 0 4px 0;
}

.watchlist-hint {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  margin: 0 0 12px 0;
}

.watchlist-input-wrapper {
  margin-bottom: 12px;
}

#watchlist-input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  transition: all 0.2s ease;
}

#watchlist-input:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#watchlist-input::placeholder {
  color: rgba(255,255,255,0.3);
}

.watchlist-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.watchlist-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: #60a5fa;
}

.watchlist-tag-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: rgba(239, 68, 68, 0.2);
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  color: #ef4444;
  transition: all 0.2s ease;
}

.watchlist-tag-remove:hover {
  background: rgba(239, 68, 68, 0.4);
}
