/* Header Styles */
.header {
    width: 100%;
    max-width: 100%; /* Ensure full width on mobile */
    display: flex;
    flex-wrap: nowrap; /* Prevent wrapping for uniform scaling */
    align-items: center;
    justify-content: space-between; /* Distribute space evenly */
    padding: 0px; /* Reduced padding for better mobile fit */
    box-sizing: border-box; /* Include padding and border in element's total width and height */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.header img {
    height: 25px; /* Reduced size for better mobile fit */
    flex: 0 0 auto; /* Prevent image from stretching */
}

.header h1 {
    font-size: 1.5em; /* Responsive font size */
    margin: 5px;
    color: #000000;
    transition: color 0.5s ease;
    flex: 1 1 auto; /* Allow title to grow and shrink */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.dark-mode .header h1 {
    color: #ffffff; /* Softer white for less strain */
}

/* Header Button Styles */
.header .button {
    padding: 0px; /* Adjusted padding for mobile */
    font-size: 0.9em; /* Responsive font size */
    font-weight: bold; /* Make the button text bold */
    border: none;
    background-color: #000000;
    color: rgb(255, 255, 255);
    cursor: pointer;
    border-radius: 25px;
    margin-left: 0px; /* Adjusted margin for mobile */
    text-decoration: none; /* Ensure no underline if it's a link */
    transition: background-color 0.5s ease, color 0.5s ease;
    flex: 0 0 auto; /* Prevent button from stretching */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.dark-mode .header .button {
    background-color: #20242c; /* Darker background for better contrast */
}

.header .button:hover {
    background-color: #2c2c2c;
    text-decoration: none; /* Ensure no underline on hover if it's a link */
}

body.dark-mode .header .button:hover {
    background-color: #383e49;
}

@media screen and (max-width: 768px) {
    .header {
        flex-direction: row; /* Keep items in a row for uniform scaling */
        align-items: center; /* Center align items */
        justify-content: space-between; /* Distribute space evenly */
    }
    .header h1 {
        font-size: 1.5em; /* Further reduce font size for smaller screens */
    }
    .header .button {
        margin-left: 0; /* Remove left margin for better alignment */
        margin-top: 0; /* Remove top margin for uniform scaling */
    }
    #theme-toggle {
        margin-top: 0; /* Ensure inline with header item */
        margin-left: 10px; /* Add left margin for spacing */
    }
    .header img {
        margin-top: 0px; /* Add top margin for spacing */
    }
}

/* Header Item Styles */
.header-item {
    flex: 1 1 100%; /* Ensure items take full width on mobile */
    background-color: #f0f4f9; /* Make background transparent */
    border-radius: 15px;
    padding: 0px;
    transition: background-color 0.5s ease, box-shadow 0.5s ease, opacity 0.5s ease;
    opacity: 0;
    animation: fadeIn 0.5s forwards;
    margin-bottom: 5px; /* Add margin for spacing between items */
    box-sizing: border-box; /* Include padding and border in element's total width and height */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.header-item .label {
    font-weight: bold;
    color: #000;
    display: block;
    margin-bottom: 5px;
    transition: color 0.5s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.header-item .value {
    font-size: 2em; /* Responsive font size */
    font-weight: bold;
    color: #000000;
    transition: color 0.5s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* Dark mode variations */
body.dark-mode .header-item {
    background-color: #202020; /* Make background transparent */
    border: 0px solid #555;
}

body.dark-mode .header-item .label {
    color: #ffffff;
}

body.dark-mode .header-item .value {
    color: #ffffff;
}
