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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 30px;
}

h1 {
    color: #333;
    margin-bottom: 30px;
    text-align: center;
    font-size: 2.5em;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.input-section {
    margin-bottom: 30px;
}

label {
    display: block;
    margin-bottom: 10px;
    color: #555;
    font-weight: 600;
}

textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.3s;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
}

.output-section {
    margin-bottom: 30px;
}

h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.tree-view {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    min-height: 200px;
    font-family: 'Courier New', monospace;
}

.tree-node {
    margin: 4px 0;
}

.node-header {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    user-select: none;
}

.node-header:hover {
    transform: translateX(2px);
}

.toggle {
    display: inline-block;
    width: 16px;
    margin-right: 8px;
    color: #666;
}

.node-type {
    font-weight: bold;
    margin-right: 8px;
}

.brackets {
    color: #999;
    font-weight: normal;
}

.structure .node-type {
    color: #e74c3c;
}

.structure {
    background: #ffe5e5;
}

.invocation .node-type {
    color: #3498db;
}

.invocation {
    background: #e5f2ff;
}

.existence .node-type {
    color: #2ecc71;
}

.existence {
    background: #e5ffe5;
}

.specification .node-type {
    color: #f39c12;
}

.specification {
    background: #fff5e5;
}

.conjuration .node-type {
    color: #9b59b6;
}

.conjuration {
    background: #f5e5ff;
}

.text .node-type {
    color: #666;
}

.text-node .node-header {
    background: #f0f0f0;
    cursor: default;
}

.text-value {
    color: #2c3e50;
    font-style: italic;
}

.text-content {
    color: #95a5a6;
}

.node-children {
    margin-top: 4px;
}

.error {
    background: #fee;
    border: 1px solid #fcc;
    color: #c00;
    padding: 15px;
    border-radius: 8px;
    font-family: monospace;
}

.placeholder {
    color: #999;
    text-align: center;
    padding: 40px;
    font-style: italic;
}

.examples {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #e0e0e0;
}

h3 {
    color: #555;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.example-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.example-buttons button {
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    font-weight: 500;
}

.example-buttons button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.example-buttons button:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .example-buttons {
        flex-direction: column;
    }
    
    .example-buttons button {
        width: 100%;
    }
}