:root {
    --fg: #166534;
    --bg: #fefce8;
    --button_fg: #fefce8;
    --button_bg: #166534;
    --button_bg_clicked: #0d4322;
    --border: #c4c4c4;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background-color: var(--bg);
    color: var(--fg);
    font-family: Arial, Helvetica, sans-serif;
}

header {
    padding: 1rem;
    border-bottom: 2px solid var(--border);
    display: flex;
    justify-content: space-between;
}

h1 {
    font-family: 'Oswald', sans-serif;
    font-size: 2rem;
    margin: 0;
    margin-right: 2%;
    display: inline-block;
}

.tagline {
    margin: 0.5rem 0 0 0;
    margin-top: auto ;
    font-style: italic;
    color: #666;
    display: inline-block;
    justify-self: left;
    align-self: left;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 120px);
    gap: 1rem;
    padding: 1rem;
}

/* Drawing Section */
.drawing-section {
    flex: 1;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    align-items: center;
}

.layout-select {
    padding: 0.5rem;
    border: 2px solid var(--border);
    border-radius: 4px;
    background: white;
}

.color-palette {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.color-btn {
    padding: 0.5rem 0.75rem;
    border: 2px solid transparent;
    cursor: pointer;
    background: white;
    border-radius: 4px;
}

.color-btn::before {
    content: '●';
    font-size: 16px;
    margin-right: 0.5rem;
}

.color-btn.red::before {
    color: #ff0000;
}

.color-btn.green::before {
    color: #00ff00;
}

.color-btn.blue::before {
    color: #0000ff;
}

.color-btn.yellow::before {
    color: #DAA520;
}

.color-btn.purple::before {
    color: #ff00ff;
}

.color-btn.active {
    border-color: var(--fg);
    background: #f0f0f0;
}

.action-btn {
    padding: 0.5rem 1rem;
    background-color: var(--button_bg);
    color: var(--button_fg);
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.action-btn:hover {
    background-color: var(--button_bg_clicked);
}

canvas {
    width: 100%;
    max-width: 800px;
    background-color: #ffffff;
    border: 2px solid var(--border);
    border-radius: 8px;
    display: block;
    margin: 0 auto;
}

/* Output Section */
.output-section {
    flex: 1;
}

.ascii-display {
    font-family: 'Courier New', monospace;
    font-size: 10px;
    background-color: #f8f8f8;
    border: 2px solid var(--border);
    padding: 1rem;
    white-space: pre;
    overflow-x: auto;
    max-height: 300px;
    overflow-y: auto;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.input-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.input-group label {
    font-weight: bold;
    font-size: 0.9rem;
}

.input-group input {
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: 4px;
    font-size: 1rem;
}

.text-areas {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.text-areas>div {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.text-areas label {
    font-weight: bold;
    font-size: 0.9rem;
}

.text-areas input {
    padding: 0.5rem;
    border: 2px solid var(--border);
    border-radius: 4px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.primary-btn {
    padding: 1rem 2rem;
    background-color: var(--button_bg);
    color: var(--button_fg);
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

.primary-btn:hover {
    background-color: var(--button_bg_clicked);
}

/* Desktop Layout - Side by Side */
@media (min-width: 768px) {
    .app-container {
        flex-direction: row;
        gap: 2rem;
        padding: 2rem;
    }

    .drawing-section {
        flex: 1;
        max-width: 50%;
    }

    .output-section {
        flex: 1;
        max-width: 50%;
    }

    .controls {
        justify-content: flex-start;
    }

    .ascii-display {
        max-height: 400px;
        font-size: 11px;
    }

    canvas {
        max-width: none;
    }
}

/* Large Desktop */
@media (min-width: 1200px) {
    .app-container {
        max-width: 1400px;
        margin: 0 auto;
        padding: 2rem;
    }

    .ascii-display {
        font-size: 12px;
    }
}

.github-btn {

    padding: 10px 12px;
    margin-bottom: 5px;
    background: #166534;
    margin-inline-end: 0px;
    /* Your forest green */
    color: #fefce8;
    /* Your cream */
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: background 0.2s;
}

.github-btn:hover {
    background: #124a26;
    /* Darker green on hover */
}

.input-group input,
.input-group textarea {
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
}

.input-group textarea {
    resize: vertical;
}