@font-face {
    font-family: "Estedad";
    src: url("../fonts/Estedad-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Estedad";
    src: url("../fonts/Estedad-Medium.ttf") format("truetype");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Estedad";
    src: url("../fonts/Estedad-Bold.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
/* =========================
   RESET
========================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scrollbar-width: none;
    scroll-behavior: smooth;
}

html::-webkit-scrollbar {
    display: none;
}


/* =========================
   BODY
========================= */

body {
    background:
        linear-gradient(
            135deg,
            #070711 0%,
            #10102b 35%,
            #21143d 65%,
            #080812 100%
        );

    min-height: 100vh;

    color: rgb(234, 231, 231);

    margin: 0;

    padding: 0 15px;

    overflow-x: hidden;

    font-family: "Estedad", sans-serif;
}


/* =========================
   SELECTION
========================= */

::selection {
    background: rgba(255, 1, 1, 0.482);
    color: rgba(255, 255, 255, 0.765);
}


/* =========================
   LINKS
========================= */

a {
    text-decoration: none;
}


/* =========================
   START TEXT
========================= */

.start {
    margin-right: 5px;
    margin-top: 80px;

    max-width: 1200px;

    background: linear-gradient(
        90deg,
        #ff0000,
        #ff00cc,
        #0066ff
    );

    -webkit-background-clip: text;
    background-clip: text;

    color: transparent;

    font-size: 24px;
    line-height: 2;

    scroll-margin-top: 90px;
}


/* =========================
   NAVBAR
========================= */

.navbar {
    background: rgba(25, 25, 25, 0.5);

    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);

    display: flex;
    align-items: center;

    gap: 10px;

    padding: 10px 15px;

    border-radius: 12px;

    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.3);

    position: fixed;

    top: 5px;
    left: 1%;

    width: 98%;

    min-height: 55px;

    z-index: 9999;

    color: #888;

    overflow: visible;
}


/* =========================
   LOGO
========================= */

.logo {
    margin: 0;

    font-size: 24px;

    background: linear-gradient(
        90deg,
        #ff0000,
        rgb(210, 26, 81),
        #ff00cc,
        #0066ff,
        #ff00cc,
        rgb(210, 26, 81),
        #ff0000
    );

    background-size: 300% 100%;
    background-position: 0% 50%;

    -webkit-background-clip: text;
    background-clip: text;

    color: transparent;

    position: absolute;

    left: 0;

    padding: 10px 15px;

    animation:
        changeColor 2s linear infinite;
}


@keyframes changeColor {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}


/* =========================
   NAV TEXT
========================= */

.nav {
    color: #888;
}


/* =========================
   SEARCH
========================= */

#search {
    color: #020202;

    width: 220px;

    padding: 8px 12px;

    border: none;

    border-radius: 8px;

    outline: none;

    font-family: Vazirmatn, Arial, sans-serif;
}


/* =========================
   SEARCH RESULTS
========================= */

#searchResults {
    position: absolute;

    top: 100%;
    right: 0;

    width: 100%;

    z-index: 1000;
}

.search-result {
    padding: 12px 15px;

    background: #0f172a;

    color: white;

    border-bottom:
        1px solid #334155;

    cursor: pointer;

    transition: 0.2s;
}

.search-result:hover {
    background: #1e293b;

    padding-right: 20px;
}


/* =========================
   CONTENT
========================= */

.content {
    margin-top: 25px;

    margin-right: 5px;

    max-width: 1200px;

    font-size: large;

    line-height: 2;

    display: flex;

    flex-wrap: wrap;
}


/* =========================
   HEADINGS
========================= */

h1 {
    margin-top: 35px;

    line-height: 1.8;

    scroll-margin-top: 90px;
}


/* =========================
   CODE BOX
========================= */

.codebox {
    background: rgb(30, 30, 30);

    padding: 15px;

    border-radius: 10px;

    width: min(900px, calc(100vw - 50px));

    margin: 20px 10px;

    overflow-x: auto;

    overflow-y: hidden;

    direction: ltr;

    scrollbar-width: thin;
}


/* =========================
   CODE
========================= */

.codebox code {
    display: block;

    white-space: pre;

    font-family:
        Consolas,
        "Courier New",
        monospace;

    color: white;

    font-size: 15px;

    line-height: 1.7;

    width: max-content;

    min-width: 100%;
}


/* =========================
   TEST BUTTON
========================= */

