/* PROMPTMASTER OS - INDUSTRIAL GRADE STYLESHEET 
    v5.1.0 (LAYOUT FIXES)
*/

:root {
    --bg-onyx: #0f172a;      
    --bg-surface: #1e293b;   
    --accent: #6366f1;       
    --accent-hover: #4f46e5; 
    --highlight: #38bdf8;    
    --text-primary: #cbd5e1; 
    --danger: #f43f5e;       
    --success: #10b981;      
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden; 
    background-color: var(--bg-onyx);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

main {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* CRITICAL FIX: Ensures scrollable area doesn't get pushed behind footer */
.flex-scroll-fix {
    flex: 1 1 0%;
    min-height: 0; 
}

.glass-panel {
    background: rgba(30, 41, 59, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px); 
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.2), 
        0 2px 4px -1px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    height: 100%; 
}

.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 10px;
    border: 1px solid var(--bg-onyx);
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

input, textarea, select {
    -webkit-appearance: none;
    appearance: none;
    border-radius: 0.5rem;
    background-color: #020617; 
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.25em 1.25em;
    padding-right: 2.5rem;
}

@keyframes toastSlideUp {
    0% { transform: translateY(-100%); opacity: 0; }
    15% { transform: translateY(0); opacity: 1; }
    85% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(-100%); opacity: 0; }
}

.toast-animate {
    animation: toastSlideUp 3s ease-in-out forwards;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.animate-pulse-slow {
    animation: pulse-glow 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.active-nav {
    background-color: rgba(51, 65, 85, 0.5);
    border-left: 3px solid var(--accent);
    color: white;
}

/* CRITICAL FIX: Output container layout */
#output-panel-container {
    display: flex;
    flex-direction: column;
}

#output-textarea-wrapper {
    position: relative;
    flex: 1; /* This makes it take up remaining space */
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#output-area {
    flex: 1; /* Forces textarea to fill the wrapper */
    width: 100%;
    resize: none;
    border: none;
    padding: 1.5rem;
    font-family: 'JetBrains Mono', monospace;
    line-height: 1.6;
    color: #e2e8f0;
}

#help-modal.modal-open {
    display: block; 
    opacity: 1;     
}

#help-modal.modal-open .glass-panel {
    transform: scale(1); 
}

#help-modal .glass-panel {
    transform: scale(0.95);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.select-none {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

input, textarea {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}
