/* --- Global Styles & Font --- */
body {
    font-family: 'Poppins', sans-serif;
    background-color: #f4f7f9;
    color: #333;
    margin: 0;
    padding: 20px;
    padding-top: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    box-sizing: border-box;
}

main {
    flex-grow: 1;
    width: 100%;
    max-width: 900px;
}

/* --- SIMPLIFIED FIXED HEADER BAR --- */
header {
    width: 100%;
    background-color: #212529;
    color: white;
    padding: 0 20px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

header h1 {
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
}

/* --- IMAGE FIX --- */
.header-icon {
    height: 35px;
    margin-right: 15px;
    image-rendering: -webkit-optimize-contrast; /* For Chrome/Safari */
    image-rendering: crisp-edges; /* Standard */
    image-rendering: pixelated; /* A common, modern option */
}

/* --- Hero Section --- */
.hero {
    text-align: center;
    padding: 20px;
    margin-bottom: 30px;
}
.hero h2 {
    font-size: 1.6rem;
    margin-bottom: 10px;
    color: #222;
}

/* --- Redesigned Tool Cards --- */
.tools-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.tool-card {
    background-color: #ffffff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    border: 1px solid #e9ecef;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out, border-color 0.2s ease-in-out;
}

.tool-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border-color: #007bff;
}

.tool-card i { font-size: 2.5rem; color: #007bff; margin-bottom: 15px; }
.tool-card h3 { color: #343a40; margin-bottom: 10px; font-size: 1.25rem; font-weight: 600; }
.tool-card p { font-size: 0.9rem; color: #6c757d; line-height: 1.5; }

/* --- Styles for a Single Tool View --- */
.hidden { display: none; }
#back-to-tools-btn { margin-bottom: 20px; background-color: #6c757d; padding: 10px 15px; border: none; color: white; border-radius: 4px; cursor: pointer; font-size: 0.9rem; font-weight: bold; }
#back-to-tools-btn:hover { background-color: #5a6268; }
.tool-content { background-color: white; padding: 25px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.tool-content h2 { margin-top: 0; color: #0056b3; }
textarea { width: 100%; min-height: 150px; padding: 10px; border: 1px solid #ccc; border-radius: 4px; font-size: 1rem; box-sizing: border-box; margin-bottom: 15px; }
.button-group { display: flex; gap: 10px; }
button { padding: 10px 15px; border: none; background-color: #007bff; color: white; border-radius: 4px; cursor: pointer; font-size: 0.9rem; font-weight: bold; }
button:hover { background-color: #0056b3; }
.stats-container { display: flex; justify-content: space-around; padding: 10px; margin-bottom: 15px; background-color: #e9ecef; border-radius: 4px; font-size: 0.9rem; font-weight: bold; }

/* --- FOOTER FIXES --- */
footer {
    width: 100%;
    max-width: 900px;
    margin-top: 50px;
    padding: 20px;
    text-align: center;
    color: #6c757d;
    border-top: 1px solid #e9ecef;
}

.footer-links {
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    gap: 15px; /* Reduced gap */
    white-space: nowrap; /* Prevents links from wrapping to the next line */
    overflow-x: auto; /* Adds scrolling if it overflows on tiny screens */
}

.footer-links a {
    color: #007bff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem; /* Reduced font size */
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #0056b3;
    text-decoration: underline;
}

.footer-copyright {
    font-size: 0.9rem;
                               }

/* --- PASSWORD GENERATOR STYLES --- */
.password-output-container {
    display: flex;
    margin-bottom: 20px;
}

#password-output {
    flex-grow: 1;
    padding: 12px;
    font-size: 1.2rem;
    font-family: 'Courier New', Courier, monospace;
    border: 1px solid #ccc;
    border-right: none;
    border-radius: 4px 0 0 4px;
    background-color: #e9ecef;
}

#copy-btn {
    padding: 0 15px;
    border: 1px solid #ccc;
    border-radius: 0 4px 4px 0;
    font-size: 1.2rem;
    cursor: pointer;
}

.options-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 25px;
}

/* On wider screens, show options in two columns */
@media (min-width: 600px) {
    .options-container {
        grid-template-columns: 1fr 1fr;
    }
}

.option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
}

.option label {
    font-weight: 600;
}

.option input[type="range"] {
    width: 120px;
}
.option input[type="checkbox"] {
    width: 20px;
    height: 20px;
}

.generate-button {
    width: 100%;
    padding: 15px;
    font-size: 1.2rem;
    font-weight: bold;
    background: linear-gradient(45deg, #28a745, #218838);
}
.generate-button:hover {
    background: linear-gradient(45deg, #218838, #1e7e34);
                  }