.show {
    background: #222;

    color: white;

    border: none;

    padding: 8px 12px;

    border-radius: 8px;

    cursor: pointer;

    margin-bottom: 8px;

    font-family: Vazirmatn, Arial, sans-serif;

    transition:
        background 0.2s,
        color 0.2s,
        transform 0.2s;
}

.show::before {
    content: "▶";

    margin-left: 6px;
}

.show:hover {
    background: #2b2b2b;

    color: chartreuse;

    transform: translateY(-2px);
}


/* =========================
   VS CODE AD
========================= */

.ad-vscode {
    width: fit-content;

    max-width: 90vw;

    padding: 10px;

    min-height: 80px;

    display: flex;

    flex-direction: row;

    gap: 8px;

    animation:
        back 1s ease-in-out infinite alternate;

    justify-content: center;

    align-items: center;

    color: #020202;

    z-index: 999;

    position: fixed;

    top: 70px;

    right: 42%;

    border-radius: 10px;
}


/* =========================
   SECOND ADS
========================= */

.ad-vscode2 {
    width: fit-content;

    max-width: 90vw;

    padding: 10px;

    display: flex;

    flex-direction: row;

    gap: 5px;

    animation:
        back 1s ease-in-out infinite alternate;

    justify-content: center;

    align-items: center;

    color: #020202;

    z-index: 999;

    position: fixed;

    top: 70px;

    right: 37%;

    border-radius: 10px;
}


#ad2,
#ad3,
#ad4 {
    display: none;
}


/* =========================
   AD ANIMATION
========================= */

@keyframes back {
    0% {
        background: #ff00cc;
    }

    100% {
        background: greenyellow;
    }
}


/* =========================
   IMAGES
========================= */

img {
    width: 100px;

    height: 100px;

    max-width: 100%;

    object-fit: contain;
}


/* =========================
   SEARCH HIGHLIGHT
========================= */

.search-highlight {
    animation:
        highlight 2s ease;
}

@keyframes highlight {
    0%,
    100% {
        box-shadow: 0 0 0 transparent;
    }

    30%,
    70% {
        box-shadow:
            0 0 25px #00ffff;
    }
}


/* =========================
   SCROLL TRACK
========================= */

#scroll-track {
    position: fixed;

    top: 0;

    right: 0;

    width: 0;

    height: 100vh;

    background: #0a0a0f;

    z-index: 100000;
}

#scroll-dot {
    position: absolute;

    top: 0;

    right: -5px;

    width: 14px;

    height: 14px;

    border-radius: 50%;

    background: linear-gradient(
        135deg,
        #ff00cc,
        #7c3aed,
        #0066ff
    );

    box-shadow:
        0 0 10px rgba(124, 58, 237, 0.8),
        0 0 20px rgba(255, 0, 204, 0.4);
}


/* =========================
   CURSOR GLOW
========================= */

#cursor-glow {
    position: fixed;

    width: 25px;

    height: 25px;

    border-radius: 50%;

    background: radial-gradient(
        circle,
        rgba(255, 0, 204, 0.35),
        rgba(0, 102, 255, 0.15),
        transparent 70%
    );

    pointer-events: none;

    transform:
        translate(-50%, -50%);

    z-index: 999999;

    filter: blur(2px);
}


/* =========================
   FREENEX MENU
========================= */

#FreeNex-menu {
    position: fixed;

    display: none;

    width: 190px;

    max-width: calc(100vw - 20px);

    padding: 7px;

    background:
        rgba(20, 20, 20, 0.92);

    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    border:
        1px solid rgba(255, 255, 255, 0.08);

    border-radius: 12px;

    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.5),
        0 0 15px rgba(124, 58, 237, 0.15);

    z-index: 999999;
}


/* =========================
   MENU ITEM
========================= */

.menu-item {
    padding: 9px 11px;

    border-radius: 8px;

    color: #eae7e7;

    font-size: 14px;

    cursor: pointer;

    transition:
        background 0.15s,
        color 0.15s,
        transform 0.15s;
}

.menu-item:hover {
    background: linear-gradient(
        90deg,
        rgba(255, 0, 204, 0.2),
        rgba(0, 102, 255, 0.2)
    );

    color: white;

    transform:
        translateX(-2px);
}


/* =========================
   MENU SEPARATOR
========================= */

.menu-separator {
    height: 1px;

    margin: 6px 4px;

    background:
        rgba(255, 255, 255, 0.08);
}

.secret {
    color: #ff00cc;
}


/* =========================
   FREENEX MODE
========================= */

