/* Drawer Styles */
.chapter-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 10px;
    margin: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
  }



  .chapter-card:hover {
    background: rgba(255, 255, 255, 0.06);
  }

  .chapter-card .thumb img {
    width: 60px;
    height: 100px;
    object-fit: cover;
    border-radius: 5px;
  }

  .chapter-card .info {
    flex: 1;
    min-width: 0;
  }

  .chapter-card .info .title {
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
  }

  .chapter-card .info .meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: #ccc;
  }

  /* VIP badge in drawer */
  .vip-badge {
    font-size: 0.7rem;
    background: #ff2e63;
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    text-decoration: none;
  }

  /* Main List Styles */
  .chapter-box-link {
    display: block;
    text-decoration: none;
    color: inherit;
  }

  .chapter-box-link:hover .box {
    background: rgba(255, 255, 255, 0.064);
  }

  .box {
    min-height: 100px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 6px 10px;
    border-radius: 5px;
  }

  .chapter-thumb img {
    width: 90px;
    height: 120px;
    object-fit: cover;
    object-position: top;
    border-radius: 6px;
  }

  .chapter-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 22px;
    padding: 8px 0;
  }

  .chapter-info a {
    text-decoration: none;
  }

  .chapter-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
  }

  .chapter-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    margin: 0;


    white-space: nowrap;       /* never wrap onto a second line */
     overflow: hidden;          /* hide anything that sticks out */
     text-overflow: ellipsis;   /* show “…” when it’s too long */
     flex: 1;                   /* fill and shrink in its flex container */
     min-width: 0;
  }

  .chapter-coin {
    font-size: 0.75rem;
    color: #ffc107;
    white-space: nowrap;
    margin-left: 12px;
  }

  .chapter-number {
    font-size: 0.78rem;
    color: #ccc;
    margin-top: 2px;
  }

  .chapter-badge-wrapper {
    display: flex;
    align-items: center;
    margin-left: auto;
    height: 100%;
  }

  .chapter-badge {
    font-size: 0.75rem;
    color: gold;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    white-space: nowrap;
  }

  .chapter-badge.read {
    color: #00e676;
  }

  .chapter-badge.coin {
    color: gold;
  }

  /* == Purchase Modal ================================================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001; /* higher than the drawer's 9999 */
  }

  .modal-box {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 20px 10px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.4);
    width: 300px;
    text-align: center;
    color: #fff;
    font-size: 14px;
    transition: all 0.3s ease;
  }

  .modal-buttons {
    margin-top: 20px;
    display: flex;
    justify-content: space-around;
  }
  .btn {
    padding: 8px 16px;
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 0.3px;
    cursor: pointer;
  }
  .cancel-btn {
    background-color: rgba(255, 255, 255, 0.08);
    color: #ccc;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
  }
  .confirm-btn {
    background: rgba(0, 255, 150, 0.08);
    color: #00e676;
    border: 1px solid rgba(0, 255, 150, 0.3);
    border-radius: 6px;
  }
  .spinner {
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top: 4px solid #00e676;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    animation: spin 0.8s linear infinite;
    margin: 10px auto 0;
  }
  @keyframes spin {
    to { transform: rotate(360deg); }
  }

