body {
    font-family: Arial, sans-serif;
    text-align: center;
    background: url(../data/titlebackground.png) no-repeat center center fixed;
    background-size: cover;
    padding: 20px;
}

.header {
    color: #f8f7f7;
    text-align: center;
    font-size: 34px;
    display: block;
    padding: 10px;
    text-align: center;
    background-color: rgba(27, 26, 27, 0.9);
    border-radius: 15px;
    margin-left: auto;
    margin-right: auto;
    width: auto;
}

#periodic-table {
    position: relative;
    display: grid;
   
    gap: 8px;
    background: rgba(27, 26, 27, 0.9);
    padding: 20px;
  
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(49, 46, 46, 0.1);
    overflow-x: auto;
    max-width: 100%;
    height: auto;
    text-emphasis: none;
    align-items: start;
}

#periodic-table > h1.header {
    grid-column: 1 / -1;
    justify-self: center;
    align-self: start;
    width: auto;
    margin-bottom: 15px;
}

#periodic-table > .header {
    grid-column: 1 / -1;
    justify-self: center;
    width: auto;
    margin-bottom: 15px;
}

#legend {
    position: absolute;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    gap: 20px;
    z-index: 10;
    background: rgba(44, 43, 43, 0.9);
    padding: 8px 15px;
    border-radius: 8px;
    border: 1px solid #ddd;
    padding: 7px;
}

.element {
    width: 60px;
    height: 60px;
    margin-top: 30px;
    border: 2px solid #ddd;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 12px;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.element:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.element .symbol {
    font-size: 20px;
    margin-bottom: 2px;
}

.element .number {
    font-size: 11px;
    opacity: 0.8;
}

/* State of Matter Colors */
.solid {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.solid:hover {
    background: linear-gradient(135deg, #5dade2, #2980b9);
}

.gas {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.gas:hover {
    background: linear-gradient(135deg, #ec7063, #c0392b);
}

.liquid {
    background: linear-gradient(135deg, #f39c12, #d68910);
}

.liquid:hover {
    background: linear-gradient(135deg, #f5b041, #d68910);
}

#tooltip {
    position:absolute;
    color: #ffffff;
    background: rgb(49, 47, 47);
    border: 1px solid #ffffff;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    display: none;
    z-index: 1;
    pointer-events: none;
    font-size: 12px;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    text-align:justify;
}

.tooltip-name {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 5px;
}

.tooltip-section {
    margin: 5px 0;
}

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

/* Large screens */
@media (min-width: 992px) {
    #periodic-table {
        grid-template-columns: repeat(18, 60px);
        grid-template-rows: repeat(9, 60px);
    }
}

/* Medium screens (tablets) */
@media (max-width: 991px) and (min-width: 768px) {
    #periodic-table {
        grid-template-columns: repeat(18, 50px);
        grid-template-rows: repeat(9, 50px);
        gap: 6px;
        padding: 15px;
    }
    
    .element {
        width: 50px;
        height: 50px;
        font-size: 11px;
    }
    
    .element .symbol {
        font-size: 14px;
    }
    
    .element .number {
        font-size: 8px;
    }
    
    #legend {
        gap: 15px;
    }
    
    .legend-item {
        font-size: 11px;
        padding: 5px 8px;
    }
}

/* Small screens (phones) */
@media (max-width: 767px) {
    body {
        padding: 10px;
    }
    
    h1 {
        font-size: 24px;
        margin-top: 20px;
        margin-bottom: 20px;
    }

    
    #periodic-table {
        grid-template-columns: repeat(10, 40px);
        grid-template-rows: repeat(9, 40px);
        gap: 5px;
        padding: 10px;
    }
    
    .element {
        width: 40px;
        height: 40px;
        font-size: 9px;
        border: 1px solid #ddd;
    }
    
    .element .symbol {
        font-size: 11px;
        margin-bottom: 1px;
    }
    
    .element .number {
        font-size: 7px;
    }
    
    
    .legend-item {
        font-size: 15px;
        padding: 6px 10px;
        justify-content: center;
    }
    
    #tooltip {
        font-size: 11px;
        padding: 6px 6px;
    }
    
    .tooltip-name {
        font-size: 14px;
    }

    .btn-group {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
    }

    .btn-group .btn {
        flex: 1 1 auto;
        min-width: 80px;
        font-size: 12px;
    }
}

.solid{
    padding: 5px;
    border-radius: 5px;
    font-size: 15px;
}
.gas{
    padding: 5px;
    border-radius: 5px;
    font-size: 15px;
}
.liquid{
    padding: 5px;
    border-radius: 5px;
    font-size: 15px;
}

.desciption{
    background: rgba(27, 26, 27, 0.9);
    padding: 20px;
    border-radius: 5px;
   
    margin-top: 30px;
    color: #f8f7f7;
    text-align: justify;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
.btn-group{
    text-align: center;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
}
.element-btn{
    border: 1px solid #ffffff;
    background-color: rgba(18, 96, 212, 0.9);
    color: #f8f7f7;

}

 #map {
            height: 500px;
            border: 1px solid #ffffff;
            margin-top: 20px;
            border-radius: 5px;
            box-shadow: 0 0 15px rgba(0,0,0,0.8);
            background-color: rgba(27, 26, 27, 0.9);

        }
        .legend {
            line-height: 18px;
            color: #555;
            background: white;
            padding: 6px 8px;
            border-radius: 5px;
            box-shadow: 0 0 15px rgba(0,0,0,0.2);
        }
        .legend i {
            width: 18px;
            height: 18px;
            float: left;
            margin-right: 8px;
            border-radius: 3px;
        }
        .info {
            padding: 6px;
            background: rgb(0, 0, 0);
            box-shadow: 0 0 15px rgba(0,0,0,0.2);
            border-radius: 7px;
            line-height: 17px;
            color: #ffffff;
            opacity: 0.8;
            border: 1px solid #ffffff;
        }
        .info h5 {
            margin: 5px;
            color: #ffffff;
        }

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 500;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    background-color: transparent;
}

.modal-content {
    background-color: #080808;
    position: fixed;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 10px;
    border: 1px solid rgb(255, 255, 255);
    width: 280px;
    max-height: 80vh;
    overflow-y: auto;
    border-radius: 8px;
    color: #f4f4f4;
    text-align: justify;
    box-shadow: 0 8px 12px rgba(0,0,0,0.8);
    position: relative;
}

.close {
    color: #f8f7f7;
    position: absolute;
    top: 5px;
    right: 10px;
    font-size: 30px;
    cursor: pointer;
    margin-top: 0;
}

.close:hover,
.close:focus {
    color: #ffffff;
    text-decoration: none;
}

#modal-body {
    font-family: Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

#modal-body .tooltip-name {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #f8f7f7;
}

#modal-body .tooltip-section {
    margin: 8px 0;
}


.leaflet-pane  {
    background-color: #050505;
   
}

.leaflet-control {
    background-color: rgba(27, 26, 27, 0.9);
    border: 1px solid #ffffff;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
    color: #ffffff;
}



.sources{
    margin-left: 25px;
}
.datatale{
    text-align: center;
    margin-top: 10px;
    border: 1px solid #ffffff;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0,0,0,0.9);
    width: 100%;
}