* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Segoe UI", Arial, sans-serif;
}

body {
    min-height: 100vh;
    color: #ffffff;
    font-family: "Segoe UI", Arial, sans-serif;

    /* PREMIUM BACKGROUND */
    background:
        radial-gradient(
            circle at top left,
            rgba(0, 229, 255, 0.15),
            transparent 40%
        ),
        radial-gradient(
            circle at bottom right,
            rgba(0, 188, 212, 0.12),
            transparent 45%
        ),
        linear-gradient(
            180deg,
            #0b0f14 0%,
            #0f141b 50%,
            #0a0d12 100%
        );

    background-attachment: fixed;
}


/* MAIN WRAPPER */
#app {
    min-height: 100vh;          /* ⬅ full screen height */
    display: flex;
    flex-direction: column;     /* ⬅ vertical layout */
}


/* HEADER */
#header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;   /* ⬅ allows wrapping on small screens */
}



/* CONTENT */
#content {
    flex: 1;
    padding: 40px 20px;
}
/* LOGO WITH GLOW */
.logo {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #b3b62b;
    text-shadow:
        0 0 5px #00e5ff,
        0 0 10px #00e5ff,
        0 0 20px #00bcd4,
        0 0 40px #0097a7;
    animation: glowPulse 2s infinite alternate;
}

/* GLOW ANIMATION */
@keyframes glowPulse {
    from {
        text-shadow:
            0 0 5px #9eaaac,
            0 0 10px #00e5ff,
            0 0 20px #00bcd4;
    }
    to {
        text-shadow:
            0 0 10px #00e5ff,
            0 0 20px #00e5ff,
            0 0 40px #00bcd4,
            0 0 60px #0097a7;
    }
}


/* FOOTER */
#footer {
    padding: 15px;
    text-align: center;
    background: #151515;
    font-size: 14px;
    color: #aaa;
}
/* WELCOME CENTER */
.welcome-container {
    height: calc(10vh - 80px); /* minus header height */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* WELCOME TEXT */
.welcome-text {
    font-size: 48px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #ffffff;
    text-shadow:
        0 0 10px rgba(0, 229, 255, 0.6),
        0 0 30px rgba(0, 229, 255, 0.4);
}


/* TOOLBOX CARD */
.toolbox {
    width: 320px;
    margin: 80px auto 40px auto; /* ⬅ pushes toolbox down */
    padding: 20px;
    border-radius: 18px;
    background: rgba(20, 20, 20, 0.75);
    backdrop-filter: blur(15px);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    gap: 14px;
}


/* TITLE */
.toolbox-title {
    text-align: center;
    font-size: 28px;
    font-weight: 600;
    color: #9efcff;
    margin-bottom: 10px;
}

/* COMMON BUTTON */
.tool-btn {
    width: 100%;
    padding: 14px 16px;
    border-radius: 14px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #fff;
    transition: all 0.3s ease;
    text-decoration: none;
}

/* ONEPLUS */
.tool-btn.hot {
    background: linear-gradient(135deg, #ff416c, #ff4b2b);
}
.tool-btn.hot:hover {
    box-shadow: 0 0 25px rgba(255, 75, 43, 0.8);
}

/* REALME */
.tool-btn.new {
    background: linear-gradient(135deg, #6a5acd, #836fff);
}
.tool-btn.new:hover {
    box-shadow: 0 0 25px rgba(131, 111, 255, 0.8);
}

/* NEIL TOOL */
.tool-btn.dark {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
}
.tool-btn.dark:hover {
    background: rgba(0, 229, 255, 0.15);
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.5);
}

/* TELEGRAM */
.tool-btn.telegram {
    background: linear-gradient(135deg, #0088cc, #00aaff);
}
.tool-btn.telegram img {
    width: 20px;
    height: 20px;
}
.tool-btn.telegram:hover {
    box-shadow: 0 0 25px rgba(0, 170, 255, 0.8);
}




/* PAGE LAYOUT */
.page-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

/* LEFT SIDE */
.left-panel {
    width: 360px;
    padding-left: 40px;
    position: sticky;
    top: 100px;
}


    /* PIN TOOLBOX */
    position: sticky;
    top: 245px;          /* ⬅ distance from top (below header) */
    align-self: flex-start;
}


/* CENTER SIDE */
.center-panel {
    flex: 1;
    display: flex;
    align-items: center;   /* vertical center */
    justify-content: center;
}

/* TOOLBOX POSITION FIX */
.toolbox {
    margin: 0;
}



/* RIGHT CONTENT PANEL */
.content-panel {
    width: 100%;
    max-width: 1100px;
    padding: 20px;
}


/* HEADER BAR */
.content-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.back-btn {
    padding: 8px 14px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #00e5ff, #00bcd4);
    color: #000;
    cursor: pointer;
    font-weight: 600;
}

.path-text {
    flex: 1;
    color: #9efcff;
    font-weight: 600;
}

#searchBox {
    padding: 10px 14px;
    border-radius: 12px;
    border: none;
    background: #151515;
    color: #fff;
    width: 260px;
    outline: none;
}

/* GRID */
.firmware-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}

