/* =========================================================
   VORTEX — CORE CSS
   ========================================================= */

:root {
    --vortex-black: #08090b;
    --vortex-black-2: #0d0f12;
    --vortex-black-3: #13161a;

    --vortex-white: #ffffff;
    --vortex-white-soft: #e9edf0;
    --vortex-gray: #9aa3aa;
    --vortex-gray-dark: #626a70;

    --vortex-cyan: #13ABD2;
    --vortex-cyan-light: #76E5FD;

    --border: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.16);

    --surface: rgba(255, 255, 255, 0.045);
    --surface-hover: rgba(255, 255, 255, 0.075);

    --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    --container: 1380px;
    --header-height: 76px;
    --transition: 180ms ease;
}


/* =========================================================
   RESET
   ========================================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    background:
        radial-gradient(circle at 10% -10%, rgba(19, 171, 210, 0.10), transparent 32%),
        radial-gradient(circle at 90% 10%, rgba(118, 229, 253, 0.055), transparent 28%),
        var(--vortex-black);
    color: var(--vortex-white);
    font-family: "Tajawal", "Noto Sans Arabic", "Segoe UI", Arial, sans-serif;
    line-height: 1.7;
    overflow-x: hidden;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    border: 0;
}

img {
    display: block;
    max-width: 100%;
}

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

ul,
ol {
    margin: 0;
    padding: 0;
    list-style: none;
}


/* =========================================================
   SCROLLBAR
   ========================================================= */

::-webkit-scrollbar {
    width: 9px;
}

::-webkit-scrollbar-track {
    background: var(--vortex-black);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--vortex-cyan-light), var(--vortex-cyan));
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--vortex-cyan-light);
}


/* =========================================================
   SELECTION
   ========================================================= */

::selection {
    background: rgba(19, 171, 210, 0.35);
    color: var(--vortex-white);
}


/* =========================================================
   CONTAINER
   ========================================================= */

.container {
    width: min(calc(100% - 40px), var(--container));
    margin-inline: auto;
}


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

#app-header {
    position: relative;
    z-index: 1000;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--header-height);
    border-bottom: 1px solid var(--border);
    background: rgba(8, 9, 11, 0.86);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.site-header-inner {
    width: min(calc(100% - 40px), var(--container));
    height: 100%;
    margin-inline: auto;
    display: flex;
    align-items: center;
    gap: 28px;
}


/* =========================================================
   LOGO
   ========================================================= */

.site-logo {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    flex-shrink: 0;
    font-size: 22px;
    font-weight: 900;
    letter-spacing: 2px;
}

.site-logo img {
    width: 38px;
    height: 38px;
    object-fit: contain;
}

.site-logo-mark {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--vortex-cyan-light), var(--vortex-cyan));
    color: #061015;
    font-size: 17px;
    font-weight: 950;
}


/* =========================================================
   NAVIGATION
   ========================================================= */

.site-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.site-nav a {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 7px 13px;
    border-radius: var(--radius-sm);
    color: var(--vortex-gray);
    font-size: 14px;
    font-weight: 700;
    transition: color var(--transition), background var(--transition);
}

.site-nav a:hover {
    color: var(--vortex-white);
    background: var(--surface);
}

.site-nav a.active {
    color: var(--vortex-white);
    background: rgba(19, 171, 210, 0.10);
}

.site-nav a.active::after {
    content: "";
    position: absolute;
    right: 13px;
    left: 13px;
    bottom: 2px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--vortex-cyan-light), var(--vortex-cyan));
}


/* =========================================================
   HEADER ACTIONS
   ========================================================= */

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-action {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--vortex-white);
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.header-action:hover {
    background: var(--surface-hover);
    border-color: var(--border-strong);
    transform: translateY(-1px);
}


/* =========================================================
   MOBILE MENU
   ========================================================= */

.mobile-menu-button {
    display: none;
}

.mobile-menu {
    display: none;
}


/* =========================================================
   MAIN
   ========================================================= */

main {
    min-height: calc(100vh - var(--header-height));
}

main > .container {
    padding-top: 54px;
    padding-bottom: 90px;
}


/* =========================================================
   PAGE TITLE
   ========================================================= */

.page-title {
    margin-bottom: 42px;
}

.page-title .eyebrow {
    margin-bottom: 7px;
}

.page-title h1 {
    margin: 0;
    font-size: clamp(32px, 5vw, 52px);
    line-height: 1.15;
    letter-spacing: -1px;
}

.page-title p {
    max-width: 720px;
    margin: 14px 0 0;
    color: var(--vortex-gray);
    font-size: 15px;
}


/* =========================================================
   TYPOGRAPHY
   ========================================================= */

h1,
h2,
h3,
h4,
p {
    margin-top: 0;
}

h2 {
    margin-bottom: 0;
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.25;
}

h3 {
    margin-bottom: 0;
    font-size: 17px;
    line-height: 1.4;
}

.eyebrow {
    display: inline-block;
    color: var(--vortex-cyan-light);
    font-size: 11px;
    font-weight: 850;
    letter-spacing: 1.4px;
    text-transform: uppercase;
}


