/* ===== LIQUID GLASS NOTIFICATIONS SIDEBAR ===== */

/* CSS Variables for Premium Liquid Glass Palette */
:root {
  --premium-glass-bg: rgba(6, 10, 16, 0.6);
  --premium-glass-card: rgba(10, 14, 22, 0.75);
  --premium-glass-border: rgba(255, 255, 255, 0.08);
  --premium-glass-border-hover: rgba(255, 255, 255, 0.12);
  --premium-glass-text-primary: rgba(255, 255, 255, 0.98);
  --premium-glass-text-secondary: rgba(255, 255, 255, 0.7);
  --premium-glass-text-tertiary: rgba(255, 255, 255, 0.5);
  --premium-glass-accent-cool: #00d4ff;
  --premium-glass-accent-warm: #ff6b35;
  --premium-glass-shadow-cool: rgba(0, 212, 255, 0.08);
  --premium-glass-shadow-warm: rgba(255, 107, 53, 0.06);
  --premium-glass-shadow-dark: rgba(0, 0, 0, 0.3);
  --premium-glass-blur: 24px;
  --premium-glass-blur-hover: 26px;
  --premium-glass-transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --premium-glass-transition-slow: 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ===== MAIN SIDEBAR CONTAINER - PREMIUM LIQUID GLASS ===== */
.notifications-sidebar {
  position: fixed;
  top: 60px;
  right: -400px;
  width: 400px;
  height: calc(100vh - 60px);
  
  /* Fundal stratificat premium */
  background: 
    /* Noise layer pentru a rupe banding-ul */
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.02'/%3E%3C/svg%3E"),
    /* Vignette radial pentru profunzime */
    radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.02) 0%, transparent 60%),
    /* Bază super închisă */
    var(--premium-glass-bg);
  
  backdrop-filter: 
    blur(var(--premium-glass-blur)) 
    saturate(120%) 
    brightness(110%);
  -webkit-backdrop-filter: 
    blur(var(--premium-glass-blur)) 
    saturate(120%) 
    brightness(110%);
  
  /* Contur interior extrem de discret */
  border-left: 1px solid var(--premium-glass-border);
  
  /* Umbre externe cu profunzime */
  box-shadow:
    /* Halo ambiental rece */
    -24px 0 80px var(--premium-glass-shadow-cool),
    /* Umbră de ancorare */
    -12px 0 32px var(--premium-glass-shadow-dark),
    /* Highlight local în colțuri */
    inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  
  z-index: 10000;
  transition: 
    right var(--premium-glass-transition-slow),
    backdrop-filter var(--premium-glass-transition),
    box-shadow var(--premium-glass-transition);
  
  display: flex;
  flex-direction: column;
  transform: translateZ(0);
  will-change: right, backdrop-filter, box-shadow;
  /* border-radius: 0 28px 28px 0; */
  
  overflow: visible; /* Pentru tooltip și indicator */
}

/* Hover state pentru sidebar - micro interacțiuni */
.notifications-sidebar:hover {
  backdrop-filter: 
    blur(var(--premium-glass-blur-hover)) 
    saturate(125%) 
    brightness(115%);
  -webkit-backdrop-filter: 
    blur(var(--premium-glass-blur-hover)) 
    saturate(125%) 
    brightness(115%);
  
  /* Schimbare lentă a vignette-ului */
  background: 
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.02'/%3E%3C/svg%3E"),
    radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.03) 0%, transparent 60%),
    var(--premium-glass-bg);
  
  box-shadow:
    -28px 0 96px var(--premium-glass-shadow-cool),
    -16px 0 40px var(--premium-glass-shadow-dark),
    inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

/* Show state pentru sidebar */
.notifications-sidebar.show {
  right: 0;
}