/* CARD */
.firmware-card {
    background: rgba(25, 25, 25, 0.85);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.7);
     word-wrap: break-word;
    overflow-wrap: anywhere;
}

.firmware-card h4 {
    font-size: 14px;
    color: #9efcff;
    margin-bottom: 8px;
}

.firmware-info {
    font-size: 13px;
    color: #ccc;
    margin-bottom: 6px;
}

.download-btn {
    margin-top: 10px;
    padding: 8px 14px;
    border-radius: 10px;
    border: none;
    background: #ff4b4b;   /* default red */
    color: #fff;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.25s ease, transform 0.2s ease;
}

.download-btn:hover {
    background: #00c853;   /* green on hover */
    transform: scale(1.03);
}




const firmwareData = {
    oneplus: [
        { model: "PHS110", project: "22045", android: "13" },
        { model: "PHS110", project: "22045", android: "14" },
        { model: "CPH2581", project: "21091", android: "14" }
    ],
    realme: [
        { model: "RMX3998", project: "23689", android: "14" },
        { model: "RMX3780", project: "23011", android: "13" }
    ]
};

let currentList = [];

/* LOAD CONTENT */
function loadCategory(type) {
    currentList = firmwareData[type];
    document.getElementById("pathText").innerText =
        type === "oneplus" ? "/OnePlus Files" : "/Realme Files";
    renderCards(currentList);
}

/* RENDER CARDS */
function renderCards(list) {
    const grid = document.getElementById("firmwareGrid");
    grid.innerHTML = "";

    list.forEach(item => {
        grid.innerHTML += `
            <div class="firmware-card">
                <h4>${item.model}</h4>
                <div class="firmware-info">Android: ${item.android}</div>
                <div class="firmware-info">Project ID: ${item.project}</div>
                <button class="download-btn">Download</button>
            </div>
        `;
    });
}

/* SEARCH */
function filterFirmware() {
    const value = document.getElementById("searchBox").value.toLowerCase();
    const filtered = currentList.filter(item =>
        item.model.toLowerCase().includes(value) ||
        item.project.includes(value)
    );
    renderCards(filtered);
}

/* CLEAR */
function clearContent() {
    document.getElementById("firmwareGrid").innerHTML = "";
    document.getElementById("pathText").innerText = "Select a category";
}


/* TELEGRAM ATTENTION ANIMATION */
.highlight-telegram {
    position: relative;
    animation: telegramPulse 2.5s infinite;
}

