/* =========================================================
   NovelVexa Chapter UI
   Exact Madara chapter markup
   ========================================================= */


/* ---------------------------------------------------------
   CHAPTER ROW
   --------------------------------------------------------- */

.listing-chapters_wrap ul.main li.wp-manga-chapter {
    display: grid !important;

    grid-template-columns: minmax(0, 1fr) 125px !important;
    grid-template-rows: auto auto !important;

    grid-template-areas:
        "title action"
        "date action" !important;

    column-gap: 25px !important;
    row-gap: 3px !important;

    align-items: center !important;

    width: 100% !important;

    min-height: 68px !important;

    margin: 0 !important;
    padding: 13px 0 !important;

    box-sizing: border-box !important;

    position: relative !important;

    float: none !important;

    overflow: visible !important;
}


/* ---------------------------------------------------------
   CHAPTER TITLE
   --------------------------------------------------------- */

.listing-chapters_wrap
ul.main
li.wp-manga-chapter
> a {

    grid-area: title !important;

    display: block !important;

    width: 100% !important;
    max-width: none !important;

    margin: 0 !important;
    padding: 0 !important;

    font-size: 15px !important;
    font-weight: 600 !important;

    line-height: 1.35 !important;

    text-align: left !important;

    text-decoration: none !important;

    border: 0 !important;

    background: none !important;
}


/*
 * Prevent Madara visited/hover decoration.
 */
.listing-chapters_wrap
ul.main
li.wp-manga-chapter
> a:hover,
.listing-chapters_wrap
ul.main
li.wp-manga-chapter
> a:focus,
.listing-chapters_wrap
ul.main
li.wp-manga-chapter
> a:visited {

    text-decoration: none !important;

    border: 0 !important;
}


/* ---------------------------------------------------------
   CHAPTER DATE
   --------------------------------------------------------- */

.listing-chapters_wrap
ul.main
li.wp-manga-chapter
> .chapter-release-date {

    grid-area: date !important;

    display: block !important;

    position: static !important;

    float: none !important;

    clear: none !important;

    width: auto !important;

    margin: 0 !important;
    padding: 0 !important;

    text-align: left !important;

    font-size: 12px !important;

    line-height: 1.3 !important;
}


/*
 * Date itself.
 */
.listing-chapters_wrap
ul.main
li.wp-manga-chapter
> .chapter-release-date
> i {

    display: inline !important;

    margin: 0 !important;
    padding: 0 !important;

    font-size: 12px !important;

    font-style: normal !important;

    line-height: 1.3 !important;
}


/* ---------------------------------------------------------
   NOVELVEXA ACTION
   --------------------------------------------------------- */

.listing-chapters_wrap
ul.main
li.wp-manga-chapter
> .novelvexa-chapter-action {

    grid-area: action !important;

    display: flex !important;

    align-items: center !important;
    justify-content: center !important;

    width: 125px !important;
    min-width: 125px !important;

    height: 42px !important;

    margin: 0 !important;
    padding: 0 !important;

    position: static !important;

    float: none !important;

    align-self: center !important;

    box-sizing: border-box !important;

    z-index: 5 !important;
}


/* ---------------------------------------------------------
   BUTTONS
   --------------------------------------------------------- */

.novelvexa-unlock-button,
.novelvexa-read-button,
.novelvexa-login-button {

    display: inline-flex !important;

    align-items: center !important;
    justify-content: center !important;

    width: 120px !important;
    min-width: 120px !important;

    height: 42px !important;
    min-height: 42px !important;

    margin: 0 !important;
    padding: 0 12px !important;

    box-sizing: border-box !important;

    border: 0 !important;
    border-radius: 7px !important;

    outline: 0 !important;

    font-family: inherit !important;
    font-size: 14px !important;
    font-weight: 600 !important;

    line-height: 1 !important;

    text-align: center !important;

    text-decoration: none !important;
    text-decoration-line: none !important;

    white-space: nowrap !important;

    cursor: pointer !important;

    box-shadow: none !important;

    vertical-align: middle !important;

    appearance: none !important;
    -webkit-appearance: none !important;
}


/* ---------------------------------------------------------
   UNLOCK
   --------------------------------------------------------- */

.novelvexa-unlock-button {
    background: #338af3 !important;
    color: #ffffff !important;
}

.novelvexa-unlock-button:hover,
.novelvexa-unlock-button:focus,
.novelvexa-unlock-button:active {
    background: #338af3 !important;
    color: #ffffff !important;
    text-decoration: none !important;
}


/* ---------------------------------------------------------
   READ
   --------------------------------------------------------- */

.novelvexa-read-button {
    background: #4120a0 !important;
    color: #ffffff !important;
}

.novelvexa-read-button:hover,
.novelvexa-read-button:focus,
.novelvexa-read-button:active {
    background: #4120a0 !important;
    color: #ffffff !important;
    text-decoration: none !important;
}


/* ---------------------------------------------------------
   LOGIN
   --------------------------------------------------------- */

.novelvexa-login-button {
    background: #338af3 !important;
    color: #ffffff !important;
}

.novelvexa-login-button:hover,
.novelvexa-login-button:focus,
.novelvexa-login-button:active {
    background: #338af3 !important;
    color: #ffffff !important;
    text-decoration: none !important;
}


/* ---------------------------------------------------------
   GEM ICON
   --------------------------------------------------------- */

.novelvexa-unlock-button img.emoji {
    display: inline-block !important;

    width: 16px !important;
    height: 16px !important;

    margin: 0 5px 0 0 !important;

    vertical-align: middle !important;
}


/* ---------------------------------------------------------
   REMOVE THEME DECORATION INSIDE BUTTON
   --------------------------------------------------------- */

