/**
 * Notifications Styles
 * Follows DrawLeague graphic charter
 * Warm, calm, non-intrusive design
 */

/* Notification Bell Container */
.notifications-container {
  position: relative;
  display: inline-flex;
  align-items: center;
}

/* Bell Button */
.notification-bell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  color: #333333;
  transition: background-color 150ms ease, color 150ms ease;
}

.notification-bell:hover {
  background-color: rgba(211, 84, 0, 0.1);
  color: #D35400;
}

.notification-bell:focus {
  outline: 2px solid #D35400;
  outline-offset: 2px;
}

.notification-bell svg {
  width: 22px;
  height: 22px;
}

/* Badge */
.notification-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background-color: #D35400;
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
}

/* Dropdown Panel */
.notifications-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  width: 360px;
  max-width: calc(100vw - 32px);
  margin-top: 8px;
  background: #FFFFFF;
  border-radius: 12px;
  border: 1px solid #E8E4DB;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  overflow: hidden;
}

/* Dropdown Header */
.notifications-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid #E8E4DB;
  background: #F9F7F1;
}

.notifications-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #333333;
}

.notifications-mark-all {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 6px;
  color: #4A5568;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}

.notifications-mark-all:hover {
  background-color: rgba(211, 84, 0, 0.1);
  color: #D35400;
}

.notifications-mark-all:focus {
  outline: 2px solid #D35400;
  outline-offset: 2px;
}

/* Notification List */
.notifications-list {
  max-height: 400px;
  overflow-y: auto;
}

/* Empty State */
.notifications-empty {
  padding: 32px 16px;
  text-align: center;
}

.notifications-empty p {
  margin: 0;
  color: #4A5568;
  font-size: 0.875rem;
}

/* Notification Item */
.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #E8E4DB;
  cursor: pointer;
  transition: background-color 150ms ease;
}

.notification-item:last-child {
  border-bottom: none;
}

.notification-item:hover {
  background-color: #F9F7F1;
}

.notification-item.unread {
  background-color: rgba(211, 84, 0, 0.05);
}

.notification-item.unread:hover {
  background-color: rgba(211, 84, 0, 0.1);
}

/* Notification Icon */
.notification-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  background: #F9F7F1;
  border-radius: 50%;
}

/* Notification Content */
.notification-content {
  flex: 1;
  min-width: 0;
}

.notification-title {
  margin: 0 0 4px 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: #333333;
  line-height: 1.3;
}

.notification-body {
  margin: 0 0 4px 0;
  font-size: 0.8125rem;
  color: #4A5568;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Clickable links inside notification body (e.g. kudo notifications) */
.notification-link {
  color: #D35400;
  text-decoration: none;
  font-weight: 600;
  transition: color 150ms ease;
}

.notification-link:hover {
  color: #A04000;
  text-decoration: underline;
}

.notification-time {
  font-size: 0.75rem;
  color: #4A5568;
}

/* Delete Button */
.notification-delete-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  margin-left: auto;
  background: transparent;
  border: none;
  color: #9B9B9B;
  cursor: pointer;
  border-radius: 4px;
  transition: color 150ms ease, background-color 150ms ease;
}

.notification-delete-btn:hover {
  color: #D35400;
  background-color: rgba(211, 84, 0, 0.1);
}

.notification-delete-btn svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.5;
}

/* Footer */
.notifications-footer {
  padding: 12px 16px;
  border-top: 1px solid #E8E4DB;
  background: #F9F7F1;
  text-align: center;
}

.notifications-footer a {
  color: #D35400;
  font-size: 0.875rem;
  text-decoration: none;
}

.notifications-footer a:hover {
  text-decoration: underline;
}

/* =============================================
   ANNOUNCEMENT BANNER
   ============================================= */

.announcement-banner {
  position: relative;
  padding: 12px 48px 12px 16px;
  text-align: center;
  font-size: 0.875rem;
  line-height: 1.5;
  animation: slideDown 300ms ease;
}

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

.announcement-banner.level-info {
  background-color: #E6EEF6;
  color: #1976D2;
  border-bottom: 1px solid #BBDEFB;
}

.announcement-banner.level-success {
  background-color: #E8F5E9;
  color: #388E3C;
  border-bottom: 1px solid #C8E6C9;
}

.announcement-banner.level-warning {
  background-color: #FFF3E0;
  color: #E65100;
  border-bottom: 1px solid #FFE0B2;
}

.announcement-banner-title {
  font-weight: 600;
  margin-right: 8px;
}

.announcement-banner-dismiss {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 4px;
  color: inherit;
  opacity: 0.7;
  cursor: pointer;
  transition: opacity 150ms ease;
}

.announcement-banner-dismiss:hover {
  opacity: 1;
}

.announcement-banner-dismiss:focus {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* =============================================
   NOTIFICATION SETTINGS (Profile Page)
   ============================================= */

.notification-settings {
  max-width: 600px;
}

.notification-settings-section {
  margin-bottom: 24px;
}

.notification-settings-section h3 {
  margin: 0 0 12px 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: #333333;
}

.notification-settings-copy {
  margin: 0 0 16px 0;
  font-size: 0.875rem;
  color: #4A5568;
}

.notification-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #E8E4DB;
}

.notification-toggle:first-of-type {
  border-top: 1px solid #E8E4DB;
}

.notification-toggle-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.notification-toggle-title {
  font-size: 0.9375rem;
  font-weight: 500;
  color: #333333;
}

.notification-toggle-desc {
  font-size: 0.8125rem;
  color: #4A5568;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #E8E4DB;
  transition: 200ms ease;
  border-radius: 28px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 200ms ease;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toggle-switch input:checked + .toggle-slider {
  background-color: #D35400;
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

.toggle-switch input:focus + .toggle-slider {
  box-shadow: 0 0 0 2px rgba(211, 84, 0, 0.3);
}

.toggle-switch input:disabled + .toggle-slider {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Responsive */
@media (max-width: 480px) {
  .notifications-dropdown {
    position: fixed;
    top: 60px; /* Just below the header */
    right: 0;
    bottom: auto;
    left: 0;
    width: 100%;
    max-width: 100%;
    margin-top: 0;
    border-radius: 0 0 16px 16px;
    max-height: calc(100vh - 80px);
  }
  
  .notifications-list {
    max-height: calc(100vh - 200px);
  }
}
