/* Custom CSS Variables for Easy Styling Management */
:root {
    --bg-main: #0d1117;
    --bg-surface: #161b22;
    --bg-input: #21262d;
    --text-primary: #c9d1d9;
    --text-accent: #ff9900; /* Distinct Orange */
    --text-success: #2ea44f; /* Secure Green */
    --border-color: #30363d;
    --font-ui: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-mono: 'Courier New', Courier, monospace;
}

/* Global Reset & Base Elements */
* {
    box-sizing: border-box;
}

/* Base Body Elements */
body {
    background: linear-gradient(rgba(13, 17, 23, 0.9), rgba(13, 17, 23, 0.9)), url("../images/hero-bg.jpg") no-repeat center center fixed;
    background-size: cover;
    color: var(--text-primary);
    font-family: var(--font-ui);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden; /* Prevent horizontal scroll on body */
}

/* Header Area Styling */
header {
    background-color: rgba(22, 27, 34, 0.9);
    border-bottom: 2px solid var(--border-color);
    padding: 15px 30px;
}

header h1 {
    color: var(--text-primary);
    margin: 0;
    font-size: 1.8rem;
    letter-spacing: 2px;
}

header h1 span {
    color: var(--text-accent);
}

header h2 {
    color: #8b949e;
    font-size: 0.9rem;
    margin: 5px 0 0 0;
    font-weight: normal;
}

/* Macro Layout Structure: 3-Pane CSS Grid Alignment */
#workspace {
    display: grid;
    grid-template-columns: minmax(200px, 220px) 1fr minmax(250px, 280px); /* Use minmax to allow some flexibility */
    gap: 0;
    flex-grow: 1;
    width: 100%; /* Ensure it spans the full width */
}

/* Responsive Grid Adjustment (Murach Chapter 8: RWD) */
@media (max-width: 1024px) {
    #workspace {
        grid-template-columns: 1fr;
    }
    
    #sidebar-nav, #variable-controls {
        border: none;
        border-bottom: 1px solid var(--border-color);
    }
}

/* Pane 1: Sidebar Navigation Tree */
#sidebar-nav {
    background-color: rgba(22, 27, 34, 0.7); /* Transparent Surface */
    border-right: 1px solid var(--border-color);
    padding: 20px;
}

#sidebar-nav h3 {
    color: var(--text-accent);
    font-size: 0.9rem;
    text-transform: uppercase;
    margin-top: 0;
}

#sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#sidebar-nav li {
    margin-bottom: 12px;
}

#sidebar-nav a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.95rem;
    display: block;
    padding: 6px 10px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

/* Pseudo-classes for Nav Interaction */
#sidebar-nav a:hover {
    color: var(--text-success);
    background-color: var(--bg-input);
}

#sidebar-nav a.active {
    background-color: var(--text-accent);
    color: var(--bg-main);
    font-weight: bold;
}

/* Pane 2: Content Forge Display */
#content-forge {
    padding: 30px;
    background-color: rgba(13, 17, 23, 0.6); /* Transparent Main */
    min-width: 0; /* Important for Grid/Flexbox to allow shrinking */
}

.display-box h3 {
    margin-top: 0;
    font-size: 1.2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.code-container {
    background-color: #010409;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 20px;
    position: relative;
    box-shadow: inset 0 4px 12px rgba(0,0,0,0.5);
    overflow-x: auto; /* Allow internal scroll for long lines if wrap fails */
}

/* Advanced First-Letter Selector Rule for Code Blocks */
#payload-output, code {
    font-family: var(--font-mono);
    color: var(--text-success);
    white-space: pre-wrap; /* Wrap long lines */
    word-break: break-all; /* Break long words/URLs */
    margin: 0;
}

/* Pane 3: Variable Toggles (Flexbox Structure) */
#variable-controls {
    background-color: rgba(22, 27, 34, 0.7); /* Transparent Surface */
    border-left: 1px solid var(--border-color);
    padding: 20px;
}

#variable-controls h3 {
    color: var(--text-accent);
    font-size: 0.9rem;
    text-transform: uppercase;
    margin-top: 0;
}

.control-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.control-group label, .label-mock {
    font-size: 0.85rem;
    color: #8b949e;
    margin-bottom: 6px;
}

.control-group input[type="text"] {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 6px;
    font-family: var(--font-mono);
}

.control-group input[type="text"]:focus {
    outline: none;
    border-color: var(--text-accent);
}

/* Flexbox Alignment inside Forms */
.toggle-container {
    display: flex;
    background-color: var(--bg-input);
    padding: 4px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.radio-label {
    flex: 1;
    text-align: center;
    font-size: 0.85rem;
    padding: 6px 0;
    cursor: pointer;
    color: var(--text-primary);
}

/* App Footer Layout */
footer {
    background-color: rgba(22, 27, 34, 0.9);
    border-top: 1px solid var(--border-color);
    padding: 15px;
    text-align: center;
    font-size: 0.8rem;
    color: #8b949e;
}
