/* ============================================================
   PERIODIC TABLE ELEMENT FILTER
============================================================ */

.element-filter-group {
    width: 100%;
}


/* ============================================================
   PERIODIC TABLE WRAPPER
============================================================ */

.periodic-table-wrapper {
    display: flex;

    flex-direction: column;

    align-items: center;

    gap: 16px;

    width: fit-content;
    max-width: 100%;

    padding: 16px;

    margin-top: 5px;

    background: #f5f9fd;

    border: 1px solid #dfe8f1;

    border-radius: 12px;
}


/* ============================================================
   MAIN PERIODIC TABLE
============================================================ */

.periodic-main-table {
    display: grid;

    grid-template-columns:
        repeat(18, 30px);

    grid-auto-rows: 30px;

    column-gap: 2px;
    row-gap: 2px;

    width: fit-content;
}


/* ============================================================
   LANTHANIDE / ACTINIDE
============================================================ */

.periodic-series-table {
    display: grid;

    grid-template-columns:
        repeat(15, 30px);

    grid-template-rows:
        repeat(2, 30px);

    column-gap: 2px;
    row-gap: 2px;

    width: fit-content;

    padding: 8px;

    background: #edf5fd;

    border: 1px solid #d2e3f4;

    border-radius: 9px;
}


/* ============================================================
   ELEMENT BUTTON
============================================================ */

.periodic-element {
    position: relative;

    width: 30px;
    min-width: 30px;

    height: 30px;

    padding: 0;
    margin: 0;

    border: 1px solid #d8e1ea;

    border-radius: 4px;

    background: #ffffff;

    color: #334e68;

    font-family: inherit;

    font-size: 7px;

    cursor: pointer;

    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease,
        transform 0.1s ease,
        box-shadow 0.15s ease;
}


.periodic-element:hover {
    background: #edf5ff;

    border-color: #91b9e8;

    color: #2878e5;

    transform: translateY(-1px);

    box-shadow:
        0 2px 5px rgba(40, 120, 229, 0.10);
}


.periodic-element.selected {
    background: #dcecff;

    border-color: #2878e5;

    color: #185abc;

    font-weight: 700;

    box-shadow:
        0 0 0 1px rgba(40, 120, 229, 0.08);
}


/* ============================================================
   ATOMIC NUMBER
============================================================ */

.periodic-element .atomic-number {
    display: block;

    font-size: 8px;

    color: #9aa8b7;

    line-height: 1;

    text-align: left;
}


/* ============================================================
   ELEMENT SYMBOL
============================================================ */

.periodic-element .element-symbol {
    display: block;

    font-size: 13px;

    font-weight: 700;

    line-height: 1.5;

    text-align: center;
}


/* ============================================================
   SELECTED ELEMENTS AREA
============================================================ */

.selected-elements-area {
    display: flex;

    align-items: center;

    flex-wrap: wrap;

    gap: 8px;

    margin-top: 10px;

    padding: 10px 12px;

    background: #f8fafc;

    border: 1px solid #e1e8f0;

    border-radius: 8px;
}


/* ============================================================
   SELECTED ELEMENTS LABEL
============================================================ */

.selected-elements-label {
    color: #718096;

    font-size: 12px;
    font-weight: 600;
}


/* ============================================================
   SELECTED ELEMENTS
============================================================ */

.selected-elements {
    display: flex;

    flex-wrap: wrap;

    gap: 5px;

    flex: 1;
}


/* ============================================================
   SELECTED ELEMENT TAG
============================================================ */

.selected-element-tag {
    display: inline-flex;

    align-items: center;

    padding: 4px 9px;

    border-radius: 12px;

    background: #dcecff;

    color: #185abc;

    font-size: 11px;
    font-weight: 600;
}


/* ============================================================
   NO SELECTED ELEMENTS
============================================================ */

.no-selected-elements {
    color: #a0acb8;

    font-size: 11px;
}


/* ============================================================
   CLEAR BUTTON
============================================================ */

.clear-element-button {
    border: 1px solid #d5dfe9;

    border-radius: 5px;

    padding: 5px 9px;

    margin: 0;

    background: #ffffff;

    color: #718096;

    font-size: 11px;

    cursor: pointer;
}


.clear-element-button:hover {
    background: #eef5ff;

    color: #2878e5;

    box-shadow: none;
}


/* ============================================================
   PERIODIC TABLE BACKGROUND
============================================================ */

.periodic-main-background {
    padding: 12px;

    background: #f5f9fd;

    border: 1px solid #dfe8f1;

    border-radius: 12px;
}


/* ============================================================
   PERIODIC TABLE
============================================================ */

.periodic-table {
    display: grid;

    grid-template-columns:
        repeat(18, 30px);

    grid-auto-rows: 30px;

    column-gap: 2px;
    row-gap: 2px;

    width: fit-content;

    margin-top: 0;
}


/* ============================================================
   RESPONSIVE
============================================================ */

@media (max-width: 800px) {

    .periodic-table-wrapper {
        width: 100%;

        align-items: flex-start;

        overflow-x: auto;
    }

    .periodic-table {
        grid-template-columns:
            repeat(18, 30px);
    }
}