/* assets/css/style.css */

/* ============ RESET CƠ BẢN ============ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg-main: #020617;
  --bg-card: #02091a;
  --bg-card-soft: #020617;
  --bg-elevated: #02091a;
  --primary: #22c55e;
  --primary-soft: #1d4ed8;
  --primary-soft-hover: #1e40af;
  --text-main: #e5e7eb;
  --text-muted: #9ca3af;
  --border-subtle: #111827;
  --radius-xl: 18px;
  --radius-lg: 14px;
  --radius-pill: 999px;
  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.9);
  --shadow-card: 0 16px 40px rgba(15, 23, 42, 0.7);
  --max-width: 1280px;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
}

/* ============ LAYOUT CHUNG ============ */

.app-root {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 20px 40px;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ============ HEADER / NAVBAR ============ */

.header {
  position: sticky;
  top: 0;
  z-index: 300;
  /* header nằm trên nội dung */
  background: linear-gradient(to bottom, #020617ee, #020617f0, #02061700);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid #020617;
  /* KHÔNG overflow để dropdown rơi ra ngoài */
}

.navbar {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  font-size: 18px;
}

.logo-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: radial-gradient(circle at 20% 0, #22c55e, #16a34a);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #022c22;
  font-size: 16px;
}

.nav-center {
  flex: 1;
  display: flex;
  justify-content: center;
}

.search-bar {
  width: 100%;
  max-width: 480px;
  display: flex;
  background-color: #020617;
  border-radius: var(--radius-pill);
  border: 1px solid #1f2933;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.7);
}

.search-input {
  flex: 1;
  padding: 10px 16px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 14px;
}

.search-input::placeholder {
  color: #6b7280;
}

.search-btn {
  border: none;
  padding: 0 18px;
  background: #22c55e;
  color: #022c22;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.search-btn:hover {
  background: #16a34a;
}

.nav-right {
  display: flex;
  gap: 12px;
  align-items: center;
}

.nav-link {
  font-size: 13px;
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
}

.nav-link:hover {
  color: #e5e7eb;
  background-color: #020617;
}

.nav-login {
  padding: 7px 14px;
  border-radius: 999px;
  background: #22c55e1a;
  color: var(--primary);
  border: 1px solid #16a34a55;
  font-size: 13px;
  cursor: pointer;
}

.nav-login:hover {
  background: #22c55e33;
}

/* ========== ACCOUNT BUTTON / AVATAR ========== */

#authArea {
  margin-left: 16px;
}

.nav-account {
  position: relative;
}

.nav-account-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(0, 255, 102, 0.35);
  background: rgba(0, 0, 0, 0.35);
  cursor: pointer;
  color: #e5f9ff;
  font-size: 14px;
}

.nav-account-toggle:hover {
  background: rgba(0, 255, 102, 0.12);
}

