/* Global styles for the body and main content container */

/** This CSS property changes the box model so that the width and height properties include the padding and border. The content box then shrinks to accommodate them. */
* {
    box-sizing: border-box;
}

body {
    font-family: "Open Sans", Arial, sans-serif;
    background-color: #f0f4f8;
    color: #333;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

.content-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem;
    margin:0;
    min-height: calc(100vh - 80px); /* Adjust based on footer height */
    box-sizing: border-box;
}

/* Card component for wrapping content */
.main-content {
    background-color: #ffffff;
    padding: 3rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 1050px;
}

/* Text alignment and typography */
.text-center {
    text-align: center;
}

h1 {
    font-size: 2rem;
    color: #1b004f;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1rem;
    color: #6b7280;
    margin-bottom: 1.5rem;
}

/* Form layout and elements */
.form-grid {
    display: grid;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}
.form-group-inline {
    display: flex;
    gap: 1.5rem;
}

.form-group label {
    font-weight: bold;
    margin-bottom: 0.5rem;
}

input[type="number"],
input[type="text"],
select {
    padding: 0.4rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 1rem;
    width: 100%;
    box-sizing: border-box;
}

.checkbox-group label {
    font-weight: normal;
}

.flex-item {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.btn {
    background-color: #2ea3f2;
    color: #ffffff;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
    width: auto;
    min-width: 120px;
    display: block;
    margin: 0 auto 0; /* Centers the button horizontally and adds top margin */
}

.btn:hover {
    background-color: #1c316a;
}


/* Container for the copy buttons */
.copy-buttons-container {
    display: flex; /* Aligns buttons in a row */
    gap: 0.5rem; /* Adds space between the buttons */
    position: absolute; /* Positions the container relative to its parent (.result-box) */
    top: 0.75rem; /* Adjusts the vertical position from the top of the .result-box */
    right: 0.75rem; /* Adjusts the horizontal position from the right of the .result-box */
    z-index: 10; /* Ensures buttons appear on top of other elements */
}


/* Ensure buttons are properly styled */
.copy-btn {
    border: 1px solid #ccc;
    background-color: #f7f7f7;
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    color: #555;
    transition: background-color 0.2s;
}

.copy-btn:hover {
    background-color: #e0e0e0;
}


/* Alert messages for errors */
.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    padding: 0.75rem;
    border-radius: 4px;
    border: 1px solid #fca5a5;
    margin-bottom: 1.5rem;
}

/* Results section styling */
.result-box {
    position: relative; /* CRUCIAL: Establishes a positioning context for child elements */
    font-size: 1rem;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 2rem; /* Keep consistent padding on all sides to avoid text overflow */
    margin-top: 2rem;
    line-height: 1.6rem;
}

/* Styles for the preformatted text to remove unwanted styling and add readability */
.result-box pre {
    margin: 0;
    padding: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: inherit;
}

.result-box h2 {
    font-size: 1.25rem;
    color: #1f2937;
    margin-top: 0;
    margin-bottom: 2rem;
}

/* Styles specific to the random name generator */
.male {
    color: #00009b; /* Blue for male names */
}

.female {
    color: #a80000; /* Red for female names */
}

.result-box .name-row {
    margin-bottom: 0rem;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header {
    background: #ffffff;
    border-bottom: 0px solid #ccc;
    color: #000;
    padding: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.header .container {
    max-width: 1050px;
    margin: 0 auto;
    padding: 1rem 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
}

.logo {
    display: flex;
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 1px;
    color: #374151;
    margin-right: 2rem;
}

.logo {
    height: 40px;
    width: 200px; /* You'll need to set a width for the div */
    margin-right: 12px;
}

.main-nav {
    display: flex;
    gap: 0.5rem;
}

.nav-link {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.2rem 0.4rem;
    border-radius: 6px;
    transition: background 0.5s, color 0.2s;
}

.nav-link:hover {
    background: #ddd;
    color: #000000;
}

.nav-link.active {
    color: #2ea3f2;
}

@media (max-width: 700px) {
    .header .container {
        flex-direction: row;
        align-items: center;
    }
    .main-nav {
        flex-direction: column;
        gap: 1rem;
        position: absolute;
        top: 60px;
        left: 0;
        background: #f3f4f6;
        width: 100%;
        padding: 1rem 0;
        box-shadow: 0 2px 8px rgba(0,0,0,0.05);
        z-index: 10;
    }
    .hamburger {
        display: block !important;
    }
}

/*-- Homepage styles --> */

.homepage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.homepage-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(37,99,235,0.07);
    padding: 2rem 1.5rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: box-shadow 0.2s;
}

.homepage-card:hover {
    box-shadow: 0 4px 20px rgba(37,99,235,0.3);
}

.homepage-icon {
    margin-bottom: 1rem;
}

.homepage-title {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: #374151;
    text-align: center;
    text-decoration: none;
}

.homepage-title a {
text-decoration: none;
color: #2563eb;
}

.homepage-desc {
    font-size: 1rem;
    color: #6b7280;
    margin-bottom: 1.2rem;
    text-align: center;
}

.homepage-link {
    background: #2563eb;
    color: #fff;
    padding: 0.5rem 1.2rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s;
}

.homepage-link:hover {
    background: #1e40af;
}

/* Footer styles */
footer {
    background-color: #fff;
    color: #000;
    text-align: center;
    padding: 1rem;
    position: relative;
    bottom: 0;
    width: 100%;
}

footer .container {
    max-width: 900px;
    margin: 0 auto;
    padding: 1rem 0;
    align-items: center;
}

/* Additional media query for mobile responsiveness of the form */
@media (max-width: 700px) {
    .flex-row-group {
        flex-direction: column;
        gap: 1rem;
    }
    .form-group-inline {
        flex-direction: column;
    }
    .main-content {
      padding: 1.5rem;
    }
}