/* ============================ */
/*         BASE STYLES          */
/* ============================ */
html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden; /* prevent horizontal scroll */
    background: #000010;
    color: #e0e0ff;
    font-family: 'Orbitron', 'Segoe UI', sans-serif;
    display: flex;
    flex-direction: column;
    padding-bottom: 80px; /* extra space for fixed footer */
}

/* ============================ */
/*         HEADER / TOPBAR      */
/* ============================ */
header, .topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1.5rem;
    background: linear-gradient(to right, #041b4d, #0b2948);
    color: #00ffff;
}

header img {
    height: 40px;
    margin-right: 0.5rem;
}

.nav, .nav-links {
    display: flex;
    flex-grow: 1;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.nav a, .nav-links a {
    color: #00ccff;
    margin-left: 1rem;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s, text-shadow 0.2s;
}

.nav a:hover, .nav-links a:hover {
    color: #00ffff;
    text-shadow: 0 0 6px cyan;
}

/* Folder icon */
.nav-links a.folder-icon-link, #folder-icon {
    display: flex;
    align-items: center;
    position: relative;
    top: 4px;
    margin-left: 8px;
}

.folder-icon {
    position: relative;
    display: inline-block;
    width: 28px;
    height: 20px;
    background: linear-gradient(135deg, #004466, #006688);
    border-radius: 4px 4px 6px 6px;
    box-shadow: inset 0 2px 4px rgba(255,255,255,0.2), 0 0 4px #0088cc88;
    margin-left: 12px;
    cursor: pointer;
    vertical-align: middle;
}
.folder-icon::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 4px;
    width: 14px;
    height: 10px;
    background: linear-gradient(135deg, #006688, #004466);
    border-radius: 3px 3px 0 0;
    box-shadow: inset 0 1px 2px rgba(255,255,255,0.3);
}
.folder-icon.unread::after {
    content: '';
    position: absolute;
    top: 0px;
    right: 0px;
    width: 10px;
    height: 10px;
    background: #ff3333;
    border: 2px solid #330000;
    border-radius: 50%;
    box-shadow: 0 0 6px #ff4444;
}

/* ============================ */
/* INBOX / FOLDER BADGE ICON    */
/* ============================ */
.inbox {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    cursor: pointer;
}
.inbox .folder-svg,
.inbox .folder-emoji {
    width: 24px;
    height: 24px;
    display: block;
}
.inbox .badge {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 10px;
    height: 10px;
    background: #ff3333;
    border-radius: 50%;
    pointer-events: none;
}

/* ============================ */
/*         HERO SECTION         */
/* ============================ */
.hero {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 20px;
    align-items: center;
}
.hero img {
    width: 100px;
    max-width: 100%;
    height: auto;
    box-shadow: 0 0 20px cyan;
    border-radius: 12px;
}

/* ============================ */
/*         APP GRID             */
/* ============================ */
.app-grid, .grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1.5rem;
    padding: 15px;
}
.app-card, .card {
    background: #111122;
    border: 1px solid #00ccff55;
    border-radius: 6px;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 0 6px #00ccff22;
    transition: transform 0.3s, box-shadow 0.3s;
}
.app-card:hover, .card:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px cyan;
}
.app-card img, .card img {
    width: 80px;
    height: 80px;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 12px;
    margin-bottom: 0.5rem;
}