body.FreeNex-mode {
    background:
        radial-gradient(
            circle at 20% 30%,
            rgba(255, 0, 204, 0.12),
            transparent 30%
        ),
        radial-gradient(
            circle at 80% 70%,
            rgba(0, 102, 255, 0.12),
            transparent 30%
        ),
        #050505;

    transition:
        background 0.5s ease;
}

body.FreeNex-mode .codebox {
    border:
        1px solid rgba(255, 0, 204, 0.35);

    box-shadow:
        0 0 15px rgba(255, 0, 204, 0.15),
        0 0 30px rgba(0, 102, 255, 0.08);
}

body.FreeNex-mode .navbar {
    box-shadow:
        0 0 15px rgba(255, 0, 204, 0.25),
        0 0 30px rgba(0, 102, 255, 0.15);
}

body.FreeNex-mode .start {
    text-shadow:
        0 0 10px #ff00cc,
        0 0 20px #0066ff;
}


/* =========================
   GO UP
========================= */

.go-up {
    display: none;

    position: fixed;

    bottom: 10px;

    right: 10px;

    background-color: #434345;

    padding: 10px 14px;

    border-radius: 20px;

    cursor: pointer;

    opacity: 0;

    transition:
        opacity 0.3s ease;

    z-index: 99998;

    font-size: 14px;
}

.go-up::before {
    content: "";
}

.go-up.show {
    display: block;

    opacity: 1;
}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 900px) {

    body {
        padding: 0 12px;
    }

    .navbar {
        width: 96%;

        left: 2%;

        gap: 8px;

        padding: 9px 10px;
    }

    .logo {
        font-size: 20px;

        padding: 10px;
    }

    #search {
        width: 180px;
    }

    .start {
        margin-top: 85px;

        font-size: 21px;

        line-height: 1.9;
    }

    .content {
        font-size: 17px;

        line-height: 1.9;
    }

    .codebox {
        width:
            calc(100vw - 45px);

        margin: 18px 5px;
    }

    .ad-vscode {
        right: 50%;

        transform:
            translateX(50%);

        top: 70px;
    }

    .ad-vscode2 {
        right: 50%;

        transform:
            translateX(50%);

        top: 70px;
    }
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 600px) {

    body {
        padding: 0 8px;
    }


    /* NAVBAR */

    .navbar {
        width: calc(100% - 16px);

        left: 8px;

        min-height: 52px;

        padding: 8px;

        gap: 7px;

        border-radius: 10px;

        flex-wrap: nowrap;
    }

    .navbar > * {
        flex-shrink: 0;
    }

    #search {
        width: 130px;

        font-size: 13px;

        padding: 7px 9px;
    }

    .logo {
        position: static;

        order: 10;

        font-size: 18px;

        padding: 0;

        margin-right: auto;
    }

    .nav {
        font-size: 13px;
    }


    /* PAGE START */

    .start {
        margin-top: 75px;

        margin-right: 3px;

        font-size: 17px;

        line-height: 2;

        text-align: right;
    }


    /* CONTENT */

    .content {
        margin-right: 3px;

        font-size: 16px;

        line-height: 2;

        display: block;

        word-break: normal;

        overflow-wrap: anywhere;
    }


    /* HEADINGS */

    h1 {
        font-size: 25px;

        margin-top: 25px;
    }


    /* CODEBOX */

    .codebox {
        width: calc(100vw - 30px);

        max-width: calc(100vw - 30px);

        margin: 15px 2px;

        padding: 10px;

        border-radius: 9px;
    }

    .codebox code {
        font-size: 13px;

        line-height: 1.65;
    }

    .show {
        font-size: 13px;

        padding: 7px 10px;
    }


    /* ADS */

    .ad-vscode,
    .ad-vscode2 {
        max-width: 85vw;

        top: 65px;

        right: 50%;

        transform:
            translateX(50%);

        font-size: 13px;

        min-height: 55px;

        padding: 7px;
    }

    .ad-vscode img {
        width: 55px;

        height: 55px;
    }


    /* SEARCH RESULTS */

    #searchResults {
        width: 100%;

        right: 0;
    }

    .search-result {
        font-size: 13px;

        padding: 10px;
    }


    /* MENU */

    #FreeNex-menu {
        width: 180px;

        max-width:
            calc(100vw - 20px);
    }

    .menu-item {
        font-size: 13px;

        padding: 9px;
    }


    /* GO UP */

    .go-up {
        right: 8px;

        bottom: 8px;

        padding: 9px 12px;

        font-size: 12px;
    }
}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 400px) {

    .navbar {
        gap: 5px;

        padding: 7px;
    }

    #search {
        width: 105px;

        font-size: 12px;
    }

    .logo {
        font-size: 16px;
    }

    .nav {
        font-size: 11px;
    }

    .start {
        font-size: 15px;

        margin-top: 73px;
    }

    .content {
        font-size: 14px;
    }

    h1 {
        font-size: 22px;
    }

    .codebox {
        width: calc(100vw - 24px);

        max-width: calc(100vw - 24px);

        padding: 8px;
    }

    .codebox code {
        font-size: 12px;
    }

    .show {
        font-size: 12px;
    }

    .menu-item {
        font-size: 12px;
    }
}


