/* Navigation - RESPONSIVE */
.navbar {
    background: #333;
    color: white;
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    font-family: 'Arial', serif;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    font-family: inherit;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
    font-family: inherit;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    transition: color 0.3s;
    font-weight: 500;
    padding: 0.5rem 0;
    font-family: inherit;
}

.nav-menu a:hover {
    color: #4CAF50;
}

.logo {
    padding: 5px;
}

.logo-image {
    height: 40px;
    width: auto;
    transition: transform 0.3s;
}

.logo-image:hover {
    transform: scale(1.05);
}

/* Mobile menu styles */
@media (max-width: 768px) {
    .navbar {
        padding: 0.8rem 0;
    }
    
    .nav-container {
        padding: 0 1rem;
        flex-wrap: wrap;
    }
    
    .nav-menu {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-menu a {
        font-size: 0.9rem;
        padding: 0.3rem 0.5rem;
    }
    
    .logo-image {
        height: 35px;
    }
}

@media (max-width: 480px) {
    .navbar {
        padding: 0.6rem 0;
    }
    
    .nav-menu {
        gap: 0.8rem;
    }
    
    .nav-menu a {
        font-size: 0.85rem;
        padding: 0.2rem 0.4rem;
    }
    
    .logo-image {
        height: 30px;
    }
}

/* Body margin to account for fixed navbar */
body {
    margin-top: 100px;
    font-family: Arial, sans-serif;
    background-color: #fafafa;
    color: #111;
    margin: 40px;
    line-height: 1.6;
    padding-top: 100px;
}

/* Your existing fixed button styles */
.element-button {
    position: absolute;
    z-index: 2;
    transition: transform 0.3s ease;
    width: auto;
}

.image-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: transform 0.3s ease;
    width: auto;
}

.image-button img {
    width: 87.2px;
    height: auto;
    transition: transform 0.3s ease;
}

.element-button:hover {
    transform: scale(1.1);
}

.image-button:hover img {
    transform: scale(1.05);
}

/* Special buttons - fixed sizes */
.lanthanide-button .image-button img,
.actinide-button .image-button img {
    width: 1255px;
    height: auto;
}

/* FIXED PIXEL POSITIONS - No percentages */
.group1-button {
    top: 170px;
    left: 60px;
}

.group2-button {
    top: 170px;
    left: 45px;
}

.group3-button {
    top: 170px;
    left: 30px;
}

.group4-button {
    top: 170px;
    left: 15px;
}

.group5-button {
    top: 170px;
    left: 0px;
}

.group6-button {
    top: 170px;
    left: -15px;
}

.group7-button {
    top: 170px;
    left: -30px;
}

.group8-button {
    top: 170px;
    left: -45px;
}

.group9-button {
    top: 170px;
    left: -60px;
}

.group10-button {
    top: 170px;
    left: -75px;
}

.group11-button {
    top: 170px;
    left: -90px;
}

.group12-button {
    top: 170px;
    left: -105px;
}

.group13-button {
    top: 170px;
    left: -120px;
}

.group14-button {
    top: 170px;
    left: -135px;
}

.group15-button {
    top: 170px;
    left: -150px;
}

.group16-button {
    top: 170px;
    left: -165px;
}

.group17-button {
    top: 170px;
    left: -180px;
}

.group18-button {
    top: 170px;
    left: -195px;
}

.lanthanide-button {
    top: 170px;
    left: 430px;
}

.actinide-button {
    top: 170px;
    left: 430px;
}

.footer {
    width: 100%;
    background-color: #333;
    color: white;
    text-align: center;
    padding: 7rem 0;
    margin-top: -60px;
    position: relative;
    top: 80px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

body {
    background-image: url('images/background.jpg');
    background-size: cover; 
    background-position: center; 
    background-repeat: no-repeat; 
    background-attachment: fixed; 
}

h2 {
    color: #1a73e8;
    border-bottom: 2px solid #1a73e8;
    padding-bottom: 5px;
}

.element {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    opacity: 0;
    animation: fadeIn 1s ease-in forwards;
}

.group-info {
    background-color: #e8f4fd;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 25px;
    opacity: 0;
    animation: fadeIn 1s ease-in forwards;
}

.atom-viewer {
    margin-left: 400px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}