/* =========================================================
   SECTIONS
   ========================================================= */

.section {
    margin-top: 82px;
}

.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.section-head > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.section-link {
    color: var(--vortex-cyan-light);
    font-size: 13px;
    font-weight: 800;
    transition: color var(--transition);
}

.section-link:hover {
    color: var(--vortex-white);
}


/* =========================================================
   HERO
   ========================================================= */

.hero {
    position: relative;
    min-height: 450px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    background: var(--vortex-black-2);
    box-shadow: var(--shadow);
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(
        90deg,
        rgba(8, 9, 11, 0.96),
        rgba(8, 9, 11, 0.62),
        rgba(8, 9, 11, 0.12)
    );
}

.hero img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.75;
}

.hero-content {
    position: relative;
    z-index: 2;
    width: min(700px, 85%);
    min-height: 450px;
    padding: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-content h1 {
    margin: 10px 0 14px;
    font-size: clamp(36px, 5vw, 64px);
    line-height: 1.05;
}

.hero-content p {
    max-width: 620px;
    color: var(--vortex-white-soft);
    font-size: 15px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}


/* =========================================================
   BUTTONS
   ========================================================= */

.btn {
    min-height: 44px;
    padding: 9px 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition:
        transform var(--transition),
        background var(--transition),
        border-color var(--transition),
        color var(--transition);
}

.btn:hover {
    transform: translateY(-1px);
}

.btn.primary {
    color: #041015;
    background: linear-gradient(135deg, var(--vortex-cyan-light), var(--vortex-cyan));
    box-shadow: 0 8px 28px rgba(19, 171, 210, 0.18);
}

.btn.primary:hover {
    box-shadow: 0 12px 34px rgba(19, 171, 210, 0.28);
}

.btn.secondary {
    color: var(--vortex-white);
    background: var(--surface);
    border-color: var(--border);
}

.btn.secondary:hover {
    background: var(--surface-hover);
    border-color: var(--border-strong);
}


/* =========================================================
   QUICK NAVIGATION
   ========================================================= */

.quick-navigation {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.quick-card {
    min-height: 110px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    transition: transform var(--transition), background var(--transition), border-color var(--transition);
}

.quick-card:hover {
    transform: translateY(-3px);
    background: var(--surface-hover);
    border-color: rgba(19, 171, 210, 0.25);
}

.quick-card strong {
    display: block;
    margin-bottom: 3px;
    font-size: 14px;
}

.quick-card small {
    display: block;
    color: var(--vortex-gray);
    font-size: 12px;
}

.quick-icon {
    width: 45px;
    height: 45px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: var(--vortex-cyan-light);
    background: rgba(19, 171, 210, 0.09);
    font-size: 20px;
}


/* =========================================================
   MANGA GRID
   ========================================================= */

.manga-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 18px;
}

.manga-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    transition: transform var(--transition), border-color var(--transition), background var(--transition);
}

.manga-card:hover {
    transform: translateY(-5px);
    border-color: rgba(118, 229, 253, 0.22);
    background: var(--surface-hover);
}

.manga-cover {
    position: relative;
    display: block;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: var(--vortex-black-3);
}

.manga-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 300ms ease;
}

.manga-card:hover .manga-cover img {
    transform: scale(1.035);
}

.manga-card-body {
    padding: 13px;
}

.manga-card-body h3 {
    margin: 4px 0 8px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.manga-card-body h3 a:hover {
    color: var(--vortex-cyan-light);
}

.manga-rating {
    color: var(--vortex-cyan-light);
    font-size: 12px;
    font-weight: 700;
}


/* =========================================================
   CHAPTER GRID
   ========================================================= */

.chapter-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.chapter-card {
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.chapter-card:hover {
    transform: translateY(-2px);
    background: var(--surface-hover);
    border-color: rgba(19, 171, 210, 0.22);
}

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

.chapter-card-info h3 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chapter-card-meta {
    margin-top: 4px;
    color: var(--vortex-gray);
    font-size: 12px;
}


/* =========================================================
   SEARCH / INPUTS
   ========================================================= */

input,
select,
textarea {
    width: 100%;
    min-height: 45px;
    padding: 9px 13px;
    color: var(--vortex-white);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

input::placeholder,
textarea::placeholder {
    color: var(--vortex-gray-dark);
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(19, 171, 210, 0.65);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 3px rgba(19, 171, 210, 0.10);
}

select option {
    background: var(--vortex-black-2);
    color: var(--vortex-white);
}


/* =========================================================
   EMPTY STATES
   ========================================================= */

.empty {
    width: 100%;
    padding: 70px 25px;
    text-align: center;
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.025);
}

.empty-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    color: var(--vortex-cyan-light);
    background: rgba(19, 171, 210, 0.08);
    font-size: 25px;
}

.empty h3 {
    margin-bottom: 7px;
}

.empty p {
    max-width: 520px;
    margin: 0 auto 20px;
    color: var(--vortex-gray);
    font-size: 14px;
}


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

.loading-spinner {
    width: 38px;
    height: 38px;
    margin: 0 auto 18px;
    border: 3px solid rgba(255, 255, 255, 0.10);
    border-top-color: var(--vortex-cyan);
    border-radius: 50%;
    animation: vortex-spin 800ms linear infinite;
}

@keyframes vortex-spin {
    to {
        transform: rotate(360deg);
    }
}


/* =========================================================
   HIDDEN
   ========================================================= */

.hidden {
    display: none !important;
}


/* =========================================================
   TEXT BUTTON
   ========================================================= */

.text-button {
    padding: 0;
    color: var(--vortex-cyan-light);
    background: transparent;
    font-size: 12px;
    font-weight: 750;
    cursor: pointer;
    transition: color var(--transition);
}

.text-button:hover {
    color: var(--vortex-white);
}


/* =========================================================
   RESULTS
   ========================================================= */

.results-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin: 30px 0 24px;
}

