:root {
    --beaker-color: rgba(200, 220, 255, 0.3);
    --liquid-color: rgba(100, 150, 255, 0.5);
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background: #1a1a1a;
    color: #fff;
}

h1 {
    font-size: 3em;
    text-align: center;
}

#app {
    max-width: 1200px;
    margin: 0 auto;
}

#periodic-table {
    display: grid;
    grid-template-columns: repeat(18, 1fr);
    gap: 2px;
    margin-bottom: 20px;
    font-size: 0.8em;
}

.element {
    background: #333;
    padding: 6px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 4px;
    font-size: 0.9em;
    border: 2px solid transparent;
}

.element:hover {
    background: #444;
    transform: scale(1.1);
}

.element.selected {
    background: #4a90e2;
}

.element .symbol {
    font-weight: bold;
    font-size: 1.1em;
    margin: 2px 0;
}

.element .number {
    font-size: 0.75em;
    color: #999;
}

.element .name {
    font-size: 0.65em;
    color: #ccc;
    margin-top: 2px;
}

.element .alt-name {
    font-size: 0.6em;
    color: #999;
    font-style: italic;
}

#mixing-container {
    display: flex;
    gap: 40px;
    justify-content: center;
}

#mixer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

#beaker {
    width: 200px;
    height: 300px;
    background: var(--beaker-color);
    border: 4px solid #666;
    border-radius: 0 0 20px 20px;
    position: relative;
    overflow: hidden;
}

#liquid {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 0;
    background: var(--liquid-color);
    transition: all 0.5s ease;
}

#bubbles {
    position: absolute;
    width: 100%;
    height: 100%;
}

.bubble {
    position: absolute;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    animation: rise 3s infinite;
}

@keyframes rise {
    0% {
        transform: translateY(100%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(-100%) scale(0);
        opacity: 0;
    }
}

#selected-elements {
    text-align: center;
}

#elements-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0;
    min-height: 50px;
}

.selected-element {
    background: #4a90e2;
    padding: 5px 10px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.remove-element {
    cursor: pointer;
    color: #fff;
    background: none;
    border: none;
    padding: 0 5px;
}

button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin: 5px;
    font-size: 1em;
}

#mix-btn {
    background: #4caf50;
    color: white;
}

#mix-btn:disabled {
    background: #666;
    cursor: not-allowed;
}

#clear-btn {
    background: #f44336;
    color: white;
}

#result {
    text-align: center;
}

#result-display {
    background: #333;
    padding: 20px;
    border-radius: 10px;
    min-height: 200px;
    min-width: 300px;
}

#recipe-book {
    margin-top: 30px;
    background: #222;
    padding: 20px;
    border-radius: 10px;
}

#recipes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.recipe-card {
    background: #333;
    padding: 15px;
    border-radius: 8px;
    transition: transform 0.2s;
    cursor: pointer;
}

.recipe-card:hover {
    transform: translateY(-5px);
    background: #444;
}

.recipe-formula {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 8px;
    color: #4a90e2;
}

.recipe-name {
    color: #fff;
    font-size: 1.1em;
    margin-bottom: 5px;
}

.recipe-description {
    color: #aaa;
    font-size: 0.9em;
}

.recipe-elements {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.recipe-element {
    background: #4a90e2;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.9em;
}

.compounds-section {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
    padding: 20px;
    background: #222;
    border-radius: 10px;
}

.compound-element {
    flex-basis: 100px;
    background: #333;
    border: 2px solid;
}

.compound-element .symbol {
    font-size: 1em;
}
