@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");

body {
  font-family: "Poppins", sans-serif;
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
  color: #f3f4f6;
}

.container {
  max-width: 3000px;
  margin: auto;
  background-color: #121212;
}

.section-header {
  background: linear-gradient(90deg, rgba(83, 0, 116, 0.3), rgba(0, 0, 0, 0.7));
  border-radius: 8px;
  margin-bottom: 20px;
  padding: 15px 25px;
  box-shadow: 0 4px 15px rgba(138, 43, 226, 0.2);
}

.section-header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(to right, #8a2be2, #ce50ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 10px rgba(138, 43, 226, 0.4);
  margin: 0;
}

.lihat-semua {
  color: #ce50ff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  transition: all 0.3s ease;
}

.lihat-semua:hover {
  color: #fff;
  transform: translateX(5px);
}

.grid {
  display: grid;
  gap: 15px;
  padding: 15px;
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 768px) {
  .grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 992px) {
  .grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(30, 30, 30, 0.5);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom, #8a2be2, #4b0082);
  border-radius: 4px;
}

.comic-card {
  position: relative;
  overflow: visible;
  border-radius: 12px;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.comic-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 12px;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.comic-card:hover::before {
  opacity: 1;
}

.comic-card:hover {
  transform: translateY(-5px) scale(1.02);
  z-index: 10;
}
.comic-card img {
  width: 100%;
  height: 360px;
  object-fit: cover;
  display: block;
  user-select: none;
  pointer-events: none;
}

.comic-content {
  padding: 10px;
  display: flex;
  flex-direction: column;
  min-height: 100px;
}

.comic-card h3 {
  margin: 0;
  padding: 2px 0px 0px 0px;
  font-size: 0.95rem;
  color: #e9e9e9;
  text-decoration: none !important;
  font-weight: bold;
  min-height: 50px;
  max-height: 3em;
  line-height: 1.6em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  margin-bottom: 8px;
  background-color: #121212;
}

.comic-image {
  position: relative;
  display: block;
  width: 100%;
}

.comic-card:hover .comic-image::after {
  opacity: 1;
}

.comic-card:hover h3 {
  color: #fff !important;
}

.comic-card a {
  text-decoration: none !important;
  color: inherit;
  display: block;
}

img.flag-icon {
  display: inline-block !important;
  width: 32px !important;
  height: auto !important;
  position: absolute !important;
  top: 10px !important;
  right: 8px !important;
  padding: 2px !important;
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.2) !important;
  border: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 2 !important;
}

.chapter-badge {
  background: linear-gradient(to right, #8a2be2, #4b0082) !important;
  color: #fff !important;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.85em;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  font-weight: 450;
  min-height: 40px;
  user-select: none;
  margin-top: auto;
}

.chapter-badge .full-text {
  display: inline;
}

.chapter-badge .short-text {
  display: none;
}

@media (max-width: 480px) {
  .chapter-badge .full-text {
    display: none;
  }

  .chapter-badge .short-text {
    display: inline;
  }
}

.read-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 32px;
  color: #ce50ff;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  z-index: 2;
}

.comic-card:hover .read-icon {
  opacity: 1;
  font-size: 36px;
}

.empty-history {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
}

.empty-history i {
  font-size: 4rem;
  color: #8a2be2;
  margin-bottom: 20px;
  display: block;
}

.empty-history h2 {
  font-size: 1.8rem;
  margin-bottom: 15px;
  color: #fff;
}

.empty-history p {
  color: #a0a0a0;
  margin-bottom: 25px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.chapter-info {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chapter-title {
  flex: 1;
  text-align: left;
}

.time-badge {
  font-size: 0.9em;
  margin-left: 4px;
  white-space: nowrap;
}

@media (max-width: 767px) {
  .comic-card img {
    height: 245px;
  }

  .time-badge {
    font-size: 0.85em;
    margin-left: 8px;
  }

  .comic-card h3 {
    font-weight: bold;
    min-height: 10px;
    font-size: 0.85rem;
    max-height: 4em;
    line-height: 1.6em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
  }

  .chapter-badge {
    font-size: 0.75rem;
    padding: 4px 7px;
  }

  .section-header h1 {
    font-size: 1.5rem;
  }

  .lihat-semua {
    font-size: 0.7rem;
  }

  .comic-content {
    min-height: 120px;
  }
}

.login-prompt {
  max-width: 500px;
  margin: auto;
  padding: 40px 20px;
  background: rgba(26, 26, 26, 0.9);
  border-radius: 16px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(206, 80, 255, 0.2);
}

.login-prompt::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle at center,
    rgba(138, 43, 226, 0.1) 0%,
    transparent 70%
  );
  transform: rotate(25deg);
  z-index: 0;
}

.login-prompt h3 {
  font-size: 1.3rem;
  color: #ce50ff;
  margin-bottom: 20px;
  z-index: 1;
  position: relative;
  line-height: 1.5;
  font-weight: 600;
  animation: fadeIn 1s ease-in;
}

.icon {
  font-size: 1rem;
  color: #ce50ff;
  margin-bottom: 20px;
  display: inline-block;
  z-index: 1;
  position: relative;
}

.btn-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(to right, #8a2be2, #ce50ff);
  padding: 10px 20px;
  border-radius: 15px;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 6px 15px rgba(138, 43, 226, 0.4);
  z-index: 1;
  position: relative;
  font-size: 20px;
  font-weight: bold;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.sort-container {
  position: relative;
  display: inline-block;
  margin-right: 15px;
}

.sort-btn {
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  transition: all 0.3s ease;
  border: 1px solid #8a2be2;
  font-size: 0.8rem;
}

.sort-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  background-color: #1a1a1a;
  min-width: 200px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  z-index: 1000;
  margin-top: 5px;
  overflow: hidden;
  border: 1px solid #491c75ff;
}

.sort-dropdown a {
  color: #e9e9e9;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  transition: all 0.2s ease;
  font-size: 0.8rem;
}

.sort-dropdown a:hover {
  background-color: #8a2be2;
  color: white;
}

.sort-dropdown a.active {
  background-color: #6a0dad;
  color: white;
}

.sort-container:hover .sort-dropdown {
  display: block;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.pagination {
  display: flex;
  justify-content: center;
  margin-top: 20px;
  padding-bottom: 20px;
}

.page-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ce50ff;
  padding: 8px 16px;
  text-decoration: none;
  border: 1px solid #8a2be2;
  margin: 0 4px;
  width: 45px;
  height: 45px;
  border-radius: 5px;
  transition: all 0.3s ease;
}

.pagination a:hover {
  background: linear-gradient(to right, #8a2be2, #4b0082);
  color: white;
}

.pagination a.active {
  background: linear-gradient(to right, #8a2be2, #4b0082);
  color: white;
  font-weight: bold;
}

.page-text {
  font-weight: 600;
  font-size: 17px;
}

.page-item.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.page-text.active {
  font-weight: 700;
  color: white;
}

@media (max-width: 480px) {
  .page-item {
    width: 40px;
    height: 40px;
  }

  .page-text {
    font-weight: 600;
    font-size: 15px;
  }
}

@media (max-width: 360px) {
  .page-item {
    width: 35px;
    height: 35px;
  }

  .page-text {
    font-weight: 600;
    font-size: 13px;
  }
}