/* ===== CLEAR ALL BUTTON - LIQUID GLASS STYLE ===== */
.clear-all-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: fit-content;
  margin: 20px auto 0 auto;
  padding: 12px 20px;
  /* Match notification-group-header background & border */
  background: rgba(255, 255, 255, 0.06);
  /* remove blur to visually match header */
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  
  /* Text styling */
  color: rgba(255, 255, 255, 0.85);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  
  /* Tranziții */
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  
  /* Umbre subtile */
  box-shadow: 
    0 2px 6px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.clear-all-btn:hover {
  /* Match notification-group-header hover */
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 1);
  box-shadow: 
    0 3px 10px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.clear-all-btn:active {
  transform: scale(0.98);
  transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* focus-visible consolidated in Accessibility section below */

.clear-all-btn i {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  transition: color 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.clear-all-btn:hover i {
  color: rgba(255, 255, 255, 1);
}

.clear-all-btn span {
  font-size: 14px;
  font-weight: 500;
}



/* Layout cu regiuni logice - stânga conținut, dreapta timestamp */
.notification-sidebar-item .notification-sidebar-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 520px;
  overflow: hidden;
  position: relative;
}


/* ===== SIDEBAR CONTENT ===== */
.sidebar-content {
  flex: 1;
  overflow: visible;
  display: flex;
  flex-direction: column;
  padding-top: 24px;
}

.notifications-sidebar-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden; /* allow vertical scroll; manage tooltips within items */
  padding: 0 20px;
}

/* ===== GROUPED SECTIONS ===== */
.notification-group {
  margin-bottom: 14px;
}

.notification-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px 8px 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.notification-group-header:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
}

.notification-group-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--premium-glass-text-primary);
  font-weight: 600;
}

.notification-group-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.notification-group-text {
  font-size: 14px;
}

.notification-group-counts {
  font-size: 12px;
  color: var(--premium-glass-text-secondary);
}

.notification-group-toggle {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.notification-group-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.notification-group-clear {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.16s ease, border-color 0.16s ease;
}

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

.notification-group-toggle i {
  font-size: 12px;
}

.notification-group-list {
  margin-top: 10px;
}

/* (removed urgent tasks section styles for right sidebar) */

/* ===== COMPACT NOTIFICATION CARDS - MACOS STYLE ===== */
.notification-sidebar-item {
  /* Dimensiuni controlate - grid de 4px */
  height: 92px;
  max-width: 560px;
  
  /* Match notification-group-header: background & border */
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  
  /* Padding intern - grid de 4px */
  padding: 12px 16px;
  margin-bottom: 12px;
  
  /* Layout flex cu regiuni logice */
  display: flex;
  align-items: flex-start;
  gap: 12px; /* Distanță între icon și text */
  position: relative;
  /* removed extra right padding */
  
  /* Tranziții fluide */
  transition: 
    all 0.16s cubic-bezier(0.4, 0, 0.2, 1),
    backdrop-filter 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  
  cursor: pointer;
  transform: translateZ(0);
  will-change: backdrop-filter, box-shadow;
  
  /* Blur controlat - 14-18px */
  backdrop-filter: blur(16px) saturate(110%) brightness(105%);
  -webkit-backdrop-filter: blur(16px) saturate(110%) brightness(105%);
  
  /* Umbre subtile */
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.1),
    0 2px 8px rgba(0, 0, 0, 0.06),
    0 0 0 0.5px rgba(255, 255, 255, 0.06);
  
  overflow: visible; /* Pentru tooltip și indicator în exterior */
  
  /* Animație de apariție */
  animation: notification-slide-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Peliculă de reflexie diagonală - eliminată duplicatul */





/* Removed previous ::after disabling to allow tooltip defined later */

/* Edge lighting foarte discret cu before */
.notification-sidebar-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    transparent 0%,
    rgba(255, 255, 255, 0.02) 25%,
    rgba(255, 255, 255, 0.01) 65%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 1;
  transition: transform var(--premium-glass-transition);
}

/* ===== HOVER & ACTIVE STATES - PREMIUM MICRO INTERACȚIUNI ===== */

