/* ===== Global Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8fafc;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ===== Layout ===== */
header {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo a {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2563eb;
    text-decoration: none;
    letter-spacing: -0.5px;
}

nav a {
    margin-left: 1.5rem;
    text-decoration: none;
    color: #4b5563;
    font-weight: 500;
    transition: color 0.2s;
}

nav a:hover {
    color: #2563eb;
}

main {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 2rem auto;
    padding: 0 2rem;
}

footer {
    background-color: #fff;
    border-top: 1px solid #e5e7eb;
    padding: 1.5rem 2rem;
    text-align: center;
    color: #6b7280;
    font-size: 0.9rem;
    margin-top: 2rem;
}

/* ===== Typography ===== */
h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.subtitle {
    font-size: 1.2rem;
    color: #64748b;
    margin-bottom: 2rem;
}

h2 {
    font-size: 1.8rem;
    font-weight: 600;
    color: #1e293b;
    margin: 2rem 0 1rem;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.5rem;
}

h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #1e293b;
    margin: 1.5rem 0 0.5rem;
}

/* ===== Tool Container ===== */
.tool-container {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    padding: 2rem;
    margin: 2rem 0;
    border: 1px solid #e5e7eb;
}

/* Form elements inside tool */
.tool-container label {
    display: block;
    margin-bottom: 1rem;
    font-weight: 500;
    color: #1e293b;
}

.tool-container input,
.tool-container textarea,
.tool-container select {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    margin-top: 0.25rem;
    transition: border 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.tool-container input:focus,
.tool-container textarea:focus,
.tool-container select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.tool-container button {
    background-color: #2563eb;
    color: #fff;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    border: 1px solid transparent;
}

.tool-container button:hover {
    background-color: #1d4ed8;
}

.tool-container button:active {
    transform: translateY(1px);
}

.tool-container button.secondary {
    background-color: #6b7280;
}

.tool-container button.secondary:hover {
    background-color: #4b5563;
}

.output {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background-color: #f1f5f9;
    border-radius: 12px;
    border-left: 4px solid #2563eb;
    word-wrap: break-word;
}

.output p {
    margin: 0.5rem 0;
}

/* ===== Description & FAQ Sections ===== */
.description {
    background: #fff;
    border-radius: 16px;
    padding: 2rem;
    margin: 2rem 0;
    border: 1px solid #e5e7eb;
}

.description p {
    margin: 1rem 0;
    color: #334155;
}

.faq {
    background: #fff;
    border-radius: 16px;
    padding: 2rem;
    margin: 2rem 0;
    border: 1px solid #e5e7eb;
}

.faq-item {
    border-bottom: 1px solid #e5e7eb;
    padding: 1.5rem 0;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-item h3 {
    color: #2563eb;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-item h3::after {
    content: '+';
    font-size: 1.5rem;
    color: #2563eb;
    transition: transform 0.2s;
}

.faq-item[open] h3::after {
    transform: rotate(45deg);
}

.faq-item div[itemprop="text"] {
    color: #475569;
    margin-top: 0.5rem;
    padding-left: 1rem;
}

/* For browsers that support <details> */
.faq-item {
    list-style: none;
}
.faq-item::-webkit-details-marker {
    display: none;
}

/* Fallback for no JS – we keep answers visible */
.faq-item div[itemprop="text"] {
    display: block;
}

/* ===== Related Tools ===== */
.related-tools {
    background: #fff;
    border-radius: 16px;
    padding: 2rem;
    margin: 2rem 0;
    border: 1px solid #e5e7eb;
}

.related-tools ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.related-tools li {
    margin: 0;
}

.related-tools a {
    display: inline-block;
    background-color: #f1f5f9;
    color: #2563eb;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 30px;
    font-size: 0.9rem;
    transition: background-color 0.2s, color 0.2s;
    border: 1px solid #e5e7eb;
}

.related-tools a:hover {
    background-color: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

/* ===== Homepage Tool Grid ===== */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.tool-card {
    background: #fff;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    border: 1px solid #e5e7eb;
    transition: transform 0.2s, box-shadow 0.2s;
}

.tool-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

.tool-card h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1.3rem;
}

.tool-card a {
    text-decoration: none;
    color: #2563eb;
}

.tool-card p {
    color: #64748b;
    font-size: 0.95rem;
    margin: 0;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
    }
    nav {
        margin-top: 1rem;
    }
    nav a {
        margin: 0 0.75rem;
    }
    h1 {
        font-size: 2rem;
    }
    main {
        padding: 0 1rem;
    }
    .tool-container,
    .description,
    .faq,
    .related-tools {
        padding: 1.5rem;
    }
}

/* ===== Accessibility ===== */
:focus-visible {
    outline: 3px solid #2563eb;
    outline-offset: 2px;
}

/* ===== Utility Classes ===== */
.text-center {
    text-align: center;
}
.mt-2 {
    margin-top: 2rem;
}
/* Existing styles ... */

.faq {
    margin: 40px 0;
}
.faq-item {
    border-bottom: 1px solid #eee;
    padding: 15px 0;
}
.faq-item h3 {
    margin-bottom: 5px;
    color: #007bff;
}
.faq-item div[itemprop="text"] {
    color: #555;
}