/* Industrial UI Theme: Dark, metallic, factory-inspired */
body {
    font-family: 'Courier New', monospace; /* Monospace for a techy feel */
    background-color: #1a1a1a; /* Dark gray */
    color: #e0e0e0; /* Light gray text */
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

header {
    text-align: center;
    margin-bottom: 20px;
}

h1 {
    color: #c0c0c0; /* Metallic silver */
    text-shadow: 2px 2px 4px #000;
    font-size: 2.5em;
}

p {
    color: #a0a0a0;
}

#periodic-table {
    display: grid;
    grid-template-columns: repeat(18, 1fr); /* 18 columns for the table */
    gap: 5px;
    max-width: 1200px;
    margin: 0 auto;
}

.element {
    width: 50px;
    height: 50px;
    background-color: #333; /* Dark metallic */
    border: 1px solid #555;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    font-size: 0.8em;
    color: #fff;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.5);
}

.element:hover {
    background-color: #555; /* Lighter on hover */
    transform: scale(1.1);
}

.element.empty {
    background-color: transparent;
    border: none;
    cursor: default;
}

.element .symbol {
    font-weight: bold;
    font-size: 1.2em;
}

.element .number {
    font-size: 0.7em;
    margin-top: 2px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #222; /* Dark modal */
    padding: 20px;
    border: 1px solid #555;
    width: 80%;
    max-width: 500px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.5);
    color: #e0e0e0;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #fff;
}

#element-details h2 {
    margin-top: 0;
    color: #c0c0c0;
}

#element-details p {
    margin: 5px 0;
}