@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@300;400;700&family=Orbitron:wght@400;700&display=swap');

:root {
    --bg-base: #060b14;
    --bg-panel: rgba(16, 25, 43, 0.65);
    --argo-green: #00a82d;
    --argo-green-dim: rgba(0, 168, 45, 0.15);
    --argo-blue: #00bfff;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --border-radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: var(--bg-base); color: var(--text-main);
    font-family: 'Merriweather', serif; font-size: 14px;
    height: 100vh; overflow: hidden; display: flex; flex-direction: column;
}

h1, h2, h3, h4, h5, h6, .orbitron-text, .program-title, .btn-argo, .argo-menu a, .argo-table th {
    font-family: 'Orbitron', sans-serif; letter-spacing: 1px;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,0.3); border-radius: 4px; }
::-webkit-scrollbar-thumb { background: var(--argo-green); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #00d639; }

.panel-glass {
    background: var(--bg-panel); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 168, 45, 0.4); border-top: 1px solid rgba(255, 255, 255, 0.15); border-left: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius); box-shadow: 0 15px 35px rgba(0, 0, 0, 0.9), inset 0 1px 2px rgba(255, 255, 255, 0.1);
    display: flex; flex-direction: column; overflow: hidden;
}

.argo-input {
    width: 100%; padding: 10px; background: rgba(0,0,0,0.5); border: 1px solid rgba(0, 168, 45, 0.3);
    color: var(--text-main); font-family: 'Merriweather', serif; font-size: 14px; border-radius: 6px; outline: none; transition: 0.2s;
}
.argo-input:focus { border-color: var(--argo-green); }