.novelvexa-unlock-button *,
.novelvexa-read-button *,
.novelvexa-login-button * {
    text-decoration: none !important;
}


/* ---------------------------------------------------------
   LOADING
   --------------------------------------------------------- */

.novelvexa-unlock-button:disabled {
    opacity: 0.65 !important;
    cursor: wait !important;
}


/* ---------------------------------------------------------
   MOBILE
   --------------------------------------------------------- */

@media (max-width: 767px) {

    .listing-chapters_wrap
    ul.main
    li.wp-manga-chapter {

        grid-template-columns:
            minmax(0, 1fr)
            105px !important;

        column-gap: 12px !important;

        min-height: 64px !important;

        padding: 11px 0 !important;
    }

    .listing-chapters_wrap
    ul.main
    li.wp-manga-chapter
    > .novelvexa-chapter-action {

        width: 105px !important;
        min-width: 105px !important;
    }

    .novelvexa-unlock-button,
    .novelvexa-read-button,
    .novelvexa-login-button {

        width: 105px !important;
        min-width: 105px !important;

        height: 40px !important;
        min-height: 40px !important;

        font-size: 13px !important;
    }
}


/* ---------------------------------------------------------
   SMALL MOBILE
   --------------------------------------------------------- */

@media (max-width: 480px) {

    .listing-chapters_wrap
    ul.main
    li.wp-manga-chapter {

        grid-template-columns: 1fr !important;

        grid-template-rows:
            auto
            auto
            auto !important;

        grid-template-areas:
            "title"
            "date"
            "action" !important;

        gap: 4px !important;

        min-height: 0 !important;

        padding: 12px 0 !important;
    }

    .listing-chapters_wrap
    ul.main
    li.wp-manga-chapter
    > .novelvexa-chapter-action {

        justify-self: start !important;

        width: 105px !important;
        min-width: 105px !important;
    }

}

/* =========================================================
   Clean chapter dividers
   ========================================================= */

.listing-chapters_wrap
ul.main
li.wp-manga-chapter {
    border-bottom: 0 !important;
    position: relative !important;
}

.listing-chapters_wrap
ul.main
li.wp-manga-chapter::after {
    content: "";
    position: absolute;

    left: 0;
    right: 0;
    bottom: 0;

    height: 1px;

    background: rgba(255, 255, 255, 0.08);

    z-index: 0;
}

/* Keep chapter content above divider */
.novelvexa-chapter-content {
    position: relative !important;
    z-index: 2 !important;
}

/* Keep button completely above divider */
.novelvexa-chapter-action {
    position: relative !important;
    z-index: 3 !important;

    background: #1d1e25 !important;

    border-radius: 8px !important;
}

/* =========================================================
   Final chapter-list polish
   ========================================================= */

/* Slightly more breathing room between title and date */
.novelvexa-chapter-content > .chapter-release-date {
    margin-top: 7px !important;
}

/* Remove stray/generated icon around the Read action */
.novelvexa-chapter-action::before,
.novelvexa-chapter-action::after {
    display: none !important;
    content: none !important;
}

.novelvexa-chapter-action i,
.novelvexa-chapter-action .fa,
.novelvexa-chapter-action .fas,
.novelvexa-chapter-action .far {
    display: none !important;
}

/* =========================================================
   Final chapter-row fixes
   ========================================================= */

/* Space between chapter title and date */
.listing-chapters_wrap
ul.main
li.wp-manga-chapter
> .chapter-release-date {
    display: block !important;
    margin-top: 7px !important;
}

/* Remove Madara's current-reading icon */
.listing-chapters_wrap
ul.main
li.wp-manga-chapter.reading::before {
    display: none !important;
    content: none !important;
}

/* Also prevent any reading pseudo-element from reserving space */
.listing-chapters_wrap
ul.main
li.wp-manga-chapter.reading::after {
    content: none !important;
}

/* Final spacing polish */

.listing-chapters_wrap
ul.main
li.wp-manga-chapter {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
}

.listing-chapters_wrap
ul.main
li.wp-manga-chapter
> .chapter-release-date {
    margin-top: 6px !important;
    font-size: 11px !important;
    opacity: 0.75 !important;
}

.novelvexa-chapter-action {
    margin-left: 8px !important;
}

.novelvexa-unlock-button,
.novelvexa-read-button {
    height: 40px !important;
    min-height: 40px !important;
}

/* =========================================================
   NOVELVEXA INSUFFICIENT GEMS TOAST
   ========================================================= */

.novelvexa-toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 999999;

    display: flex;
    align-items: center;
    gap: 16px;

    width: min(430px, calc(100vw - 32px));

    padding: 16px 18px;

    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;

    background: rgba(25, 25, 30, 0.96);

    box-shadow:
        0 12px 35px rgba(0, 0, 0, 0.25);

    opacity: 0;
    transform: translateY(18px);

    transition:
        opacity 0.25s ease,
        transform 0.25s ease;

    box-sizing: border-box;
}

.novelvexa-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.novelvexa-toast-content {
    flex: 1;
    min-width: 0;
}

.novelvexa-toast-title {
    margin-bottom: 4px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
}

.novelvexa-toast-message {
    font-size: 13px;
    line-height: 1.45;
    opacity: 0.72;
}

.novelvexa-toast-action {
    flex-shrink: 0;
    padding: 8px 13px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none !important;
    white-space: nowrap;
}

.novelvexa-toast-close {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    background: transparent;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.55;
}

.novelvexa-toast-close:hover {
    opacity: 1;
}

@media (max-width: 560px) {

    .novelvexa-toast {
        right: 16px;
        bottom: 16px;
        width: calc(100vw - 32px);
        gap: 10px;
    }

    .novelvexa-toast-action {
        padding: 8px 10px;
    }
}