/* GLOW PULSE */
@keyframes telegramPulse {
    0% {
        box-shadow: 0 0 0 rgba(0, 170, 255, 0);
        transform: translateY(0);
    }
    40% {
        box-shadow:
            0 0 15px rgba(157, 255, 0, 0.8),
            0 0 35px rgba(89, 112, 107, 0.486);
    }
    60% {
        transform: translateY(-3px); /* soft lift */
    }
    100% {
        box-shadow: 0 0 0 rgba(0, 170, 255, 0);
        transform: translateY(0);
    }
}

/* EXTRA POP ON HOVER */
.highlight-telegram:hover {
    animation: none;
    box-shadow:
        0 0 25px rgb(255, 145, 0),
        0 0 50px rgba(0, 170, 255, 0.7);
    transform: scale(1.05);
}




/* LANDING ILLUSTRATION */
.landing-illustration {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.landing-illustration img {
    max-width: 420px;
    width: 100%;
    opacity: 0.9;
}


/* FLOATING ILLUSTRATION EFFECT */
.floating-illustration {
    max-width: 420px;
    width: 100%;
    animation: floatUpDown 6s ease-in-out infinite;

}

/* KEYFRAMES */
@keyframes floatUpDown {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-18px);
    }
    100% {
        transform: translateY(0);
    }
}



/* ILLUSTRATION BACKGROUND CONTAINER */
.illustration-bg {
padding: 60px 180px;
    border-radius: 28px;
    background:
        radial-gradient(
            circle at top,
            rgba(200, 208, 209, 0.18),
            rgba(0, 0, 0, 0.85)
        );
    backdrop-filter: blur(18px);
    box-shadow:
        0 0 40px rgba(188, 196, 197, 0.25),
        inset 0 0 60px rgba(255, 255, 255, 0.03);
}

/* LANDING ILLUSTRATION CENTERING */
.landing-illustration {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* FLOATING IMAGE (already added earlier) */
.floating-illustration {
    max-width: 420px;
    width: 200%;
    animation: floatUpDown 4s ease-in-out infinite;
}

/* FLOAT KEYFRAMES */
@keyframes floatUpDown {
    0% { transform: translateY(0); }
    50% { transform: translateY(-18px); }
    100% { transform: translateY(0); }
}




//DATE
.live-datetime {
    font-size: 13px;
    color: #aec2a9;
    font-weight: 600;
    white-space: nowrap;
}




/* FOOTER */
#footer {
    padding: 15px 20px;
    background: rgba(21, 21, 21, 0.8);
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* FOOTER TEXT */
.footer-text {
    font-size: 13px;
    color: #aaa;
    letter-spacing: 0.4px;
}

/* WATERMARK STYLE */
.footer-watermark {
    color: #9efcff;
    font-weight: 600;
}



/* CURSOR RED DOT */
#cursor-dot {
    position: fixed;
    top: 0;
    left: 0;

    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: red;

    pointer-events: none;
    z-index: 2147483647;

    box-shadow:
        0 0 6px rgba(255, 0, 0, 0.9),
        0 0 14px rgba(255, 0, 0, 0.6);

    display: none;        /* ⬅ hidden on main page */
    will-change: transform;
}

/* TOOL BUTTON LOGO */
.tool-logo {
    width: 22px;
    height: 22px;
    object-fit: contain;
}


#visitorCount {
    color: #00e676;
    font-weight: 600;
}


@media (max-width: 768px) {
    .page-layout {
        flex-direction: column;   /* stack vertically */
    }

    .left-panel {
        width: 100%;
        padding-left: 0;
        position: relative;       /* disable sticky on mobile */
        top: auto;
    }
}



@media (max-width: 768px) {
    .content-panel {
        padding: 15px;
    }
}





@media (max-width: 600px) {
    .header-right {
        width: 100%;
        justify-content: flex-end;
        margin-top: 8px;
    }
}


html, body {
    max-width: 100%;
    overflow-x: hidden;
}



@media (max-width: 480px) {
    .firmware-grid {
        grid-template-columns: 1fr;
    }
}
