.bookmark-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  background-color: rgba(0, 0, 0, 0.7);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2;
  border: 2px solid transparent;
  backdrop-filter: blur(4px);
}

body.dark-mode .bookmark-badge {
  background-color: rgba(255, 255, 255, 0.2);
}

/* ========================================
   HOVER STATE
======================================== */

.bookmark-badge:hover {
  background-color: rgba(255, 107, 107, 0.9);
  transform: scale(1.1);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

body.dark-mode .bookmark-badge:hover {
  background-color: rgba(255, 107, 107, 0.95);
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.5);
}

/* ========================================
   ACTIVE STATE (Đã bookmark)
======================================== */

.bookmark-badge.active {
  background-color: var(--accent-color) !important;
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 12px rgba(74, 158, 255, 0.3);
}

body.dark-mode .bookmark-badge.active {
  background-color: var(--accent-color) !important;
  box-shadow: 0 4px 12px rgba(74, 158, 255, 0.3);
}

.bookmark-badge.active:hover {
  background-color: var(--accent-color) !important;
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(74, 158, 255, 0.3);
}

body.dark-mode .bookmark-badge.active:hover {
  box-shadow: 0 4px 12px rgba(74, 158, 255, 0.3);
}

/* ========================================
   ICON STYLES
======================================== */

.bookmark-badge i {
  font-size: 14px;
  transition: all 0.2s ease;
  pointer-events: none;
}

.bookmark-badge.active i {
  font-size: 15px;
  font-weight: 900;
}

/* ========================================
   LOADING STATE
======================================== */

.bookmark-badge.loading {
  opacity: 0.6;
  pointer-events: none;
  cursor: wait;
}

.bookmark-badge.loading i {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ========================================
   ANIMATION EFFECTS
======================================== */

@keyframes bookmarkPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.3);
  }
  100% {
    transform: scale(1);
  }
}

.bookmark-badge.animating {
  animation: bookmarkPulse 0.3s ease;
}

@keyframes bookmarkSuccess {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(255, 107, 107, 0);
  }
  50% {
    transform: scale(1.2);
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.8);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 12px rgba(255, 107, 107, 0.6);
  }
}

.bookmark-badge.success {
  animation: bookmarkSuccess 0.5s ease;
}

/* ========================================
   RESPONSIVE STYLES
======================================== */

@media (max-width: 1023px) {
  .bookmark-badge {
    width: 30px;
    height: 30px;
    font-size: 13px;
  }

  .bookmark-badge i {
    font-size: 13px;
  }

  .bookmark-badge.active i {
    font-size: 14px;
  }
}

@media (max-width: 767px) {
  .bookmark-badge {
    width: 28px;
    height: 28px;
    font-size: 12px;
    top: 6px;
    right: 6px;
  }

  .bookmark-badge i {
    font-size: 12px;
  }

  .bookmark-badge.active i {
    font-size: 13px;
  }
}

@media (max-width: 390px) {
  .bookmark-badge {
    width: 26px;
    height: 26px;
    font-size: 11px;
  }

  .bookmark-badge i {
    font-size: 11px;
  }

  .bookmark-badge.active i {
    font-size: 12px;
  }
}

/* ========================================
   TOAST NOTIFICATION STYLES
======================================== */

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 20px;
  background: var(--bg-secondary, #fff);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 250px;
  max-width: 400px;
  pointer-events: auto;
  backdrop-filter: blur(10px);
}

body.dark-mode .toast {
  background: var(--bg-secondary-dark, #1a1a1a);
  color: var(--text-primary-dark, #e0e0e0);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

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

.toast i {
  font-size: 18px;
  flex-shrink: 0;
}

.toast-success {
  border-left: 4px solid #4caf50;
}

.toast-success i {
  color: #4caf50;
}

.toast-error {
  border-left: 4px solid #f44336;
}

.toast-error i {
  color: #f44336;
}

.toast-info {
  border-left: 4px solid #2196f3;
}

.toast-info i {
  color: #2196f3;
}

.toast-warning {
  border-left: 4px solid #ff9800;
}

.toast-warning i {
  color: #ff9800;
}

@media (max-width: 767px) {
  .toast-container {
    top: 10px;
    right: 10px;
    left: 10px;
  }

  .toast {
    padding: 12px 15px;
    font-size: 13px;
    min-width: auto;
    max-width: none;
  }

  .toast i {
    font-size: 16px;
  }
}

/* ========================================
   BOOKMARK COUNT BADGE (Optional)
======================================== */

.bookmark-count {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background-color: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.3);
  border-radius: 12px;
  color: #ff6b6b;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.3s ease;
}

body.dark-mode .bookmark-count {
  background-color: rgba(255, 107, 107, 0.15);
  border-color: rgba(255, 107, 107, 0.4);
}

.bookmark-count:hover {
  background-color: rgba(255, 107, 107, 0.2);
  border-color: rgba(255, 107, 107, 0.5);
}

.bookmark-count i {
  font-size: 11px;
}

/* ========================================
   COMPATIBILITY FIXES
======================================== */

.comic-card .bookmark-badge {
}

@media (hover: none) and (pointer: coarse) {
  .bookmark-badge:hover {
    background-color: rgba(0, 0, 0, 0.7);
    transform: scale(1);
  }

  .bookmark-badge.active:hover {
    background-color: #ff6b6b !important;
  }
}

.bookmark-badge {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

@media (prefers-contrast: high) {
  .bookmark-badge {
    border: 2px solid #fff;
  }

  .bookmark-badge.active {
    border-color: #fff;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bookmark-badge,
  .bookmark-badge i,
  .toast {
    transition: none;
    animation: none;
  }
}