/* Hover state pentru carduri - subtil */
.notification-sidebar-item:hover {
  /* Match notification-group-header hover */
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
  
  /* Crește ușor luminozitatea materialului */
  backdrop-filter: blur(18px) saturate(115%) brightness(108%);
  -webkit-backdrop-filter: blur(18px) saturate(115%) brightness(108%);
  
  /* Fără mutare pe axa Y */
  transform: none;
  
  /* Umbre subtile */
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.12),
    0 3px 10px rgba(0, 0, 0, 0.08),
    0 0 0 0.5px rgba(255, 255, 255, 0.08);
}

/* Hover state pentru timp */
.notification-sidebar-item:hover .notification-time {
  opacity: 0.85;
}

/* Consolidated: using 'notification-new' animation in the section below */

/* Active state pentru feedback tactil */
.notification-sidebar-item:active {
  transform: translateY(0) scale(0.99);
  transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Focus state pentru accesibilitate */
.notification-sidebar-item:focus {
  outline: none;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.18),
    0 6px 20px rgba(0, 0, 0, 0.12),
    0 0 0 1px rgba(255, 255, 255, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 1px 0 0 rgba(255, 255, 255, 0.06),
    0 0 0 2px var(--premium-glass-accent-cool);
}

/* ===== UNREAD NOTIFICATIONS - PREMIUM ===== */
.notification-sidebar-item.unread {
  /* Match notification-group-header: background & border */
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  
  /* Animație subtilă */
  animation: notification-pulse 3s ease-in-out infinite;
}

/* Removed ::after unread indicator */

/* ===== ANIMATIONS ===== */
@keyframes notification-slide-in {
  from {
    opacity: 0;
    transform: translateX(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes notification-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

@keyframes pulse-glow {
  0%, 100% { 
    opacity: 0.8; 
    transform: scale(1);
  }
  50% { 
    opacity: 1; 
    transform: scale(1.1);
  }
}

/* ===== FALLBACK FOR BROWSERS WITHOUT BACKDROP-FILTER SUPPORT ===== */
@supports not (backdrop-filter: blur(1px)) {
  .notifications-sidebar {
    background: rgba(6, 10, 16, 0.95);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow:
      -24px 0 80px rgba(0, 0, 0, 0.4),
      -12px 0 32px rgba(0, 0, 0, 0.3),
      inset 0 0 0 1px rgba(255, 255, 255, 0.15);
  }
  
  .notification-sidebar-item {
    background: rgba(10, 14, 22, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow:
      0 8px 32px rgba(0, 0, 0, 0.3),
      0 4px 16px rgba(0, 0, 0, 0.2),
      inset 0 1px 0 rgba(255, 255, 255, 0.15);
  }
  
  .notification-sidebar-item:hover {
    background: rgba(14, 18, 26, 0.95);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow:
      0 12px 40px rgba(0, 0, 0, 0.4),
      0 6px 20px rgba(0, 0, 0, 0.3),
      inset 0 1px 0 rgba(255, 255, 255, 0.2);
  }
  
  .clear-all-btn {
    /* Match header even without backdrop support */
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  }
  
  .clear-all-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
  }
  
  .notification-sidebar-item .notification-icon {
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.3);
  }
  
  .notification-sidebar-item:hover .notification-icon {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.4);
  }
}

/* ===== REDUCED MOTION SUPPORT ===== */
@media (prefers-reduced-motion: reduce) {
  .notifications-sidebar,
  .notification-sidebar-item,
  .clear-all-btn {
    transition: none;
    animation: none;
  }
  
  .notification-sidebar-item:hover {
    transform: none;
    backdrop-filter: blur(16px) saturate(110%) brightness(105%);
  }
  
  .notification-sidebar-item:active {
    transform: none;
  }
  
  .notification-sidebar-item::before {
    transition: none;
  }
  
  .clear-all-btn:hover {
    transform: none;
  }
  
  .clear-all-btn:active {
    transform: none;
  }
  
  .notification-sidebar-item:hover .notification-icon {
    transform: none;
  }
  
  .notification-sidebar-item:hover .notification-icon-svg {
    filter: brightness(1.1) contrast(1.1);
  }
  
  .notification-sidebar-item .notification-time {
    transition: none;
  }
  
  .notification-sidebar-item:hover .notification-time {
    opacity: 0.7;
  }
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
.notifications-sidebar,
.notification-sidebar-item {
  contain: layout style paint;
  transform: translateZ(0);
  will-change: transform, backdrop-filter, box-shadow;
}

/* ===== ACCESSIBILITY ENHANCEMENTS ===== */
.notification-sidebar-item:focus-visible {
  outline: 2px solid var(--premium-glass-accent-cool);
  outline-offset: 2px;
}

.clear-all-btn:focus-visible {
  outline: 2px solid var(--premium-glass-accent-cool);
  outline-offset: 2px;
}

/* ===== EMPTY STATE ===== */
.notifications-sidebar-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
  color: var(--premium-glass-text-secondary);
}

.notifications-sidebar-empty i {
  font-size: 56px;
  margin-bottom: 20px;
  opacity: 0.5;
  color: var(--premium-glass-text-tertiary);
}

.notifications-sidebar-empty p {
  font-size: 16px;
  font-weight: 500;
  margin: 0;
  color: var(--premium-glass-text-secondary);
}

/* ===== SCROLLBAR STYLING ===== */
.notifications-sidebar-list::-webkit-scrollbar {
  width: 6px;
}

.notifications-sidebar-list::-webkit-scrollbar-track {
  background: transparent;
}

.notifications-sidebar-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.notifications-sidebar-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.1);
}