.nav-avatar {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: linear-gradient(135deg, #00ff95, #00b8ff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #02111f;
}

.nav-account-name {
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-account-caret {
  font-size: 11px;
  opacity: 0.7;
}

.nav-right .nav-link{
  text-decoration: none;
  display: inline-block;
  white-space: nowrap;
  color: var(--text-muted);
}

.nav-right .nav-link:hover{
  color: #e5e7eb;
  background-color: #020617;
}


/* dropdown tài khoản – phải nằm cao hơn dropdown thể loại */
.nav-account-menu {
  position: absolute;
  top: 105%;
  right: 0;
  min-width: 190px;
  background: #050b18;
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
  padding: 8px 0;
  border: 1px solid rgba(0, 255, 102, 0.16);
  display: none;
  z-index: 400;
}

.nav-account-menu.open {
  display: block;
}

.account-menu-item {
  width: 100%;
  padding: 8px 14px;
  font-size: 14px;
  color: #e5f9ff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
}

.account-menu-item span.icon {
  width: 18px;
  text-align: center;
}

.account-menu-item:hover {
  background: rgba(0, 255, 102, 0.14);
}

/* ============ MAIN MENU (DƯỚI NAVBAR) ============ */

.main-menu {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: linear-gradient(to bottom, #111827, #020617);
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  padding: 0 3rem;
  position: relative;
  /* mốc cho dropdown-panel */
  z-index: 350;
  /* trên nội dung bên dưới */
  /* KHÔNG đặt overflow-x/overflow-y để dropdown không bị cắt */
}

.menu-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 1.1rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #e5e7eb;
  text-decoration: none;
  cursor: pointer;
  border-right: 1px solid rgba(55, 65, 81, 0.6);
  white-space: nowrap;
  position: relative;
}

.menu-item:first-child {
  border-left: 1px solid rgba(55, 65, 81, 0.6);
}

.menu-item:hover {
  background: rgba(15, 23, 42, 0.95);
}

.menu-item.active {
  background: #020617;
  color: #38bdf8;
  box-shadow: inset 0 -2px 0 #38bdf8;
}

.menu-icon {
  font-size: 1.1rem;
}

/* ========= DROPDOWN THỂ LOẠI – ĐÈ LÊN NỘI DUNG ========= */

.menu-dropdown {
  position: relative;
  /* cha của dropdown-panel */
}

/* Panel dropdown: tuyệt đối, overlay, KHÔNG đẩy layout, KHÔNG bị giam */
.menu-dropdown .dropdown-panel {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0;
  min-width: 260px;
  background: #050b18;
  border-radius: 10px;
  box-shadow: 0 18px 35px rgba(0, 0, 0, 0.55);
  padding: 16px 22px;
  display: none;
  /* mặc định ẩn */
  z-index: 360;
  /* trên .main-menu (350) và trên card truyện */
  border: 1px solid rgba(148, 163, 184, 0.35);
}

/* Khi có class .open (JS toggle) => hiện */
.menu-dropdown.open .dropdown-panel {
  display: flex;
}

/* Trên PC: hover vào ô THỂ LOẠI cũng mở cho tiện */
@media (hover: hover) and (pointer: fine) {
  .menu-dropdown:hover .dropdown-panel {
    display: flex;
  }
}

/* Bố cục 4 cột bên trong dropdown */
.dropdown-cols {
  display: flex;
  gap: 32px;
}

.dropdown-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 150px;
}

/* item thể loại */
.dropdown-item {
  display: block;
  padding: 0.6rem 0.9rem;
  font-size: 0.88rem;
  color: #e5e7eb;
  text-decoration: none;
  white-space: nowrap;
  border-radius: 6px;
}

.dropdown-item:hover {
  background: rgba(51, 65, 85, 0.85);
}

/* item nhấn mạnh (màu cam) */
.dropdown-item.highlight,
.dropdown-item.strong {
  color: #ff6a3d;
  font-weight: 600;
}

/* Responsive main menu */
@media (max-width: 768px) {
  .main-menu {
    padding: 0 1rem;
  }

  .menu-item {
    font-size: 0.8rem;
    padding: 0.6rem 0.8rem;
  }
}

/* ============ SECTION / TITLES ============ */

.section {
  margin-top: 26px;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
}

.section-title {
  font-size: 20px;
  font-weight: 800;
}

.section-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

/* ============ COMIC GRID & CARDS ============ */

.comic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 18px;
}

.comic-card {
  background: radial-gradient(circle at top left, #0f172a, #020617);
  border-radius: var(--radius-xl);
  padding: 10px 10px 12px;
  border: 1px solid rgba(15, 23, 42, 0.9);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease,
    border-color 0.14s ease;
}

.comic-card:hover {
  transform: translateY(-5px);
  border-color: #1d4ed8;
  box-shadow: 0 22px 45px rgba(15, 23, 42, 0.95);
}

.comic-thumb-wrapper {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #020617;
  aspect-ratio: 3/4;
  margin-bottom: 8px;
}

.comic-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.badge-top-left {
  position: absolute;
  left: 8px;
  top: 8px;
  background: #1d4ed8;
  color: #e5e7eb;
  border-radius: 999px;
  font-size: 10px;
  padding: 4px 8px;
  font-weight: 600;
}

.badge-top-right {
  position: absolute;
  right: 8px;
  top: 8px;
  background: rgba(15, 23, 42, 0.8);
  color: #e5e7eb;
  border-radius: 999px;
  font-size: 10px;
  padding: 4px 8px;
}

.comic-info {
  margin-top: 2px;
}

.comic-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
  line-height: 1.25;
}

.comic-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-muted);
  gap: 8px;
}

/* strip ngang trên home */
.comic-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
}

/* card Xem thêm */
.more-card {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.4);
  border: 1px dashed rgba(255, 255, 255, 0.2);
}

.more-card-inner {
  text-align: center;
}

.more-arrow {
  font-size: 24px;
  margin-bottom: 4px;
}

.more-text {
  font-weight: 600;
}

/* ============ TEXT HELPER ============ */

.text-muted {
  color: var(--text-muted);
  font-size: 13px;
}

.text-center {
  text-align: center;
}