.results-count {
    color: var(--vortex-gray);
    font-size: 13px;
    white-space: nowrap;
}


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

#app-footer {
    border-top: 1px solid var(--border);
}

.site-footer {
    padding: 35px 0;
    background: rgba(0, 0, 0, 0.16);
}

.site-footer-inner {
    width: min(calc(100% - 40px), var(--container));
    margin-inline: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.site-footer p {
    margin: 0;
    color: var(--vortex-gray);
    font-size: 12px;
}

.site-footer-links {
    display: flex;
    align-items: center;
    gap: 16px;
}

.site-footer-links a {
    color: var(--vortex-gray);
    font-size: 12px;
}

.site-footer-links a:hover {
    color: var(--vortex-white);
}


/* =========================================================
   FOCUS
   ========================================================= */

:focus-visible {
    outline: 2px solid var(--vortex-cyan-light);
    outline-offset: 3px;
}


/* =========================================================
   RESPONSIVE — LARGE
   ========================================================= */

@media (max-width: 1250px) {

    .manga-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

}


/* =========================================================
   RESPONSIVE — TABLET
   ========================================================= */

@media (max-width: 1000px) {

    .site-nav {
        gap: 0;
    }

    .site-nav a {
        padding-inline: 9px;
        font-size: 13px;
    }

    .manga-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .quick-navigation {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hero-content {
        padding: 45px;
    }

}


/* =========================================================
   RESPONSIVE — MOBILE
   ========================================================= */

@media (max-width: 720px) {

    :root {
        --header-height: 64px;
    }

    .container {
        width: min(calc(100% - 24px), var(--container));
    }

    main > .container {
        padding-top: 35px;
        padding-bottom: 65px;
    }

    .site-header-inner {
        width: min(calc(100% - 24px), var(--container));
        gap: 10px;
    }

    .site-logo {
        font-size: 18px;
    }

    .site-logo img,
    .site-logo-mark {
        width: 34px;
        height: 34px;
    }

    .site-nav {
        display: none;
    }

    .header-actions {
        margin-inline-start: auto;
    }

    .mobile-menu-button {
        display: grid;
    }

    .mobile-menu {
        position: fixed;
        inset: var(--header-height) 0 auto 0;
        z-index: 999;
        padding: 12px;
        border-bottom: 1px solid var(--border);
        background: rgba(8, 9, 11, 0.96);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }

    .mobile-menu.open {
        display: block;
    }

    .mobile-menu a {
        display: block;
        padding: 12px 14px;
        border-radius: var(--radius-sm);
        color: var(--vortex-gray);
        font-size: 14px;
        font-weight: 700;
    }

    .mobile-menu a:hover,
    .mobile-menu a.active {
        color: var(--vortex-white);
        background: var(--surface);
    }

    .page-title {
        margin-bottom: 30px;
    }

    .page-title h1 {
        font-size: 34px;
    }

    .section {
        margin-top: 55px;
    }

    .section-head {
        align-items: center;
    }

    .section-head h2 {
        font-size: 24px;
    }

    .manga-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .chapter-grid {
        grid-template-columns: 1fr;
    }

    .quick-navigation {
        grid-template-columns: 1fr;
    }

    .hero {
        min-height: 410px;
        border-radius: var(--radius-lg);
    }

    .hero-content {
        min-height: 410px;
        width: 100%;
        padding: 28px;
        justify-content: end;
    }

    .hero-content h1 {
        font-size: 37px;
    }

    .hero-content p {
        font-size: 13px;
    }

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

}


/* =========================================================
   RESPONSIVE — SMALL PHONES
   ========================================================= */

@media (max-width: 430px) {

    .manga-grid {
        gap: 9px;
    }

    .manga-card-body {
        padding: 10px;
    }

    .manga-card-body h3 {
        font-size: 14px;
    }

    .hero-content h1 {
        font-size: 32px;
    }

    .btn {
        min-height: 42px;
        padding-inline: 14px;
    }

    .section-link {
        font-size: 12px;
    }

}
