/**
 * Otanyuu Notifications System Styles
 * Provides styling for both toast and user notifications
 */

/* Toast Container */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 400px;
  width: calc(100% - 40px);
}

/* Toast Notification */
.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-radius: 12px;
  background: rgba(30, 30, 30, 0.75);
  backdrop-filter: blur(10px) saturate(160%);
  -webkit-backdrop-filter: blur(10px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #f9fafb;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  opacity: 1;
  transition: transform 0.35s cubic-bezier(.4,0,.2,1), opacity 0.35s ease;
  overflow: hidden;
  position: relative;
  animation: toastSlideIn 0.45s cubic-bezier(.34,1.56,.64,1) forwards;
}

.toast.hiding {
  transform: translateY(-10px);
  opacity: 0;
}

.toast-success {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  box-shadow: 0 0 15px rgba(124, 58, 237, 0.5);
}

.toast-error {
  background-color: #ef4444;
}

.toast-warning {
  background-color: #f59e0b;
}

.toast-info {
  background-color: #3b82f6;
}

.toast-icon {
  flex-shrink: 0;
  font-size: 18px;
}

.toast-message {
  flex: 1;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
  color: #fefefe;
}

.toast-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  padding: 6px;
  font-size: 14px;
  transition: color 0.2s ease, transform 0.2s ease;
}
.toast-close:hover {
  color: #ffffff;
  transform: rotate(90deg);
}

.toast-close:hover {
  color: #fff;
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0.2) 100%);
  transform-origin: left center;
  transition: width 0.15s linear;
  pointer-events: none;
}

/* ------- Enhanced Toast Effects ------- */
.toast {
  transition: transform 0.35s cubic-bezier(.4,0,.2,1), opacity 0.35s ease, box-shadow 0.35s ease;
}

.toast:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
}

/* Animated gradient border */
.toast::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(60deg, rgba(139,92,246,0.75), rgba(124,58,237,0.4), rgba(139,92,246,0.75));
  background-size: 300% 300%;
  animation: borderGlow 6s ease infinite;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  -webkit-mask-composite: xor;
  pointer-events: none;
}

@keyframes borderGlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Icon bounce on appear */
@keyframes toastIconPop {
  0% { transform: scale(0.5); opacity: 0; }
  60% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); }
}

.toast-icon {
  animation: toastIconPop 0.6s cubic-bezier(.68,-0.55,.27,1.55);
  font-size: 22px;
  flex-shrink: 0;
  color: #ffffff;
}

