:root {

    --cat-alkali-metals: linear-gradient(to bottom, #ff9999 0%, #ffadad 100%);
    --cat-alkaline-earth-metals: linear-gradient(to bottom, #ffc078 0%, #ffd6a5 100%);
    --cat-transition-metals: linear-gradient(to bottom, #fff59d 0%, #fdffb6 100%);
    --cat-post-transition-metals: linear-gradient(to bottom, #a3e635 0%, #caffbf 100%);
    --cat-metalloids: linear-gradient(to bottom, #67e8f9 0%, #9bf6ff 100%);
    --cat-nonmetal: linear-gradient(to bottom, #7faaff 0%, #a0c4ff 100%);
    --cat-noble-gases: linear-gradient(to bottom, #a29bfe 0%, #bdb2ff 100%);
    --cat-lanthanides: linear-gradient(to bottom, #ffa3f0 0%, #ffc6ff 100%);
    --cat-actinides: linear-gradient(to bottom, #f1f2f6 0%, #fffffc 100%);
    --cat-unknown-properties: linear-gradient(to bottom, #ced6e0 0%, #eee 100%);
}

body{
    background-color: aliceblue;
    font-family: sans-serif;

}

.website-container {
    display: flex;
    flex-direction: column;
    /* min-height: 100vh; */

    max-width: 1467px;
    margin: 0 auto;
    padding: 40px 20px;
}

.header {
    color: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding: 0 20px;
}


h1 {
    font-weight: 700;
    font-size: 2.5rem;
    letter-spacing: -0.02em;
}

.search-box {
    position: relative;
    width: 300px;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.5;
    font-size: 0.9rem;
}

#searchInput {
    width: 100%;
    padding: 12px 12px 12px 36px;
    border: none;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.05);
    font-size: 1rem;
    transition: all 0.2s ease;
}


.periodic-table {
    display: grid;
    grid-template-columns: repeat(18, 1fr);
    gap: 7px;
    
    margin-bottom: 40px;
    justify-content: center;
}

.element-card {
    display: flex;
    flex-direction: column;

    background-color: #ffefef;
    border: 1.2px solid #cfcececb;
    border-radius: 4px;
    padding: 3.2px;

    position: relative;
    aspect-ratio: 1;
    transition: 300ms ease;
    cursor: pointer;

}

.element-card:hover {
    transform: scale(1.13);
}

.element-number {
    font-size: 15px;
    opacity: 0.7;
}

.element-symbol {
    text-align: center;
    font-size: 20px;
    font-weight: 700;
}

.element-name {
    font-size: 11px;
    text-align: center;
    opacity: 0.7;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #3333332e;
    
    backdrop-filter: blur(7px);

    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: 300ms ease;
    pointer-events: none;
    z-index: 5;
}

.modal-overlay.opened {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    position: relative;
    background-color: #ffffffde;
    width: 90%;
    max-width: 670px;
    /* max-height: 90vh; */
    padding: 20px;
    border-radius: 12px;
    transform: scale(0.95);
    transition: 300ms ease;

}

.modal-overlay.opened .modal-content {
    transform: scale(1);
}



.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0,0,0,0.05);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;

    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 5;
}

.close-modal:hover {
    background: rgba(0,0,0,0.1);
}

.element-detail-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 10px;
}

.detail-number {
    font-size: 1.2rem;
    color: #1d1d1f;
    opacity: 0.5;
}

.detail-symbol {
    font-size: 4rem;
    font-weight: 700;
    background: linear-gradient(135deg, #1d1d1f, #555);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.detail-name {
    font-size: 2rem;
    margin-bottom: 5px;
}

.detail-category {
    font-size: 1rem;
    color: #0071e3;
    margin-bottom: 30px;
    font-weight: 500;

    letter-spacing: 1px;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.detail-item {
    background: #ffffff80;
    padding: 15px;
    border-radius: 16px;
}

.detail-item.full-width {
    grid-column: span 2;
}

.detail-item .label {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    opacity: 0.5;
    margin-bottom: 5px;
    font-weight: 600;
}

.detail-item .value {
    font-size: 1.1rem;
    font-weight: 500;
}

.detail-item .description {
    font-size: 1rem;
    line-height: 1.6;
    opacity: 0.8;
}

.atom-visualizer {
    width: 100%;
    height: 300px;
    background: #ffffff;
  }
  
footer {
    margin-top: auto;
    text-align: center;
    padding: 20px;
    opacity: 0.7;
}

