body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background: linear-gradient(to bottom right, #e6f2ff, #f0e6ff);
}

.periodic-table-container {
    max-width: 100%;
    margin: 0 auto;
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    overflow-x: auto; /* Add horizontal scroll if needed */
}

h2 {
    text-align: center;
    color: #333;
}

select {
    display: block;
    margin: 20px auto;
    padding: 10px;
    font-size: 16px;
    border-radius: 5px;
    border: 1px solid #ccc;
    max-width: 100%;
}

.periodic-table {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 10px;
    justify-content: center;
}

.element {
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 5px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 80px;
}

.element:hover {
    transform: scale(1.05);
    box-shadow: 0 0 5px rgba(0,0,0,0.2);
}

.element .atomic-number {
    font-size: 10px;
    font-weight: bold;
}

.element .symbol {
    font-size: 18px;
    font-weight: bold;
}

.element .name {
    font-size: 10px;
}

.element .source {
    font-size: 8px;
    margin-top: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ... rest of the CSS remains the same ... */

/* Add these media queries at the end of your CSS file */
@media (max-width: 1200px) {
    .periodic-table {
        grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    }
    .element {
        min-width: 70px;
    }
}

@media (max-width: 768px) {
    .periodic-table {
        grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    }
    .element {
        min-width: 60px;
    }
    .element .symbol {
        font-size: 16px;
    }
    .element .name,
    .element .source {
        font-size: 8px;
    }
}

@media (max-width: 480px) {
    .periodic-table {
        grid-template-columns: repeat(auto-fit, minmax(50px, 1fr));
    }
    .element {
        min-width: 50px;
        padding: 3px;
    }
    .element .symbol {
        font-size: 14px;
    }
    .element .atomic-number {
        font-size: 8px;
    }
    .element .name,
    .element .source {
        font-size: 6px;
    }
}

/* Add this to your existing CSS */

.button-group {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    background-color: #007bff;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.button:hover {
    background-color: #0056b3;
}

.button.active {
    background-color: #28a745;
}

/* Update the .element styles */
.element {
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 5px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 80px;
}

.element:hover {
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

a {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    background-color: #ff2600;
    color: white;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

a:hover {
    background-color: #4f0801;
}