/* ============ DETAIL PAGE ============ */

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
  gap: 26px;
  align-items: flex-start;
}

.detail-left {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 14px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
}

.detail-thumb {
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 10px;
}

.detail-thumb img {
  width: 100%;
  display: block;
  object-fit: cover;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-pill {
  padding: 4px 9px;
  border-radius: 999px;
  background: #020617;
  border: 1px solid #111827;
  font-size: 11px;
  color: var(--text-muted);
}

.tag-status {
  background: #16a34a1c;
  border-color: #22c55e55;
  color: #a7f3d0;
}

.detail-right {
  background: var(--bg-card-soft);
  border-radius: var(--radius-xl);
  padding: 18px 18px 14px;
  border: 1px solid rgba(15, 23, 42, 0.8);
  box-shadow: var(--shadow-soft);
}

.detail-title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 4px;
}

.detail-other-name {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* meta row (lượt xem) */
.detail-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.detail-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(2, 6, 23, 0.55);
}

.detail-section-title {
  font-size: 15px;
  font-weight: 700;
  margin: 12px 0 6px;
}

.detail-description {
  font-size: 14px;
  color: var(--text-main);
  line-height: 1.5;
}

.chapter-list {
  margin-top: 10px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #020617;
  background: #020617;
}

.chapter-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  font-size: 13px;
  border-bottom: 1px solid #02091a;
  cursor: pointer;
}

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

.chapter-item:hover {
  background: #020b26;
}

.chapter-name {
  color: var(--text-main);
}

.chapter-meta {
  font-size: 11px;
  color: var(--text-muted);
}

.btn-read {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  border: none;
  background: var(--primary-soft);
  color: #e5e7eb;
  cursor: pointer;
}

.btn-read:hover {
  background: var(--primary-soft-hover);
}

/* ===== NÚT FOLLOW (CSS CŨ) ===== */
.btn-follow-heart {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  background: linear-gradient(135deg, #ff4b6b, #ff8a4b);
  color: #fff;
  box-shadow: 0 0 18px rgba(255, 75, 107, 0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease,
    background 0.2s ease, filter 0.15s ease;
}

.btn-follow-heart:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 0 22px rgba(255, 75, 107, 0.6);
}

.btn-follow-heart span#followIcon {
  font-size: 18px;
}

.btn-follow-heart.following {
  background: rgba(46, 204, 113, 0.18);
  color: #2ecc71;
  box-shadow: 0 0 18px rgba(46, 204, 113, 0.5);
}

/* ===== FIX: nút Theo dõi nằm bên phải & ngang hàng LƯỢT XEM (không sửa HTML) ===== */
.detail-title-row {
  display: flex;
  align-items: stretch;
  /* để nút có thể canh theo đáy khối trái */
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* khối trái (title + other + meta) */
.detail-title-row>div:first-child {
  flex: 1 1 520px;
  min-width: 260px;
  display: flex;
  flex-direction: column;
}

/* nút theo dõi: đẩy sang phải + canh xuống ngang LƯỢT XEM */
.detail-title-row>#followBtn {
  margin-left: auto;
  flex: 0 0 auto;
  align-self: flex-end;
  /* điểm mấu chốt: ngang hàng meta (lượt xem) */
}

/* ============ READER (chapter.html) ============ */

.reader-header {
  padding: 12px 20px;
  border-bottom: 1px solid #020617;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.reader-title {
  font-size: 15px;
  font-weight: 600;
}

.reader-main {
  max-width: 980px;
  margin: 18px auto 40px;
  padding: 0 10px 40px;
  background: radial-gradient(circle at top, #02091a, #020617);
  border-radius: 24px 24px 12px 12px;
  box-shadow: var(--shadow-soft);
  border: 1px solid #02091a;
}

.reader-chapter-title {
  text-align: center;
  padding: 14px 10px 8px;
  font-weight: 700;
}

.reader-images {
  padding: 0 10px 24px;
}

.reader-images img {
  width: 100%;
  max-width: 900px;
  display: block;
  margin: 0 auto 12px;
  border-radius: 4px;
}

.reader-toolbar {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 10px 0 18px;
}

.btn-secondary {
  padding: 7px 16px;
  border-radius: 999px;
  background: #020617;
  border: 1px solid #1f2933;
  color: var(--text-main);
  font-size: 13px;
  cursor: pointer;
}

.btn-secondary:hover {
  background: #020b26;
}

/* ============ MODAL CHỌN CHƯƠNG ============ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 60;
}

.modal-backdrop.active {
  display: flex;
}

.modal {
  width: min(520px, 90vw);
  max-height: 80vh;
  background: #02091a;
  border-radius: 18px;
  border: 1px solid #020617;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 10px 16px;
  border-bottom: 1px solid #020617;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 14px;
  font-weight: 700;
}

.modal-close {
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  color: var(--text-muted);
}

.modal-body {
  padding: 8px 0 4px;
  overflow-y: auto;
}

.modal-body .chapter-item {
  border-radius: 0;
}

/* ============ RESPONSIVE CHUNG ============ */

@media (max-width: 800px) {
  .navbar {
    padding-inline: 14px;
  }

  .nav-right {
    display: none;
  }

  .detail-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .detail-left {
    order: 1;
  }

  .detail-right {
    order: 2;
  }

  .reader-main {
    border-radius: 0;
    box-shadow: none;
    border: none;
  }
}

/* ============ PHÂN TRANG ============ */

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin: 2rem 0 3rem;
  flex-wrap: wrap;
}

