/* =========================================
   EVPC System - Apps Page (Staging Portal)
   Glassboard 3D Theme
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&family=Orbitron:wght@700&display=swap');

:root {
    /* Glass Properties */
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.8);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
    --glass-highlight: inset 0 1px 2px rgba(255, 255, 255, 0.9);
    --blur-intensity: blur(16px) saturate(180%);
    
    /* Typography & Accents */
    --text-main: #1a1e24;
    --text-muted: #4a5568;
    --accent: #2b6cb0;
    
    /* Cyber Accents */
    --neon-cyan: #008eb3;
    --neon-pink: #d53f8c;
}

/* --- Base & Reset --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #e2e8f0 0%, #edf2f7 50%, #cbd5e1 100%);
    background-size: 400% 400%;
    animation: gradientFlow 15s ease infinite;
    overflow-x: hidden;
}

@keyframes gradientFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* --- Navigation --- */
nav {
    position: sticky;
    top: 20px;
    z-index: 1000;
    max-width: 800px;
    margin: 0 auto 2rem auto;
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    background: var(--glass-bg);
    backdrop-filter: var(--blur-intensity);
    -webkit-backdrop-filter: var(--blur-intensity);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow), var(--glass-highlight);
}

nav a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    transition: all 0.3s ease;
}

nav a:hover {
    background: rgba(255, 255, 255, 0.9);
    color: var(--accent);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transform: translateY(-1px);
}

/* --- Main Content Wrapper --- */
.content-wrapper {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 3rem;
    width: 100%;
}

/* --- Header --- */
header {
    text-align: center;
    padding: 3rem 2rem;
    border-radius: 24px;
    background: var(--glass-bg);
    backdrop-filter: var(--blur-intensity);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow), var(--glass-highlight);
}

header h1 {
    font-weight: 800;
    color: var(--text-main);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 0.5rem;
    font-size: 3.5rem;
    letter-spacing: 4px;
}

header h2 {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 1.5rem;
    letter-spacing: 2px;
}

/* --- Buttons --- */
.terminal-launch-container {
    text-align: center;
    margin: 1rem 0;
}

.cyber-btn {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--glass-border);
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent);
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05), var(--glass-highlight);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.cyber-btn:hover {
    background: #ffffff;
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1), var(--glass-highlight);
}

.cyber-btn.danger {
    color: var(--neon-pink);
}

/* --- App Grid & Cards --- */
.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    padding: 1rem;
}

.app-card {
    background: var(--glass-bg);
    backdrop-filter: var(--blur-intensity);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    box-shadow: var(--glass-shadow), var(--glass-highlight);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.app-card::after {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.4) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-25deg);
    transition: all 0.6s ease;
}

.app-card:hover::after {
    left: 200%;
}

.app-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.12), var(--glass-highlight);
    border-color: #ffffff;
}

.app-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.app-card h3 {
    color: var(--text-main);
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.app-card p {
    color: var(--neon-cyan);
    font-size: 0.85rem;
    font-weight: 600;
}

/* --- Modals --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.cyber-modal {
    background: var(--glass-bg);
    backdrop-filter: var(--blur-intensity);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3rem 2rem;
    width: 90%;
    max-width: 450px;
    text-align: center;
    box-shadow: 0 30px 60px rgba(0,0,0,0.2), var(--glass-highlight);
    position: relative;
    animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slideUp {
    from { transform: translateY(30px) scale(0.95); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.close-btn {
    position: absolute;
    top: 15px; right: 20px;
    font-size: 1.8rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s ease;
    line-height: 1;
}

.close-btn:hover {
    color: var(--neon-pink);
}

.cyber-modal select, 
.cyber-modal input {
    width: 100%;
    padding: 1rem;
    margin: 1.5rem 0;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.1);
    background: rgba(255, 255, 255, 0.5);
    font-size: 1rem;
    color: var(--text-main);
    outline: none;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.cyber-modal select:focus, 
.cyber-modal input:focus {
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.15);
}

#auth-message {
    margin-top: 1.5rem;
    font-weight: 600;
    min-height: 24px;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

/* --- Footer --- */
.site-footer {
    text-align: center;
    padding: 1.5rem;
    margin-top: auto;
    color: var(--text-muted);
    font-size: 0.9rem;
    background: var(--glass-bg);
    backdrop-filter: var(--blur-intensity);
    border-top: 1px solid var(--glass-border);
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    nav {
        flex-wrap: wrap;
        border-radius: 16px;
        padding: 1rem;
        width: 90%;
        gap: 1rem;
    }
    
    header h1 {
        font-size: 2.5rem !important;
        letter-spacing: 3px !important;
    }
    
    header h2 {
        font-size: 1.2rem !important;
        letter-spacing: 1px !important;
    }
}