.btn-argo {
    background: var(--argo-green); color: #000; border: none; padding: 10px 20px; border-radius: 6px;
    font-weight: bold; cursor: pointer; text-transform: uppercase; transition: 0.2s;
}
.btn-argo:hover { background: #00d639; box-shadow: 0 0 15px rgba(0, 214, 57, 0.4); }

.btn-argo-outline {
    background: transparent; color: var(--text-main); border: 1px solid rgba(0, 168, 45, 0.4); padding: 10px 20px; border-radius: 6px; cursor: pointer; transition: 0.2s;
}
.btn-argo-outline:hover { background: rgba(0, 168, 45, 0.2); color: var(--argo-green); }
.btn-argo-outline.active { background: var(--argo-green); color: #000; border-color: var(--argo-green); }

.argo-table { width: 100%; border-collapse: collapse; color: var(--text-main); }
.argo-table th { text-align: left; padding: 12px; border-bottom: 2px solid var(--argo-green); color: var(--argo-green); }
.argo-table td { padding: 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }

.argo-topbar {
    display: flex; justify-content: space-between; align-items: center; height: 50px; background: rgba(10, 15, 25, 0.95);
    border-bottom: 1px solid var(--argo-green); padding: 0 1rem; flex-shrink: 0; box-shadow: 0 4px 20px rgba(0,0,0,0.8);
}
.topbar-center .program-title { color: var(--argo-green); font-size: 1.1rem; }
.logout-btn { color: var(--text-muted); text-decoration: none; font-size: 1.2rem; }
.logout-btn:hover { color: #ef4444; }
.menu-toggle { background: none; border: none; color: var(--text-main); font-size: 1.5rem; cursor: pointer; }

.argo-workspace { height: calc(100vh - 50px); display: flex; overflow: hidden; padding: 15px; gap: 15px; }

.argo-menu {
    position: fixed; top: 50px; left: -250px; width: 250px; height: calc(100vh - 50px);
    background-color: var(--bg-panel); backdrop-filter: blur(15px); border-right: 2px solid var(--argo-green);
    transition: left 0.3s ease; z-index: 1000; padding-top: 1rem; box-shadow: 15px 0 30px rgba(0,0,0,0.9);
}
.argo-menu.open { left: 0; }
.argo-menu a { display: block; padding: 1rem 2rem; color: var(--text-main); text-decoration: none; font-size: 1rem; border-bottom: 1px solid rgba(255,255,255,0.05); transition: 0.2s; }
.argo-menu a:hover { background: rgba(0, 168, 45, 0.15); color: var(--argo-green); border-left: 4px solid var(--argo-green); }

/* --- WINSTON APP SPECIFICS --- */
#col-left { flex: 1 1 25%; min-width: 280px; max-width: 350px; position: relative; }
#col-center { flex: 2; min-width: 0; }
#col-right { flex: 1 1 25%; min-width: 300px; max-width: 400px; padding: 15px; }

#avatar-view { 
    width: 100%; aspect-ratio: 1 / 1; flex-shrink: 0; position: relative; 
    background: radial-gradient(circle at center, #0a1120 0%, #000 100%); 
    border-radius: 12px 12px 0 0; overflow: hidden; 
}
#bg-canvas, #avatar-canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: block; }
#bg-canvas { z-index: 0; opacity: 0.3; pointer-events: none; }
#avatar-canvas { z-index: 1; }

.chat-feed { flex: 1; overflow-y: auto; padding: 15px; display: flex; flex-direction: column; gap: 15px; }
.msg-user, .msg-winston { max-width: 85%; padding: 12px 16px; border-radius: 8px; line-height: 1.5; font-size: 14px; box-shadow: 0 4px 10px rgba(0,0,0,0.4); }
.msg-user { align-self: flex-end; background: var(--argo-green-dim); border: 1px solid rgba(0, 168, 45, 0.3); }
.msg-winston { align-self: flex-start; background: rgba(0, 191, 255, 0.05); border-left: 3px solid var(--argo-green); }
.msg-winston b { color: var(--argo-green); font-size: 0.9rem; margin-bottom: 5px; display: inline-block; }

#input-drawer { display: flex; flex-direction: column; flex: 1; min-height: 0; background: rgba(0,0,0,0.2); overflow: hidden; }
.winston-toolbar { display: flex; gap: 10px; padding: 10px; background: rgba(0,0,0,0.5); border-top: 1px solid rgba(0, 168, 45, 0.3); border-bottom: 1px solid rgba(0, 168, 45, 0.3); align-items: center; flex: 0 0 65px; }
.winston-input-area { flex: 1; display: flex; padding: 15px; min-height: 0; overflow: hidden; }
.text-in { flex: 1; background: rgba(0,0,0,0.3); border: 1px solid rgba(0, 168, 45, 0.2); color: white; font-family: 'Merriweather', serif; font-size: 14px; outline: none; resize: none; padding: 10px; border-radius: 6px; transition: 0.2s; height: 100%; }
.text-in:focus { border-color: var(--argo-green); background: rgba(0,0,0,0.6); }

.btn-send, .btn-camera { align-self: flex-end; background: transparent; border: 1px solid rgba(0, 168, 45, 0.4); color: var(--argo-green); width: 45px; height: 45px; border-radius: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; transition: 0.2s; flex-shrink: 0; }
.btn-send:hover, .btn-camera.has-images { background: var(--argo-green); color: black; box-shadow: 0 0 10px rgba(0, 168, 45, 0.5); }
.image-tray { flex: 1; display: flex; gap: 5px; overflow-x: auto; align-items: center; height: 100%; }
.preview-thumb { width: 40px; height: 40px; border-radius: 4px; background-size: cover; position: relative; border: 1px solid rgba(255,255,255,0.2); flex-shrink: 0; }
.kill-btn { position: absolute; top: -5px; right: -5px; background: #ef4444; color: white; border-radius: 50%; width: 16px; height: 16px; font-size: 10px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-family: sans-serif; }

.collapse-btn { display: none; background: transparent; border: none; color: var(--argo-green); font-size: 1.5rem; cursor: pointer; padding: 0 10px; }

.data-pane { flex: 1; overflow-y: auto; font-family: monospace; font-size: 13px; color: #a0aec0; }
.data-pane pre { background: rgba(0,0,0,0.6); padding: 12px; border-radius: 6px; overflow-x: auto; margin: 10px 0; border-left: 2px solid var(--argo-blue); position: relative;}
.data-pane code { font-family: monospace; color: var(--argo-green); }
.copy-btn { position: absolute; top: 5px; right: 5px; background: #334155; color: white; border: none; padding: 4px 10px; font-size: 0.75rem; cursor: pointer; border-radius: 4px; font-family: 'Orbitron', sans-serif;}
.copy-btn:hover { background: var(--argo-blue); color: #000; }

.mobile-nav { display: none; }

/* 80/20 Mobile Layout Override */
@media (max-width: 900px) {
    .argo-workspace { flex-direction: column; padding: 0; gap: 0; padding-bottom: 20vh; padding-bottom: 20dvh; }
    #col-right { display: none !important; }
    
    #col-left { 
        display: flex !important; flex-direction: column !important;
        width: 100% !important; max-width: none !important; 
        background: none !important; border: none !important; box-shadow: none !important; border-radius: 0 !important;
        backdrop-filter: none !important; -webkit-backdrop-filter: none !important; transform: none !important;
        flex: 1 1 auto !important; 
    }
    
    .mobile-nav {
        display: flex; order: -1; width: 100%; flex: 0 0 auto;
        background: var(--bg-panel); border-bottom: 1px solid rgba(0, 168, 45, 0.3); z-index: 100;
        backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    }
    .mobile-nav button { flex: 1; padding: 15px; background: none; border: none; color: var(--text-muted); font-size: 1rem; cursor: pointer; transition: 0.2s; }
    .mobile-nav button.active { color: var(--argo-green); border-bottom: 3px solid var(--argo-green); background: rgba(0, 168, 45, 0.1); }
    
    #avatar-view { order: 1; width: 100%; flex: 1 1 auto; aspect-ratio: auto; border-radius: 0; display: block; }
    #col-center { order: 1; display: none; width: 100% !important; flex: 1 1 auto !important; margin: 0; }
    
    #input-drawer {
        position: fixed !important; bottom: 0 !important; left: 0 !important; width: 100% !important; 
        height: 20vh !important; height: 20dvh !important;
        background: var(--bg-base) !important; border-top: 2px solid var(--argo-green) !important;
        z-index: 9999 !important; transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        border-radius: 0 !important;
    }
    #input-drawer.expanded { height: calc(100vh - 50px) !important; height: calc(100dvh - 50px) !important; }
    #input-drawer.expanded .collapse-btn { display: block; }
}
