/* Global Styles */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --background-color: #ffffff;
    --text-color: #1f2937;
    --light-gray: #f3f4f6;
    --border-color: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

ul {
    list-style: none;
}

/* Header */
header {
    background-color: #fff;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo i {
    font-size: 1.8rem;
}

nav ul {
    display: flex;
    gap: 2rem;
}

nav a:hover {
    color: var(--primary-color);
}

/* Main Content */
main {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

/* Hero Section / Tool */
.hero {
    text-align: center;
    margin-bottom: 4rem;
    padding: 3rem 1rem;
    background: linear-gradient(to bottom, #ffffff, #f9fafb);
    border-radius: 1rem;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #111827;
}

.hero p {
    color: #6b7280;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.tool-container {
    max-width: 700px;
    margin: 0 auto;
    background: #fff;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

textarea {
    width: 100%;
    height: 150px;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1.1rem;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 1.5rem;
    transition: border-color 0.2s;
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn {
    background-color: var(--primary-color);
    color: white;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.btn:hover {
    background-color: var(--primary-hover);
}

.btn:active {
    transform: translateY(1px);
}

.result-box {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: #f0f9ff;
    border-radius: 0.5rem;
    border: 1px solid #bae6fd;
    display: none;
    /* Hidden by default */
}

.result-box.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

.result-count {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary-color);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.result-label {
    color: #0c4a6e;
    font-weight: 500;
}

/* Content Section */
.content-section {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
    color: #374151;
}

.content-section h2 {
    font-size: 1.8rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: #111827;
}

.content-section h3 {
    font-size: 1.4rem;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: #1f2937;
}

.content-section p {
    margin-bottom: 1.5rem;
}

/* Word Lists Grid */
.word-lists-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 3rem 0;
}

.word-list-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.word-list-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: var(--primary-color);
}

.word-list-card h3 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

/* Search Bar for Word Lists */
.search-container {
    max-width: 600px;
    margin: 0 auto 2rem;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid var(--border-color);
    border-radius: 2rem;
    font-size: 1.1rem;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}

/* Word List Display */
.word-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.word-item,
.word-grid>div {
    background: #fff;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    text-align: center;
    font-weight: 500;
}

/* Footer */
footer {
    background-color: #f9fafb;
    border-top: 1px solid var(--border-color);
    padding: 3rem 2rem;
    margin-top: auto;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 2rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: #4b5563;
    font-size: 0.95rem;
}

.footer-links a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.copyright {
    color: #9ca3af;
    font-size: 0.9rem;
    margin-top: 2rem;
    text-align: center;
    width: 100%;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }

    .tool-container {
        padding: 1.5rem;
    }

    nav ul {
        gap: 1rem;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        justify-content: center;
    }
}