.page-btn {
  min-width: 36px;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: #e5e7eb;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.page-btn:hover:not(:disabled) {
  border-color: rgba(56, 189, 248, 0.8);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.page-btn.active {
  background: linear-gradient(135deg, #1d4ed8, #22c55e);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.5);
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

/* ============ FOOTER ============ */

.site-footer {
  margin-top: 3rem;
  background: radial-gradient(circle at top, #0f172a 0, #020617 60%);
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  padding: 2.5rem 3rem 1.5rem;
  color: #9ca3af;
  font-size: 0.92rem;
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 2fr) minmax(0, 3fr);
  gap: 2rem;
}

.footer-col h4 {
  margin-bottom: 0.75rem;
  color: #e5e7eb;
  font-size: 1rem;
}

.footer-logo {
  font-size: 1.4rem;
  font-weight: 800;
  color: #22c55e;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

.footer-disclaimer p+p {
  margin-top: 0.5rem;
}

.site-footer a {
  color: #38bdf8;
  text-decoration: none;
}

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

.footer-bottom {
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  margin-top: 1.5rem;
  padding-top: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: #6b7280;
}

@media (max-width: 900px) {
  .site-footer {
    padding: 2rem 1.25rem 1.5rem;
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ===== AUTH PAGES (login / register) – GIAO DIỆN CŨ ===== */

.auth-main {
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  border-radius: 24px;
  padding: 28px 24px 24px;
  background: radial-gradient(circle at top left,
      rgba(56, 189, 248, 0.12),
      transparent 55%),
    radial-gradient(circle at bottom right,
      rgba(34, 197, 94, 0.12),
      transparent 55%),
    #020617;
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.9);
}

.auth-card-header {
  margin-bottom: 20px;
}

.auth-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: #e5e7eb;
  margin-bottom: 6px;
}

.auth-subtitle {
  font-size: 0.9rem;
  color: #9ca3af;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 4px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-field label {
  font-size: 0.85rem;
  color: #cbd5f5;
}

.auth-field input {
  background: rgba(15, 23, 42, 0.9);
  border-radius: 999px;
  border: 1px solid rgba(51, 65, 85, 0.9);
  padding: 10px 14px;
  color: #e5e7eb;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease,
    background 0.15s ease;
}

.auth-field input::placeholder {
  color: #64748b;
}

.auth-field input:focus {
  border-color: #22c55e;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.5);
  background: rgba(15, 23, 42, 1);
}

.auth-btn {
  margin-top: 4px;
  width: 100%;
  border-radius: 999px;
  border: none;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  background: linear-gradient(135deg, #22c55e, #22d3ee);
  color: #020617;
  box-shadow: 0 10px 30px rgba(34, 197, 94, 0.35);
  transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.1s ease;
}

.auth-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 16px 40px rgba(34, 197, 94, 0.45);
}

.auth-btn:active {
  transform: translateY(0);
  box-shadow: 0 8px 22px rgba(34, 197, 94, 0.4);
}

.auth-switch {
  margin-top: 16px;
  text-align: center;
  font-size: 0.9rem;
  color: #9ca3af;
}

.auth-switch a {
  color: #38bdf8;
  font-weight: 500;
}

.auth-switch a:hover {
  text-decoration: underline;
}

.auth-message {
  margin-top: 8px;
  font-size: 0.85rem;
  text-align: center;
  min-height: 18px;
  color: #e5e7eb;
}

.auth-message.error {
  color: #f97373;
}

.auth-message.success {
  color: #4ade80;
}

@media (max-width: 640px) {
  .auth-card {
    padding: 22px 18px 20px;
    border-radius: 18px;
  }
}

/* ===== LỊCH SỬ / NÚT PHỤ (cũ) ===== */

.history-continue {
  font-size: 12px;
  color: #cbd5f5;
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  transition: background 0.2s ease, color 0.2s ease, transform 0.1s ease;
}

.history-continue:hover {
  background: rgba(59, 130, 246, 0.25);
  color: #ffffff;
  transform: translateY(-1px);
}

.history-remove {
  border: 1px solid rgba(248, 113, 113, 0.7);
  background: rgba(15, 23, 42, 0.9);
  color: #fecaca;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease,
    transform 0.1s ease, box-shadow 0.2s ease;
}

.history-remove:hover {
  background: rgba(248, 113, 113, 0.15);
  border-color: rgb(248, 113, 113);
  color: #fee2e2;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.history-remove:active {
  transform: translateY(0);
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
}

/* ========== account dropdown ở nav-right (nếu dùng trong nội dung khác) ========== */

.account-menu {
  position: relative;
}

.account-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
}

.account-avatar {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #5b4bff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.account-name {
  max-width: 120px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.account-caret {
  font-size: 10px;
  opacity: 0.7;
}

.account-dropdown {
  position: absolute;
  top: 110%;
  right: 0;
  min-width: 180px;
  padding: 6px 0;
  border-radius: 8px;
  background: #121420;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: none;
  z-index: 50;
}

.account-dropdown.open {
  display: block;
}

.account-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 14px;
  color: #e0e6ff;
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
}

.account-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* ===== FIX: dropdown tài khoản không bị main-menu đè (GIỮ NGUYÊN) ===== */

/* tạo layer riêng cho navbar cao hơn main-menu */
.navbar {
  position: relative;
  z-index: 500;
  /* > main-menu (350) */
}

/* đảm bảo cụm account nằm trên */
#authArea,
.nav-account {
  position: relative;
  z-index: 600;
}

/* menu xổ xuống phải cao nhất trong header */
.nav-account-menu {
  z-index: 700;
  /* > navbar(500) > main-menu(350) */
}

/* ===== XẾP HẠNG DROPDOWN ===== */
.rank-panel { min-width: 420px; }
.rank-panel .dropdown-cols { gap: 18px; }
.rank-panel .dropdown-col { min-width: 190px; }
.dd-ico { display:inline-block; width: 20px; text-align:center; margin-right: 6px; opacity: .9; }

/* ===== TRANG XẾP HẠNG: layout trái + bảng top bên phải ===== */
.ranking-layout{
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}
@media (max-width: 980px){
  .ranking-layout{ grid-template-columns: 1fr; }
}

.rank-sidebar{
  position: sticky;
  top: 120px; /* dưới header */
}

.rank-box{
  background: radial-gradient(circle at top, #0f172a, #020617);
  border: 1px solid rgba(148,163,184,.18);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.rank-tabs{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: rgba(255,255,255,.04);
}
.rank-tab{
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: #e5e7eb;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: .02em;
  border-top: 2px solid transparent;
  border-left: 1px solid rgba(255,255,255,.06);
}
.rank-tab:first-child{ border-left: none; }
.rank-tab.active{
  color: #f59e0b;
  border-top-color: #ef4444;
  background: rgba(0,0,0,.25);
}

.rank-list{ padding: 8px 0; }

.rank-item{
  display: grid;
  grid-template-columns: 46px 56px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 12px;
  border-top: 1px solid rgba(255,255,255,.06);
  cursor: pointer;
}
.rank-item:hover{ background: rgba(255,255,255,.04); }

.rank-no{
  font-size: 26px;
  font-weight: 900;
  opacity: .85;
  align-self: center;
  text-align: center;
}
.rank-no.top1{ color: #38bdf8; }
.rank-no.top2{ color: #22c55e; }
.rank-no.top3{ color: #fb923c; }

.rank-cover{
  width: 56px;
  height: 56px;
  border-radius: 10px;
  overflow: hidden;
  background: #020617;
  border: 1px solid rgba(255,255,255,.08);
}
.rank-cover img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display:block;
}
.rank-info{ min-width:0; }
.rank-title{
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rank-sub{
  margin-top: 4px;
  display:flex;
  justify-content: space-between;
  gap: 10px;
  color: #9ca3af;
  font-size: 13px;
}
.rank-views{ opacity: .85; }

