:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --bg-color: #ecf0f1;
    --card-bg: #ffffff;
    --text-color: #2c3e50;
    --border-color: #bdc3c7;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

header .subtitle {
    font-size: 1.2em;
    margin-bottom: 10px;
    opacity: 0.9;
}

header .credit {
    font-size: 0.9em;
    opacity: 0.8;
    font-style: italic;
}

main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-section,
.input-section,
.output-section,
.stats-section {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.info-section h2,
.input-section h2,
.output-section h2,
.stats-section h2 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.5em;
}

.info-section ul {
    list-style-position: inside;
    margin-left: 20px;
}

.info-section li {
    margin: 8px 0;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--primary-color);
}

textarea {
    width: 100%;
    min-height: 200px;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.3s;
}

textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
}

textarea#output {
    background-color: #f8f9fa;
    min-height: 250px;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.example-btn {
    background-color: var(--secondary-color);
    color: white;
}

.example-btn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.clear-btn {
    background-color: var(--warning-color);
    color: white;
}

.clear-btn:hover {
    background-color: #e67e22;
}

.action-btn {
    background-color: var(--success-color);
    color: white;
}

.action-btn:hover {
    background-color: #229954;
}

.controls {
    text-align: center;
    padding: 20px;
}

.process-btn {
    background: linear-gradient(135deg, var(--success-color), #229954);
    color: white;
    padding: 15px 40px;
    font-size: 16px;
    box-shadow: var(--shadow);
}

.process-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.process-btn:active {
    transform: translateY(0);
}

.status {
    margin-top: 15px;
    padding: 10px;
    border-radius: 6px;
    font-weight: 600;
    min-height: 20px;
}

.status.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status.processing {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.stats-section {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

#statsContent {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.stat-item {
    background: white;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.stat-item .label {
    font-size: 0.9em;
    color: #6c757d;
    margin-bottom: 5px;
}

.stat-item .value {
    font-size: 2em;
    font-weight: bold;
    color: var(--primary-color);
}

.sense-Expansion { color: #27ae60; }
.sense-Contingency { color: #e74c3c; }
.sense-Comparison { color: #f39c12; }
.sense-Temporal { color: #3498db; }

footer {
    text-align: center;
    padding: 30px 20px;
    color: #7f8c8d;
    font-size: 0.9em;
}

footer a {
    color: var(--secondary-color);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
    }

    .container {
        padding: 10px;
    }

    .button-group {
        flex-direction: column;
    }

    button {
        width: 100%;
    }
}