/* =========================================================
   VERY SMALL MOBILE
========================================================= */

@media (max-width: 340px) {

    .navbar {
        min-height: 48px;

        gap: 4px;
    }

    #search {
        width: 85px;

        font-size: 11px;
    }

    .logo {
        font-size: 14px;
    }

    .nav {
        font-size: 10px;
    }

    .start {
        font-size: 14px;
    }

    .content {
        font-size: 13px;
    }

    h1 {
        font-size: 20px;
    }

    .codebox code {
        font-size: 11px;
    }
}


/* =========================================================
   TOUCH DEVICES
========================================================= */

@media (hover: none) and (pointer: coarse) {

    #cursor-glow {
        display: none;
    }

    .show:hover,
    .search-result:hover,
    .menu-item:hover {
        transform: none;
    }
}


/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;

        animation-iteration-count: 1 !important;

        transition-duration: 0.01ms !important;

        scroll-behavior: auto !important;
    }
}
/* =========================
   THEME TOGGLE
========================= */

#themeToggle {
    border: none;
    outline: none;

    padding: 8px 12px;

    border-radius: 8px;

    background: rgba(255, 255, 255, 0.08);
    color: #fff;

    font-family: "Estedad", sans-serif;

    cursor: pointer;

    transition:
        background 0.3s ease,
        color 0.3s ease,
        transform 0.2s ease;
}

#themeToggle:hover {
    background: rgba(255, 255, 255, 0.15);

    transform: translateY(-2px);
}


/* =========================
   LIGHT MODE
========================= */

body.light-mode {
    background:
        linear-gradient(
            135deg,
            #f8f9ff 0%,
            #eeeeff 40%,
            #e9e2ff 70%,
            #fafaff 100%
        );

    color: #171717;
}


/* متن‌های اصلی */

body.light-mode .content {
    color: #202020;
}

body.light-mode .start {
    text-shadow: none;
}


/* Navbar */

body.light-mode .navbar {
    background: rgba(255, 255, 255, 0.72);

    color: #333;

    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.12);
}


/* متن Navbar */

body.light-mode .nav {
    color: #555;
}


/* Code Box */

body.light-mode .codebox {
    background: #f1f1f5;

    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.08);
}


/* کدها */

body.light-mode .codebox code {
    color: #171717;
}


/* دکمه تست */

body.light-mode .show {
    background: #dddde5;

    color: #202020;
}

body.light-mode .show:hover {
    background: #d0d0da;

    color: #168000;
}


/* سرچ */

body.light-mode #search {
    background: #ffffff;

    color: #111;

    border:
        1px solid rgba(0, 0, 0, 0.12);
}


/* نتایج سرچ */

body.light-mode .search-result {
    background: #ffffff;

    color: #222;

    border-bottom:
        1px solid #ddd;
}

body.light-mode .search-result:hover {
    background: #eeeeff;
}


/* دکمه تغییر حالت */

body.light-mode #themeToggle {
    background: rgba(0, 0, 0, 0.07);

    color: #222;
}

body.light-mode #themeToggle:hover {
    background: rgba(0, 0, 0, 0.12);
}


/* FreeNex Mode */

body.light-mode.FreeNex-mode {
    background:
        radial-gradient(
            circle at 20% 30%,
            rgba(255, 0, 204, 0.08),
            transparent 30%
        ),
        radial-gradient(
            circle at 80% 70%,
            rgba(0, 102, 255, 0.08),
            transparent 30%
        ),
        #f8f8ff;
}


/* =========================
   TRANSITIONS
========================= */

body,
.navbar,
.codebox,
.show,
#search,
.search-result,
#themeToggle,
.content {
    transition:
        background 0.35s ease,
        color 0.35s ease,
        box-shadow 0.35s ease;
}


/* =========================
   MOBILE
========================= */

@media (max-width: 600px) {

    #themeToggle {
        padding: 6px 9px;

        font-size: 12px;
    }

}