.toast-success .toast-icon { color: #fef08a; }
.toast-error .toast-icon { color: #fecaca; }
.toast-warning .toast-icon { color: #fcd34d; }
.toast-info    .toast-icon { color: #bae6fd; }
/* ------- End Enhanced Toast Effects ------- */

/* ===== SweetAlert2 Custom Theme ===== */
.swal2-popup {
  background: rgba(30,30,30,0.9);
  color: #f9fafb;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px !important;
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
}

.swal2-title {
  font-size: 1.5rem !important;
  font-weight: 600;
  color: #fefefe;
  margin-bottom: 0.5rem;
}

.swal2-html-container {
  font-size: 1rem !important;
  color: #d1d5db;
}

.swal2-confirm.swal2-styled,
.swal2-cancel.swal2-styled {
  padding: 0.6rem 1.5rem !important;
  font-weight: 600;
  border-radius: 8px !important;
  border: none;
}

.swal2-confirm.swal2-styled {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%) !important;
}

.swal2-confirm.swal2-styled:hover {
  box-shadow: 0 0 10px rgba(124,58,237,0.6) !important;
}

.swal2-cancel.swal2-styled {
  background: #4b5563 !important;
}

.swal2-cancel.swal2-styled:hover {
  background: #374151 !important;
}

.swal2-icon.swal2-success .swal2-success-ring {
  border-color: rgba(16,185,129,0.3) !important;
}

.swal2-icon.swal2-success [class^=swal2-success-line] {
  background-color: #10b981 !important;
}

/* ===== End SweetAlert2 Custom Theme ===== */

@keyframes toastSlideIn {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ===== User Notifications ===== */

/* Notifications Button */
#notifications-btn {
  position: relative;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Badge for unread notifications */
#notifications-btn .badge {
  position: absolute;
  top: 0;
  right: 0;
  background-color: #ef4444;
  color: white;
  font-size: 0.7rem;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  padding: 0 5px;
  transform: translate(25%, -25%);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Pulse animation for new notifications */
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

#notifications-btn.pulse .badge {
  animation: pulse 1s ease-out;
}

/* Notifications Dropdown */
.notifications-dropdown {
  position: absolute;
  top: 100%;
  right: -10px;
  margin-top: 10px;
  background-color: #1f1f1f;
  border-radius: 8px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  width: 320px;
  display: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
  transform: translateY(-10px);
}

.notifications-dropdown.show {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* RTL positioning for Arabic interface */
.notifications-dropdown {
  left: auto;
  right: 0;
}

/* Notification Header */
.notification-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.notification-header h3 {
  margin: 0;
  font-size: 1rem;
  color: #fff;
}

.mark-all-read {
  background: none;
  border: none;
  color: #8b5cf6;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.mark-all-read:hover {
  background-color: rgba(139, 92, 246, 0.1);
}

/* Notification List */
.notification-list {
  max-height: 400px;
  overflow-y: auto;
  padding: 0;
}

/* Notification Item */
.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.notification-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.notification-item.unread {
  background-color: rgba(139, 92, 246, 0.1);
}

.notification-item.unread:hover {
  background-color: rgba(139, 92, 246, 0.15);
}

/* Animation for deleting notifications */
.notification-item.deleting {
  animation: slideOut 0.3s ease forwards;
  overflow: hidden;
}

@keyframes slideOut {
  0% {
    opacity: 1;
    transform: translateX(0);
    max-height: 100px;
  }
  100% {
    opacity: 0;
    transform: translateX(-100%);
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
    margin-bottom: 0;
    border-width: 0;
  }
}

/* Delete button */
.notification-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  padding: 4px;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  opacity: 0;
  transition: all 0.2s ease;
}

.notification-item:hover .notification-delete {
  opacity: 1;
}

.notification-delete:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
}

/* RTL support for delete button */
html[dir="rtl"] .notification-delete {
  right: auto;
  left: 8px;
}

/* Notification Icon */
.notification-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 0.9rem;
  flex-shrink: 0;
}

/* Icon colors for different notification types */
.notification-icon.icon-like {
  background-color: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.notification-icon.icon-reply {
  background-color: rgba(59, 130, 246, 0.2);
  color: #3b82f6;
}

.notification-icon.icon-rating {
  background-color: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}

.notification-icon.icon-favorite {
  background-color: rgba(236, 72, 153, 0.2);
  color: #ec4899;
}

.notification-icon.icon-update {
  background-color: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

/* Notification Content */
.notification-content {
  flex: 1;
  min-width: 0;
}

.notification-text {
  font-size: 0.9rem;
  line-height: 1.4;
  color: #fff;
  margin-bottom: 4px;
}

.notification-time {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
}

/* Empty State */
.notification-empty {
  padding: 20px;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.9rem;
}

/* Loading State */
.notification-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.loading-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: #8b5cf6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Error State */
.notification-error {
  padding: 20px;
  text-align: center;
  color: #ef4444;
  font-size: 0.9rem;
}

/* Footer with Load More button */
.notification-footer {
  padding: 12px;
  display: flex;
  justify-content: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.load-more-btn {
  background-color: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 4px;
  color: #fff;
  font-size: 0.85rem;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.load-more-btn:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

/* Responsive styles */
@media (max-width: 768px) {
  .notifications-dropdown {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0;
    width: 100%;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.3);
    z-index: 10001;
    max-width: 100%;
    max-height: 0;
    transform: translateY(100%);
  }
  
  .notifications-dropdown.show {
    max-height: 80vh;
    transform: translateY(0) !important;
  }
  
  .notification-list {
    max-height: calc(80vh - 120px);
    overflow-y: auto;
  }
  
  .notification-header {
    padding: 15px;
    position: sticky;
    top: 0;
    background-color: #1f1f1f;
    z-index: 5;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
}

/* Responsive styles for very small screens */
@media (max-width: 480px) {
  .notifications-dropdown {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    width: 100%;
    height: 100%;
    max-height: 100vh !important;
    border-radius: 0;
    box-shadow: none;
    z-index: 2000;
  }
  
  .notifications-dropdown.show {
    max-height: 100vh !important;
  }
  
  .notification-list {
    max-height: calc(100vh - 60px);
    height: calc(100% - 60px);
  }
  
  .notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: #7c3aed;
  }
  
  .notification-header h3 {
    margin: 0;
    font-size: 16px;
  }
  
  .mark-all-read {
    margin-left: 10px;
  }
  
  .notification-header .close-notifications {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    margin-right: -5px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
  }
  
  .notification-header .close-notifications:hover {
    background-color: rgba(255, 255, 255, 0.1);
  }
  
  .notification-item {
    padding: 12px 15px;
  }
  
  .notification-icon {
    width: 36px;
    height: 36px;
  }
  
  .notification-text {
    font-size: 14px;
    line-height: 1.4;
  }
  
  .notification-time {
    font-size: 12px;
  }
  
  .notification-delete {
    opacity: 0.7;
  }
} 