/* ============================ */
/* APP CARD MARQUEE / FEATURED  */
/* ============================ */
.marquee-wrap {
    overflow-x: auto;
    white-space: nowrap;
    background: #111122;
    padding: 1rem 0.5rem;
    border: 1px solid #00ccff55;
    border-radius: 6px;
    margin-bottom: 2rem;
    box-shadow: 0 0 6px #00ffff33;
    scrollbar-width: thin;
    scrollbar-color: #00ccff55 transparent;
}
.marquee-wrap::-webkit-scrollbar {
    height: 8px;
}
.marquee-wrap::-webkit-scrollbar-track {
    background: transparent;
}
.marquee-wrap::-webkit-scrollbar-thumb {
    background-color: #00ccff55;
    border-radius: 4px;
}
.marquee-content {
    display: inline-flex;
    gap: 1rem;
    align-items: center;
}
.app-card-marquee {
    background: #111122;
    border: 1px solid #00ccff55;
    border-radius: 10px;
    padding: 0.5rem 1rem;
    width: 180px;
    text-align: center;
    box-shadow: 0 0 6px #00ccff22;
    position: relative;
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.2s ease;
}
.app-card-marquee:hover {
    transform: scale(1.05);
    box-shadow: 0 0 10px #00ffffaa;
}
.app-card-marquee img {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    margin-bottom: 0.4rem;
    box-shadow: 0 0 4px #00ccff88;
    object-fit: contain;
}
.app-card-marquee h4 {
    font-size: 1rem;
    color: #00ffff;
    margin: 0 0 0.3rem 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.vip-badge {
    position: absolute;
    top: 6px;
    right: 8px;
    background: #00ffff;
    color: #000;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 12px;
    user-select: none;
}

/* ============================ */
/*         BUTTONS              */
/* ============================ */
.btns a, .btns button,
.app-card a, .app-card button, .app-card .preview-btn,
.btn-rounded, .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.btn-rounded {
    background: #3498db;
    color: white;
    padding: 10px 18px;
    font-size: 16px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.btn-rounded:hover {
    background: #2980b9;
    transform: translateY(-2px);
}
.btn-rounded:active {
    background: #1f6391;
    transform: translateY(0);
}

.btns a:hover, .btns button:hover,
.app-card a:hover, .app-card button:hover, .app-card .preview-btn:hover {
    background: #00ffff !important;
    transform: scale(1.05);
    box-shadow: 0 0 6px #00ffff88;
}

/* ============================ */
/*         MODAL                */
/* ============================ */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.75);
    justify-content: center;
    align-items: center;
    z-index: 99999;
}
.modal-box {
    background: #111;
    padding: 15px;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80%;
    overflow-y: auto;
    box-shadow: 0 0 20px cyan;
    animation: glow 1s infinite alternate;
    display: flex;
    flex-direction: column;
}
.modal-box iframe {
    width: 100%;
    height: 400px;
    border: none;
    border-radius: 8px;
}
.close-btn {
    margin-top: 10px;
    align-self: flex-end;
    padding: 6px 12px;
    background: #00ccff;
    color: #000;
    border: none;
    border-radius: 6px;
}
.close-btn:hover {
    background: #00ffff;
    transform: scale(1.05);
    box-shadow: 0 0 6px #00ffff88;
}

/* ============================ */
/*         FOOTER               */
/* ============================ */
.footer, footer.footer, .footer-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #111;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 15px;
    z-index: 9999;
}
.footer a, .footer-nav a {
    color: #0ff;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.2s, text-shadow 0.2s;
}
.footer a:hover, .footer-nav a:hover {
    color: #00ffff;
    text-shadow: 0 0 6px cyan;
}

/* ============================ */
/*       PAGE SPACING           */
/* ============================ */
main {
    flex: 1 0 auto;
    padding-bottom: 80px;
}

/* ============================ */
/*         MOBILE RESPONSIVE    */
/* ============================ */
@media(max-width:600px){
    .hero {
        flex-direction: column;
        align-items: center;
    }
    .grid, .app-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    .ad-container {
        transform: scale(0.9);
    }
}

/* ============================ */
/*         KEYFRAMES             */
/* ============================ */
@keyframes glow {
    from { box-shadow: 0 0 10px cyan; }
    to   { box-shadow: 0 0 30px cyan; }
}
@keyframes glowPulse {
  0% { box-shadow: 0 0 5px #0ff, 0 0 10px #00f, 0 0 15px #00f; }
  100% { box-shadow: 0 0 20px #0ff, 0 0 40px #00f, 0 0 60px #00f; }
}

/* ============================ */
/*         GLOW WRAPPERS        */
/* ============================ */
.glow-wrapper, .glow {
    display: inline-block;
    filter: drop-shadow(0 0 15px cyan);
    transition: filter 0.3s ease-in-out;
}
.glow-wrapper:hover, .glow:hover {
    filter: drop-shadow(0 0 30px cyan) drop-shadow(0 0 50px cyan);
}

/* ============================ */
/*         SEARCH FORM          */
/* ============================ */
form.search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 2rem 0;
}
form.search-form input[type="text"] {
    flex: 1;
    background: #222244;
    color: #fff;
    padding: 0.5rem;
    border-radius: 4px;
    border: none;
}
form.search-form button {
    background: #00ccff;
    color: #000;
    font-weight: bold;
    border: none;
    border-radius: 4px;
    padding: 0.5rem 1rem;
}

/* ============================ */
/*         ADS / CONTAINERS      */
/* ============================ */
.ad-container {
    display: flex;
    justify-content: center;
    margin: 1.5rem auto;
    max-width: 100%;
}