/* --- Global Sleek Reset --- */
:root {
    --primary: #9d00ff;
    --primary-glow: rgba(157, 0, 255, 0.4);
    --bg-dark: #0a0a0c;
    --glass-bg: rgba(20, 20, 25, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-main: #e2e2e2;
    --text-muted: #888890;
}

html, body { 
    margin: 0; 
    padding: 0; 
    width: 100%; 
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; 
    color: var(--text-main); 
    background-color: transparent; 
    font-size: 14px; 
    line-height: 1.5; 
    overflow-x: hidden; 
    -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; scroll-behavior: smooth; }

/* --- 3D Hover Animations --- */
.hover-3d { transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease; }
@media (hover: hover) {
    .hover-3d:hover { transform: translateY(-5px) scale(1.02) rotateX(2deg) rotateY(2deg); box-shadow: 0 15px 30px rgba(0,0,0,0.6), 0 0 15px var(--primary-glow); z-index: 10; }
    .hover-3d-btn:hover { transform: perspective(400px) translateZ(10px) translateY(-2px); box-shadow: 0 5px 15px var(--primary-glow); border-color: var(--primary); }
}
.hover-3d-btn { transition: all 0.2s ease-out; position: relative; overflow: hidden; }

/* --- Splash Screen --- */
.splash-screen { position: fixed; inset: 0; width: 100vw; height: 100vh; background: var(--bg-dark); display: flex; justify-content: center; align-items: center; z-index: 9999; transition: opacity 0.8s ease; overflow: hidden;}
.splash-video { position: absolute; top: 0; left: 0; width: 100vw; height: 100vh; object-fit: cover; opacity: 0.85; z-index: 1; }
.splash-overlay { position: absolute; top: 0; left: 0; width: 100vw; height: 100vh; background: radial-gradient(circle, rgba(0,0,0,0.1) 0%, #0a0a0c 100%); z-index: 2; }

.splash-content { position: relative; z-index: 10; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; height: 100%; padding: 0 20px;}
.neon-text { font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; letter-spacing: 5px; color: #fff; text-shadow: 0 0 20px var(--primary); margin: 0 0 5px 0;}
.neon-sub { font-size: 0.75rem; letter-spacing: 4px; color: var(--primary); font-weight: 600; margin: 0;}

/* --- Backgrounds --- */
.space-bg { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; object-fit: cover; z-index: -2; opacity: 1; }
.video-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(10, 10, 12, 0.4); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); z-index: -1; }

/* --- Compact Navigation --- */
.glass-nav { 
    position: fixed; top: 15px; left: 50%; transform: translateX(-50%); 
    display: flex; justify-content: space-between; align-items: center; 
    width: 90%; max-width: 600px; padding: 8px 20px; 
    background: rgba(15, 15, 20, 0.75); 
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); 
    border: 1px solid var(--glass-border); border-radius: 30px; 
    z-index: 100; box-shadow: 0 4px 20px rgba(0,0,0,0.5); 
}
.nav-links { display: flex; flex-wrap: wrap; justify-content: center; }
.nav-links a { color: var(--text-muted); text-decoration: none; margin: 0 10px; font-size: 0.85rem; font-weight: 500; display: inline-block; }
.nav-links a:hover { color: #fff; }
.glowing-logo { height: 28px; width: 28px; border-radius: 50%; border: 1px solid var(--primary); box-shadow: 0 0 10px var(--primary-glow); object-fit: cover; display: block; }

/* --- Layout & Sections --- */
#main-content { margin-top: 100px; display: flex; flex-direction: column; align-items: center; padding-bottom: 50px; width: 100%;}
.section-container { width: 90%; max-width: 900px; margin-bottom: 60px; }

.section-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--glass-border); padding-bottom: 15px; margin-bottom: 25px; gap: 20px; }
.header-text { display: flex; flex-direction: column; }
.section-title { font-size: 1.25rem; font-weight: 600; color: #fff; letter-spacing: 1px; margin: 0;}
.section-desc { font-size: 0.85rem; color: var(--text-muted); margin: 6px 0 0 0; max-width: 500px; line-height: 1.4; }

/* --- Compact Grid & Cards --- */
.grid-layout { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 15px; perspective: 1000px; }
.glass-panel { background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 10px; padding: 12px; transform-style: preserve-3d; }

/* --- View All Button Container --- */
.view-all-container { width: 100%; display: flex; justify-content: center; margin-top: 25px; }

/* --- Buttons & Inputs --- */
.glass-btn { display: inline-block; padding: 7px 14px; font-size: 0.8rem; font-weight: 500; border-radius: 6px; text-decoration: none; text-align: center; cursor: pointer; border: 1px solid transparent; }
.outline-btn { background: rgba(255,255,255,0.05); border-color: var(--glass-border); color: var(--text-main); }
.action-btn { background: var(--primary-glow); border-color: var(--primary); color: #fff; }
.success-btn { background: rgba(0, 220, 130, 0.15); border-color: rgba(0, 220, 130, 0.5); color: #00dc82; }
.glass-input { background: rgba(0,0,0,0.3); border: 1px solid var(--glass-border); color: #fff; padding: 6px 12px; border-radius: 6px; font-size: 0.85rem; outline: none; }
.glass-input:focus { border-color: var(--primary); }
.compact-search { width: 200px; flex-shrink: 0; }

/* --- Product Cards --- */
.product-card { display: flex; flex-direction: column; gap: 10px; }
.thumb-wrapper { width: 100%; height: 130px; border-radius: 6px; overflow: hidden; position: relative; cursor: pointer; background: #000; }
.thumb-wrapper img, .thumb-wrapper video { width: 100%; height: 100%; object-fit: cover; position: absolute; top: 0; left: 0; transition: 0.3s; }
.thumb-wrapper video { opacity: 0; }
.card-header { display: flex; align-items: center; gap: 10px; }
.card-icon { width: 28px; height: 28px; border-radius: 6px; background: #222; }
.card-title-area h3 { font-size: 0.95rem; font-weight: 500; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0;}
.card-size { font-size: 0.7rem; color: var(--text-muted); }

/* --- Beta Vault Scroll --- */
.beta-scroll-box { max-height: 400px; overflow-y: auto; padding-right: 5px; align-content: start; }
.beta-scroll-box::-webkit-scrollbar { width: 4px; }
.beta-scroll-box::-webkit-scrollbar-track { background: transparent; }
.beta-scroll-box::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 4px; }

/* --- Posts & Tools --- */
.post-card { cursor: pointer; padding: 0; overflow: hidden; }
.post-thumb { width: 100%; height: 100px; object-fit: cover; }
.post-info { padding: 12px; }
.post-info h3 { font-size: 0.95rem; margin-bottom: 4px; }
.post-info p { font-size: 0.8rem; color: var(--text-muted); margin: 0;}

.tool-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.tool-header h3 { font-size: 0.95rem; margin: 0;}
.badge { font-size: 0.65rem; background: rgba(255,255,255,0.1); padding: 2px 6px; border-radius: 4px; color: var(--text-muted); }
.tool-content { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.file-input { display: none; }
.file-name { font-size: 0.75rem; color: var(--text-muted); text-align: center; word-break: break-all; margin: 0;}
.tool-content .glass-btn { width: 100%; }

.compiler-card { grid-column: 1 / -1; }
.compiler-split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; height: 200px; }
#htmlCode { background: #0a0a0c; border: 1px solid var(--glass-border); color: #00ffcc; padding: 10px; border-radius: 6px; font-family: monospace; font-size: 0.8rem; resize: none; outline: none; }
#codeOutput { width: 100%; height: 100%; background: #fff; border: none; border-radius: 6px; }

/* --- Arcade --- */
.game-container { text-align: center; display: flex; flex-direction: column; align-items: center; padding: 20px;}
.arcade-nav { display: flex; justify-content: center; align-items: center; width: 100%; margin-bottom: 15px; flex-wrap: wrap; gap: 10px;}
#arcadeCanvas { background: #0a0a0c; border: 1px solid var(--glass-border); border-radius: 6px; box-shadow: inset 0 0 20px rgba(0,0,0,0.8); max-width: 100%; }
.game-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 10px; }

/* --- 3D MODALS & OVERLAYS --- */
.glass-modal { display: none; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.85); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); z-index: 1000; justify-content: center; align-items: center; perspective: 1200px; }

.modal-content { 
    background: var(--bg-dark); 
    border: 1px solid var(--glass-border); 
    border-radius: 12px; 
    padding: 25px; 
    width: 90%; 
    max-height: 90vh;
    overflow-y: auto;
    position: relative; 
    box-shadow: 0 10px 40px rgba(0,0,0,0.8); 
    transform: scale(0.8) rotateX(25deg);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.modal-content.active { transform: scale(1) rotateX(0deg); opacity: 1; }
.modal-content::-webkit-scrollbar { width: 4px; }
.modal-content::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 4px; }

.compact-modal { max-width: 500px; }
.media-modal-content { max-width: 700px; }
.close-btn { position: absolute; top: 15px; right: 20px; font-size: 1.5rem; color: var(--text-muted); cursor: pointer; line-height: 1; transition: 0.2s; z-index: 5;}
.close-btn:hover { color: #fff; transform: scale(1.2); }
.modal-text { font-size: 0.9rem; color: var(--text-muted); margin-top: 15px; }

.modal-header-compact { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; padding-right: 30px;}
.modal-header-compact h2 { font-size: 1.2rem; margin: 0;}

.main-viewer { width: 100%; height: 250px; background: #000; border-radius: 6px; display: flex; justify-content: center; align-items: center; margin-bottom: 12px; overflow: hidden; border: 1px solid #222; }
#prod-modal-video, #prod-modal-img { max-width: 100%; max-height: 100%; object-fit: contain; }
.screenshots-grid { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 5px; }
.screenshots-grid::-webkit-scrollbar { height: 4px; }
.screenshots-grid::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 4px; }
.shot-thumb { width: 80px; height: 50px; object-fit: cover; border-radius: 4px; cursor: pointer; border: 1px solid transparent; transition: 0.2s; flex-shrink: 0; }
.shot-thumb:hover { border-color: var(--primary); transform: translateY(-3px);}
.vid-thumb { background: #111; display: flex; justify-content: center; align-items: center; font-size: 0.7rem; font-weight: 600; color: var(--primary); border: 1px solid var(--primary); }

/* --- 3D Download Popup Animation --- */
.dl-overlay { z-index: 10000; perspective: 1000px; }
.download-3d-card { 
    background: var(--bg-dark); border: 1px solid var(--primary); padding: 30px 40px; border-radius: 12px; text-align: center; box-shadow: 0 0 30px var(--primary-glow); 
    transform: scale(0.5) rotateX(45deg); opacity: 0; transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
}
.download-3d-card.active { transform: scale(1) rotateX(0deg); opacity: 1; }

.cube-spinner { width: 35px; height: 35px; margin: 0 auto 15px auto; background: linear-gradient(135deg, var(--primary), #00ffcc); border-radius: 8px; animation: spinCube 1.2s infinite cubic-bezier(0.4, 0, 0.2, 1); }
.download-text { font-size: 1.1rem; color: #fff; letter-spacing: 1px; margin: 0 0 4px 0; }
.download-sub { font-size: 0.75rem; color: var(--text-muted); margin: 0;}

@keyframes spinCube {
    0% { transform: perspective(200px) rotateX(0deg) rotateY(0deg); }
    50% { transform: perspective(200px) rotateX(-180deg) rotateY(0deg); }
    100% { transform: perspective(200px) rotateX(-180deg) rotateY(-180deg); }
}

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
    .glass-nav { padding: 8px 10px; width: 95%; border-radius: 20px;}
    .nav-links a { margin: 0 5px; font-size: 0.75rem; }
    .compiler-split { grid-template-columns: 1fr; height: auto; }
    #htmlCode { height: 120px; }
    #codeOutput { height: 150px; }
    .section-header { flex-direction: column; align-items: flex-start; gap: 15px; }
    .compact-search { width: 100%; }
    .main-viewer { height: 200px; }
    .neon-text { letter-spacing: 2px; }
}