/* ===== MOVED FROM index.html: Notification micro-styles and animations ===== */
/* Header/Info layout for notification items (used by notifications-sidebar.js) */
.notification-sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.notification-sidebar-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--calendar-accent, #4fc3f7), rgba(79, 195, 247, 0.6));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  align-self: center; /* center vertically within the notification item */
  box-shadow: 0 2px 8px rgba(79, 195, 247, 0.3);
  transition: all 0.3s ease;
}

.notification-sidebar-icon i {
  font-size: 16px;
  color: #ffffff;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.notification-sidebar-item:hover .notification-sidebar-icon {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(79, 195, 247, 0.4);
}

.notification-sidebar-info {
  flex: 1;
  min-width: 0;
}

.notification-sidebar-title {
  font-weight: 600;
  font-size: 15px;
  color: #ffffff;
  margin: 0;
  line-height: 1.3;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  transition: color 0.2s ease;
}

.notification-sidebar-item:hover .notification-sidebar-title {
  color: var(--calendar-accent, #4fc3f7);
  text-shadow: 0 0 8px rgba(79, 195, 247, 0.4);
}

.notification-sidebar-time {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
  transition: color 0.2s ease;
}

.notification-sidebar-item:hover .notification-sidebar-time {
  color: rgba(79, 195, 247, 0.8);
}

.notification-sidebar-message {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.5;
  margin: 0;
  transition: color 0.2s ease;
}

.notification-sidebar-item:hover .notification-sidebar-message {
  color: rgba(255, 255, 255, 1);
}

/* Removed tooltip ::after on notification items */

/* New/removal animations for notifications */
.notification-sidebar-item.new-notification {
  animation: notification-new 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 30px rgba(79, 195, 247, 0.4);
}

@keyframes notification-new {
  0% {
    opacity: 0;
    transform: translateX(40px) scale(0.8);
    background: rgba(79, 195, 247, 0.3);
    box-shadow: 0 0 40px rgba(79, 195, 247, 0.6);
  }
  50% {
    opacity: 1;
    transform: translateX(-5px) scale(1.05);
    background: rgba(79, 195, 247, 0.2);
    box-shadow: 0 0 35px rgba(79, 195, 247, 0.5);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 20px rgba(79, 195, 247, 0.2);
  }
}

.notification-sidebar-item.removing {
  animation: notification-remove 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes notification-remove {
  0% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateX(40px) scale(0.8);
  }
}
