/* --- QALQX CORE STYLES v4.0 --- */

:root {
    --primary: #00E5FF;
    --bg: #000000;
    --surface: #0a0a0a;
    --border: #222;
    --text-main: #fff;
    --text-muted: #888;
    
    --dock-height: 70px;
    --sidebar-width: 80px;
    --safe-top: env(safe-area-inset-top, 20px);
    --safe-bottom: env(safe-area-inset-bottom, 20px);
}

/* 1. RESET & BASE */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
    margin: 0; padding: 0;
    background: var(--bg); color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overflow-x: hidden; /* No horizontal scroll */
    padding-bottom: calc(var(--dock-height) + var(--safe-bottom) + 20px);
    transition: background 0.3s, color 0.3s;
}

/* 2. THEME ENGINE */
/* Matrix Green */
body.theme-green { --primary: #00FF00; --bg: #051105; --surface: #0a1f0a; --border: #004400; }
/* Royal Gold */
body.theme-gold { --primary: #FFD700; --bg: #110f05; --surface: #1f1c0a; --border: #443b00; }
/* Crimson Red */
body.theme-red { --primary: #FF0055; --bg: #110505; --surface: #1f0a0a; --border: #440011; }
/* Light Mode */
body.theme-light { 
    --primary: #007BFF; --bg: #f0f2f5; --surface: #ffffff; --border: #ccc; 
    --text-main: #111; --text-muted: #555; 
}

/* 3. HEADER & SEARCH */
.header-section {
    padding: calc(var(--safe-top) + 15px) 25px 10px 25px;
    display: flex; justify-content: space-between; align-items: center;
}
.greet-box h1 { font-size: 1.8rem; margin: 0; background: linear-gradient(to right, var(--text-main), var(--text-muted)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.greet-box p { font-size: 0.8rem; color: var(--text-muted); margin: 0; letter-spacing: 1px; }

.search-container { 
    padding: 10px 20px; position: sticky; top: 0; z-index: 50; 
    background: rgba(0,0,0,0.8); backdrop-filter: blur(12px);
    width: 100%; border-bottom: 1px solid rgba(255,255,255,0.05);
}
.search-bar {
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
    display: flex; align-items: center; padding: 12px 15px; transition: 0.3s;
}
.search-bar:focus-within { border-color: var(--primary); box-shadow: 0 0 15px rgba(0, 229, 255, 0.15); }
.search-bar input { background: transparent; border: none; color: var(--text-main); width: 100%; outline: none; font-size: 1rem; margin-left: 10px; }

/* 4. CHIPS (Categories) */
.chips-wrapper {
    display: flex; gap: 8px; overflow-x: auto; padding: 10px 20px;
    scrollbar-width: none;
}
.chips-wrapper::-webkit-scrollbar { display: none; }
.chip {
    background: var(--surface); color: var(--text-muted); padding: 6px 16px; border-radius: 20px;
    font-size: 0.75rem; white-space: nowrap; border: 1px solid var(--border); transition: 0.2s; cursor: pointer;
}
.chip.active { background: var(--primary); color: #000; border-color: var(--primary); font-weight: bold; }

/* 5. APP GRID (Omni-Responsive) */
.app-grid {
    display: grid; 
    /* The Magic Line: Fits 4 icons on mobile, more on desktop */
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); 
    gap: 10px; padding: 10px 20px;
}

.app-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 14px; aspect-ratio: 1; 
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    text-decoration: none; position: relative; overflow: hidden;
    transition: transform 0.1s, background 0.2s;
}
.app-card:active { transform: scale(0.96); background: rgba(255,255,255,0.1); }
.icon-box { font-size: 2rem; margin-bottom: 5px; filter: drop-shadow(0 0 5px rgba(255,255,255,0.1)); }
.app-name { font-size: 0.7rem; color: var(--text-muted); font-weight: 500; text-align: center; line-height: 1.1; }

/* 6. NAVIGATION DOCK */
.dock {
    position: fixed; z-index: 100;
    background: rgba(20, 20, 20, 0.9); backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex; justify-content: space-around; align-items: center;
}
.dock-item {
    text-align: center; color: var(--text-muted); text-decoration: none; font-size: 0.65rem;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 10px; border-radius: 8px; transition: 0.2s;
}
.dock-icon { font-size: 1.4rem; margin-bottom: 2px; }
.dock-item.active { color: var(--primary); }
.dock-item.active .dock-icon { transform: translateY(-3px); }

/* 7. MEDIA QUERIES (Form Factors) */

/* Mobile / Folded */
@media (max-width: 800px) {
    .dock {
        bottom: 20px; left: 50%; transform: translateX(-50%);
        width: 90%; max-width: 380px; height: 65px;
        border-radius: 40px; box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    }
}

/* Desktop / Tablet / TV */
@media (min-width: 801px) {
    body { padding-left: var(--sidebar-width); padding-bottom: 20px; }
    
    .dock {
        top: 0; left: 0; bottom: 0;
        width: var(--sidebar-width); height: 100vh;
        flex-direction: column; justify-content: center; gap: 30px;
        border-radius: 0; border-right: 1px solid var(--border); border-top:none; border-bottom:none; border-left:none;
    }
    .dock-item { font-size: 0.7rem; width: 100%; }
    
    .header-section, .search-container, .chips-wrapper, .app-grid {
        max-width: 1200px; margin: 0 auto;
    }
}

/* UTILS */
.back-btn { text-decoration: none; color: var(--text-main); font-size: 1.5rem; margin-right: 15px; }
.container { padding: 20px; max-width: 800px; margin: 0 auto; }
.nav { padding: 20px; display: flex; align-items: center; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
/* FOOTER LINK STYLES */
.monoaxis-footer a {
    color: #ffffff;          /* White text */
    text-decoration: none;   /* No underline */
    border-bottom: 1px dotted #666; /* Subtle tech underline */
    transition: all 0.3s ease;
}

.monoaxis-footer a:hover {
    color: #00ffff;          /* Glow Cyan on hover */
    border-bottom: 1px solid #00ffff;
    text-shadow: 0 0 5px #00ffff;
}
/* FOOTER STYLES */
.monoaxis-footer {
    margin-top: 50px;
    padding: 30px 20px;
    border-top: 1px solid #333;
    text-align: center;
    color: #666;
    font-family: monospace;
    font-size: 0.8rem;
    width: 100%;
}

.monoaxis-footer strong {
    color: #fff;
    letter-spacing: 1px;
}

.monoaxis-footer .rights {
    margin: 10px 0;
    line-height: 1.4;
    font-size: 0.7rem;
}
