/* Notification System CSS */

/* Notification Container */
.notification-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  max-width: 400px;
  width: 100%;
}

/* Individual Notification */
.notification {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  margin-bottom: 10px;
  padding: 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transform: translateX(100%);
  opacity: 0;
  transition: all 0.3s ease;
  border-left: 4px solid #ddd;
  position: relative;
  overflow: hidden;
}

.notification.show {
  transform: translateX(0);
  opacity: 1;
}

.notification.hide {
  transform: translateX(100%);
  opacity: 0;
}

/* Notification Types */
.notification.success {
  border-left-color: #52c41a;
  background: linear-gradient(135deg, #f6ffed 0%, #ffffff 100%);
}

.notification.error {
  border-left-color: #ff4d4f;
  background: linear-gradient(135deg, #fff2f0 0%, #ffffff 100%);
}

.notification.warning {
  border-left-color: #faad14;
  background: linear-gradient(135deg, #fffbe6 0%, #ffffff 100%);
}

.notification.info {
  border-left-color: #1890ff;
  background: linear-gradient(135deg, #e6f7ff 0%, #ffffff 100%);
}

/* Icon Styles */
.notification-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #fff;
}

.notification.success .notification-icon {
  background: #52c41a;
}

.notification.error .notification-icon {
  background: #ff4d4f;
}

.notification.warning .notification-icon {
  background: #faad14;
}

.notification.info .notification-icon {
  background: #1890ff;
}

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

.notification-title {
  font-weight: 600;
  font-size: 14px;
  color: #262626;
  margin-bottom: 4px;
  line-height: 1.4;
}

.notification-message {
  font-size: 13px;
  color: #595959;
  line-height: 1.4;
  margin-bottom: 8px;
}

.notification-time {
  font-size: 11px;
  color: #8c8c8c;
}

/* Close Button */
.notification-close {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8c8c8c;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.notification-close:hover {
  background: rgba(0, 0, 0, 0.1);
  color: #595959;
}

/* Progress Bar */
.notification-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: rgba(0, 0, 0, 0.1);
  width: 100%;
}

.notification-progress-bar {
  height: 100%;
  background: currentColor;
  width: 100%;
  transition: width linear;
}

.notification.success .notification-progress-bar {
  background: #52c41a;
}

.notification.error .notification-progress-bar {
  background: #ff4d4f;
}

.notification.warning .notification-progress-bar {
  background: #faad14;
}

.notification.info .notification-progress-bar {
  background: #1890ff;
}

/* Animation for new notifications */
@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

.notification.slide-in {
  animation: slideIn 0.3s ease forwards;
}

.notification.slide-out {
  animation: slideOut 0.3s ease forwards;
}

/* Responsive Design */

/* Tablet */
@media (max-width: 1024px) {
  .notification-container {
    right: 15px;
    max-width: 350px;
  }
  
  .notification {
    padding: 14px;
    margin-bottom: 8px;
  }
  
  .notification-title {
    font-size: 15px;
  }
  
  .notification-message {
    font-size: 14px;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .notification-container {
    right: 10px;
    left: 10px;
    max-width: none;
    top: 10px;
  }

  .notification {
    margin-bottom: 8px;
    padding: 12px;
    border-radius: 6px;
    gap: 10px;
  }
  
  .notification-icon {
    width: 20px;
    height: 20px;
    font-size: 12px;
  }
  
  .notification-title {
    font-size: 14px;
    margin-bottom: 3px;
  }
  
  .notification-message {
    font-size: 13px;
    margin-bottom: 6px;
  }
  
  .notification-time {
    font-size: 11px;
  }
  
  .notification-close {
    width: 24px;
    height: 24px;
    font-size: 14px;
  }
}

/* Mobile nhỏ */
@media (max-width: 480px) {
  .notification-container {
    right: 8px;
    left: 8px;
    top: 8px;
  }

  .notification {
    padding: 10px;
    margin-bottom: 6px;
    border-radius: 4px;
    gap: 8px;
  }
  
  .notification-icon {
    width: 18px;
    height: 18px;
    font-size: 11px;
  }
  
  .notification-title {
    font-size: 13px;
    margin-bottom: 2px;
  }
  
  .notification-message {
    font-size: 12px;
    margin-bottom: 4px;
    line-height: 1.3;
  }
  
  .notification-time {
    font-size: 10px;
  }
  
  .notification-close {
    width: 22px;
    height: 22px;
    font-size: 13px;
  }
  
  .notification-progress {
    height: 2px;
  }
}

/* Mobile rất nhỏ */
@media (max-width: 360px) {
  .notification-container {
    right: 5px;
    left: 5px;
    top: 5px;
  }

  .notification {
    padding: 8px;
    margin-bottom: 5px;
    gap: 6px;
  }
  
  .notification-icon {
    width: 16px;
    height: 16px;
    font-size: 10px;
  }
  
  .notification-title {
    font-size: 12px;
  }
  
  .notification-message {
    font-size: 11px;
    line-height: 1.2;
  }
  
  .notification-time {
    font-size: 9px;
  }
  
  .notification-close {
    width: 20px;
    height: 20px;
    font-size: 12px;
  }
}

/* Touch-friendly improvements */
@media (max-width: 768px) {
  .notification-close {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
  }
  
  .notification-close:hover {
    background: rgba(0, 0, 0, 0.15);
  }
  
  .notification-close:active {
    background: rgba(0, 0, 0, 0.2);
    transform: scale(0.95);
  }
  
  /* Improved focus states for accessibility */
  .notification-close:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
  }
  
  /* Better text wrapping for long messages */
  .notification-message {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
  }
  
  /* Improved contrast for better readability */
  .notification-title {
    color: #1a1a1a;
  }
  
  .notification-message {
    color: #4a4a4a;
  }
  
  .notification-time {
    color: #6a6a6a;
  }
}

/* Animation improvements for mobile */
@media (max-width: 768px) {
  .notification {
    transition: all 0.25s ease;
  }
  
  .notification.show {
    animation: slideInMobile 0.25s ease forwards;
  }
  
  .notification.hide {
    animation: slideOutMobile 0.25s ease forwards;
  }
}

@keyframes slideInMobile {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutMobile {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* Position variants */
.notification-container.top-left {
  top: 20px;
  left: 20px;
  right: auto;
}

.notification-container.top-center {
  top: 20px;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
}

.notification-container.bottom-right {
  top: auto;
  bottom: 20px;
  right: 20px;
}

.notification-container.bottom-left {
  top: auto;
  bottom: 20px;
  left: 20px;
  right: auto;
}

.notification-container.bottom-center {
  top: auto;
  bottom: 20px;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
}

/* Responsive position variants */
@media (max-width: 768px) {
  .notification-container.top-left {
    top: 10px;
    left: 10px;
  }
  
  .notification-container.top-center {
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
  }
  
  .notification-container.bottom-right {
    bottom: 10px;
    right: 10px;
  }
  
  .notification-container.bottom-left {
    bottom: 10px;
    left: 10px;
  }
  
  .notification-container.bottom-center {
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
  }
}

@media (max-width: 480px) {
  .notification-container.top-left {
    top: 8px;
    left: 8px;
  }
  
  .notification-container.top-center {
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
  }
  
  .notification-container.bottom-right {
    bottom: 8px;
    right: 8px;
  }
  
  .notification-container.bottom-left {
    bottom: 8px;
    left: 8px;
  }
  
  .notification-container.bottom-center {
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
  }
}

@media (max-width: 360px) {
  .notification-container.top-left {
    top: 5px;
    left: 5px;
  }
  
  .notification-container.top-center {
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
  }
  
  .notification-container.bottom-right {
    bottom: 5px;
    right: 5px;
  }
  
  .notification-container.bottom-left {
    bottom: 5px;
    left: 5px;
  }
  
  .notification-container.bottom-center {
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
  }
}

/* Size variants */
.notification-container.small .notification {
  padding: 12px;
  font-size: 12px;
}

.notification-container.small .notification-icon {
  width: 20px;
  height: 20px;
  font-size: 12px;
}

.notification-container.large .notification {
  padding: 20px;
  font-size: 16px;
}

.notification-container.large .notification-icon {
  width: 32px;
  height: 32px;
  font-size: 18px;
}

/* Responsive size variants */
@media (max-width: 768px) {
  .notification-container.small .notification {
    padding: 10px;
    font-size: 11px;
  }
  
  .notification-container.small .notification-icon {
    width: 18px;
    height: 18px;
    font-size: 11px;
  }
  
  .notification-container.large .notification {
    padding: 16px;
    font-size: 15px;
  }
  
  .notification-container.large .notification-icon {
    width: 28px;
    height: 28px;
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .notification-container.small .notification {
    padding: 8px;
    font-size: 10px;
  }
  
  .notification-container.small .notification-icon {
    width: 16px;
    height: 16px;
    font-size: 10px;
  }
  
  .notification-container.large .notification {
    padding: 12px;
    font-size: 14px;
  }
  
  .notification-container.large .notification-icon {
    width: 24px;
    height: 24px;
    font-size: 14px;
  }
}

@media (max-width: 360px) {
  .notification-container.small .notification {
    padding: 6px;
    font-size: 9px;
  }
  
  .notification-container.small .notification-icon {
    width: 14px;
    height: 14px;
    font-size: 9px;
  }
  
  .notification-container.large .notification {
    padding: 10px;
    font-size: 13px;
  }
  
  .notification-container.large .notification-icon {
    width: 22px;
    height: 22px;
    font-size: 13px;
  }
}
