body {
    font-family: Arial, sans-serif;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

/* Container styles: light, semi-transparent grey background with visible borders and rounded corners */
.container {
    background-color: rgba(220,220,220,0.6); /* light blurry grey background */
    border: 2px solid #aaa; /* visible border */
    border-radius: 10px; /* slightly round edges */
    padding: 20px;
    margin: 20px;
}

/* Section styles: slightly green background with thin borders and rounded corners */
.section {
    background-color: #d0e8d0; /* slightly green background */
    border: 1px solid #8bc34a; /* thin border */
    border-radius: 8px; /* round edges */
    padding: 15px;
    margin: 10px 0;
}

h1 {
    color:green;
    margin-left: 15px;
}

h3 {
    padding-bottom: 6px;
}

.container.container2 h3 {
    color: green;
}

label {
    display: block;
    margin-top: 10px;
    font-weight: bold;
}

input[type="text"],
input[type="number"] {
    margin-top: 5px;
    padding: 8px;
    width: 100%;
    font-size: 14px;
    max-width: 220px;
    box-sizing: border-box;
}

button {
    padding: 12px;
    background-color: #4CAF50;
    font-size: 14px;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

button:hover {
    background-color: #45a049;
}

/* Highlight the default "Generér CPR" button on page load */
#generateBtn {
    border: 2px solid #2e7d32;
}

.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-top: 30px;
}

.button-group button {
    max-width: 150px;
    flex-grow: 1; /* Buttons take equal space when stacked */
}

.button-group.align-left {
    justify-content: flex-start;
}

.button-group.center-align {
    justify-content: center;
}

/* Override h1 margin in container2 so title aligns with content text */
.container.container2 h1 {
    margin-left: 0;
}

/* Ensure a 5px gap between input fields */
.input-group {
    display: flex;
    gap: 30px;
}
/* Set input field width to a fixed pixel value */
.input-group input {
    width: 150px;
}

/* Flex wrapper for layout on screens wider than 1440px */
.flex-wrapper {
    display: block;
}

/* Left column wrapper for container1 and the new Resultat container */
.left-column {
    display: flex;
    flex-direction: column;
    gap: 0;
}

table {
    width: 100%;
    margin-top: 20px;
    border-collapse: collapse;
}

th, td {
    border: 1px solid black;
    padding: 10px;
    text-align: center;
}

th {
    background-color: #f2f2f2;
}

#languageToggle {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 10px;
    border: 1px solid #ccc;
    background-color: #f0f0f0;
    cursor: pointer;
}

.checkbox-container {
    display: flex;
    align-items: center;
    padding-top: 20px;
    margin-left: 8px;
}

#non-modulus {
    margin: 0;
}

#non-modulus-label {
    font-size: 14px;
    margin-left: 12px;
    padding-bottom: 9px;
    font-style: italic;
    font-weight: 300;
}

@media screen and (min-width: 1441px) {
    .flex-wrapper {
        display: flex;
        align-items: flex-start; /* Ensures equal top alignment */
    }
    .left-column {
        width: 60%;
    }
    .container.container2 {
        width: 25%;
    }
}

/*@media screen and (max-width: 1440px) {
    .left-column, .container.container2 {
        width: 100%;
    }
}*/

/* Make horizontal rule in section header extend fully, touching the section borders */
.section-header hr {
    margin: 10px -15px;           /* Remove side margins corresponding to section padding */
    width: calc(100% + 30px);        /* Extend hr width to include section's horizontal padding */
    border: none;
    border-top: 1px solid #388E3C;   /* Use the same color as the h3 background */
}

/* Add extra padding on top of the section content */
.section-content {
    padding-top: 10px;
}

/* Responsive adjustments for smaller screens */
@media screen and (max-width: 667px) {
    h1 {
        font-size: 20px;
        margin-left: 10px;
    }
    h3 {
        font-size: 16px;
    }
    input[type="text"], input[type="number"] {
        font-size: 12px;
        padding: 6px;
        max-width: 100%;
    }
    .input-group {
        display: block;
    }
    button {
        font-size: 12px;
        padding: 8px;
    }
    .checkbox-container {
        margin: 0 0 10px 20px;
    }
    .button-group {
        display: flex;
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
        margin-left: 20px;
    }
    table, th, td {
        font-size: 12px;
        padding: 5px;
    }
    table {
        width: calc(100% - 20px);
        margin: 20px 10px 20px 10px;
    }
    /* Make containers full width and remove rounded edges on mobile */
    .container {
        width: 100%;
        border-radius: 0;
        margin: 20px auto;
        padding: 0;
    }
    .container.container2 {
        padding: 10px;
        margin: 0;
        width: calc(100% - 20px);
    }
    .section {
        margin: 0 10px;
    }
    .section.section2 {
        margin-top: 20px;
    }
    .left-column {
        width: 100%;
        margin: 0;
        padding: 0;
    }
}

/* Copy icon: hidden by default */
.copy-icon {
    display: none;
}

/* On large screens, show the copy icon with a pointer cursor */
@media screen and (min-width: 1441px) {
    .copy-icon {
        display: inline-block;
        cursor: pointer;
        margin-left: 5px;
        font-size: 16px;
    }
}

/* Popup message styling */
.popup-message {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translate(-50%, -10px);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 15px 25px;
    border-radius: 5px;
    z-index: 1000;
    display: none;
    animation: fadeInOut 3s ease-in-out;
}

@keyframes fadeInOut {
    0% { opacity: 0; }
    15% { opacity: 1; }
    85% { opacity: 1; }
    100% { opacity: 0; }
}
