:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --bg-light: #ecf0f1;
    --bg-dark: #ffffff;
    --border-color: #bdc3c7;
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-light);
    color: var(--primary-color);
    line-height: 1.6;
}

header {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 2rem;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

header h1 {
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
}

.anycoder-link {
    display: inline-block;
    color: #f39c12;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.anycoder-link:hover {
    color: #e67e22;
}

.container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.controls-panel, .visualization-panel {
    background-color: var(--bg-dark);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

h2 {
    color: var(--secondary-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

textarea {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: var(--font-family);
    resize: vertical;
}

button {
    background-color: var(--secondary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
    width: 100%;
}

button:hover:not(:disabled) {
    background-color: #2980b9;
}

button:disabled {
    background-color: var(--border-color);
    cursor: not-allowed;
}

.status {
    margin-top: 1rem;
    padding: 0.5rem;
    border-radius: 4px;
    text-align: center;
    font-weight: bold;
}

.status.loading {
    background-color: #f1c40f33;
    color: #f39c12;
}

.status.ready {
    background-color: #2ecc7133;
    color: #27ae60;
}

/* Results Panel Styling */
#resultsPanel.hidden {
    display: none;
}

.slider-group {
    margin: 1.5rem 0;
    padding: 1rem;
    border: 1px dashed var(--border-color);
    border-radius: 4px;
}

#dimensionSlider {
    width: 100%;
    margin: 0.5rem 0 1rem;
}

.similarity-output {
    margin-top: 1rem;
    font-size: 1.1rem;
    font-weight: 500;
}

#currentSimilarity {
    font-weight: bold;
    color: var(--accent-color);
}

.visualization-group {
    text-align: center;
    margin-top: 2rem;
}

#matryoshkaDoll {
    font-size: 8rem;
    transition: font-size 0.5s ease-in-out;
    display: inline-block;
}

.doll-xl { font-size: 8rem; }
.doll-l { font-size: 6.5rem; }
.doll-m { font-size: 5rem; }
.doll-s { font-size: 3.5rem; }
.doll-xs { font-size: 2rem; }
.doll-xxs { font-size: 1rem; }

.explanation {
    font-style: italic;
    color: #7f8c8d;
    margin-top: 0.5rem;
}

.chart-description {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 1rem;
}

.chart-container {
    height: 350px;
    width: 100%;
}

footer {
    text-align: center;
    padding: 1rem;
    margin-top: 2rem;
    color: #7f8c8d;
    font-size: 0.85rem;
    border-top: 1px solid var(--border-color);
}

/* Desktop Layout */
@media (min-width: 768px) {
    .container {
        flex-direction: row;
    }
    .controls-panel {
        flex: 1 1 35%;
    }
    .visualization-panel {
        flex: 1 1 60%;
    }
    button {
        width: auto;
    }
}