/* 
 * P5.js Preposition Examples - Global Styles
 * Shared CSS for all preposition example pages
 */

/* CSS Custom Properties */
:root {
    --bg-primary: #fff;
    --bg-secondary: #f5f5f5;
    --bg-tertiary: #f8f8f8;
    --bg-quaternary: #eee;
    --bg-accent: #ddd;
    --text-primary: #000;
    --text-secondary: #333;
    --text-tertiary: #666;
    --border-primary: #000;
    --border-secondary: #333;
    --border-tertiary: #666;
    --border-light: #ddd;
    --accent-color: #000;
    --accent-hover: #333;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 20px;
    font-family: 'Courier New', monospace;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Layout containers */
.container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: flex-start;
}

.canvas-container {
    text-align: center;
}

/* Description and content sections */
.description {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background: var(--bg-primary);
    border-radius: 8px;
    line-height: 1.6;
}

/* Typography */
h1 {
    font-size: 2em;
    margin-bottom: 10px;
    font-weight: normal;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 10px;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
}

h3 {
    color: var(--text-primary);
    margin-top: 25px;
    margin-bottom: 15px;
    font-weight: normal;
    font-size: 1.2em;
    font-family: 'Courier New', monospace;
}

.subtitle {
    margin-bottom: 30px;
    opacity: 0.8;
    font-size: 0.9em;
    font-family: 'Courier New', monospace;
}

p {
    margin-bottom: 15px;
    font-family: 'Courier New', monospace;
}

ul {
    margin-left: 20px;
    margin-bottom: 15px;
    font-family: 'Courier New', monospace;
}

li {
    margin-bottom: 5px;
    font-family: 'Courier New', monospace;
}

/* Links */
a {
    color: var(--accent-color);
    text-decoration: none;
    font-family: 'Courier New', monospace;
}

a:hover {
    text-decoration: underline;
    color: var(--accent-hover);
}

/* Web editor link styling */
.web-editor-link {
    display: inline-block;
    background: var(--bg-quaternary);
    color: var(--text-primary);
    padding: 12px 20px;
    border: 1px solid var(--border-secondary);
    border-radius: 4px;
    text-decoration: none;
    font-size: 1em;
    margin-bottom: 15px;
    transition: all 0.3s;
    font-family: 'Courier New', monospace;
    cursor: pointer;
}

.web-editor-link:hover {
    background: var(--bg-accent);
    text-decoration: none;
    color: var(--text-primary);
}

.web-editor-link-container {
    margin-bottom: 15px;
    padding: 0;
    background: none;
    border: none;
}

.web-editor-link-container small {
    color: var(--text-tertiary);
    font-family: 'Courier New', monospace;
}

/* Code sections */
.code-section {
    background: var(--bg-tertiary);
    padding: 20px;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    margin: 20px 0;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.4;
    color: var(--text-primary);
}

.code-section strong {
    color: #333;
}

.code-section code {
    background: #e8e8e8;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 13px;
}

/* Controls for interactive examples */
#controls {
    margin: 10px 0;
}

button {
    padding: 10px 20px;
    margin: 5px;
    border: none;
    border-radius: 5px;
    background: #666;
    color: white;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s;
}

button:hover {
    background: #555;
}

button:disabled {
    background: #cccccc;
    cursor: not-allowed;
}

/* Status displays */
#status {
    margin: 10px 0;
    padding: 8px 12px;
    background: #f5f5f5;
    border-left: 3px solid #666;
    font-size: 14px;
    color: #333;
}

/* Canvas container */
#sketch-holder, #canvas {
    margin: 0 auto;
    display: block;
}

/* Index page specific styles */
.index-body {
    font-family: 'Courier New', monospace;
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 0;
    height: 100vh;
    overflow: hidden;
}

.index-container {
    display: flex;
    height: 100vh;
    max-width: 1200px;
    margin: 0 auto;
}

.sidebar {
    width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-light);
    overflow-y: auto;
    flex-shrink: 0;
}

.header {
    padding: 20px;
    border-bottom: 1px solid var(--accent-color);
    background: var(--accent-color);
    color: var(--bg-primary);
}

.header h1 {
    font-size: 20px;
    font-weight: normal;
    margin-bottom: 5px;
    border-bottom: none;
    padding-bottom: 0;
    color: var(--bg-primary);
    font-family: 'Courier New', monospace;
}

.header p {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 0;
    font-family: 'Courier New', monospace;
}

.menu-group {
    margin-bottom: 15px;
}

.group-title {
    padding: 15px 20px 10px 20px;
    font-size: 14px;
    font-weight: normal;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-light);
    font-family: 'Courier New', monospace;
}

.menu-item {
    display: block;
    padding: 12px 20px 12px 35px;
    color: var(--accent-color);
    text-decoration: none;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    font-family: 'Courier New', monospace;
    font-weight: normal;
}

.menu-item:hover {
    background: var(--bg-quaternary);
    color: var(--accent-color);
}

.menu-item.active {
    background: var(--accent-color);
    color: var(--bg-primary);
    border-right: 3px solid var(--accent-color);
}

.content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.content-header {
    background: var(--bg-primary);
    padding: 20px;
    border-bottom: 1px solid var(--border-light);
}

.content-header h2 {
    font-size: 18px;
    color: var(--text-primary);
    margin: 0;
    font-weight: normal;
    font-family: 'Courier New', monospace;
}

.frame-container {
    flex: 1;
    background: var(--bg-tertiary);
    position: relative;
    overflow: auto;
    border: 1px solid var(--border-light);
}

iframe {
    width: 100%;
    height: 100%;
    border: 1px solid var(--border-light);
    border-radius: 4px;
}

.welcome-message {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: var(--text-primary);
    font-size: 16px;
    font-family: 'Courier New', monospace;
    padding-top: 80px;
}

.welcome-content {
    max-width: 500px;
    padding: 30px;
}

.welcome-content h3 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 24px;
    margin-top: 0;
    font-weight: normal;
    font-family: 'Courier New', monospace;
}

.welcome-content p {
    line-height: 1.6;
    margin-bottom: 15px;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
}

/* Hide mobile-specific elements */
.mobile-toggle {
    display: none;
}
