/* ===== VARIABLES ===== */
:root {
    --bg: #f0f4ff;
    --white: #ffffff;
    --text: #333333;
    --muted: #888888;
    --accent: #4a90e2;
    --border: #e0e0e0;
    --radius: 8px;
}

/* ===== BASE ===== */
* {
    box-sizing: border-box;
    margin:0;
    padding:0
}

/* ===== BODY ===== */
body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Segoe UI' , sans-serif;
    font-size: 16px;
    line-height: 1.6;
}

/* ===== HEADER ===== */
header {
    background: linear-gradient(135deg, #4a90e2, #357abd);
    background-color: var(--accent);
    border-bottom: 1px solid var(--border);
    padding: 2rem;
    text-align: center;
}

header h1{
    font-family: Georgia, serif;
    font-size: 2.5rem;
    color: var(--white);
    margin-bottom: 0.3rem;
}

header p{
    font-family: Georgia, serif;
    font-style: italic;
    font-size: 1rem;
    color: var(--white);
}

/* ===== MAIN ===== */
main {
    max-width: 600px;
    margin: 2rem auto;
    padding: 0 1rem;
}

main p {
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 0.5rem;
}

/* ===== FORM ===== */
form {
    display: flex;
    gap:0.5rem;
    margin-bottom: 1.5rem;
}

input{
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color 0.2s;
    outline: none;
}

input:focus {
    border-color: var(--accent);
}

button {
    padding: 0.75rem 1.5rem;
    background-color: var(--accent);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    cursor:pointer;
}

button:hover {
    background-color: #357abd;
}

/* ===== ERROR MESSAGE ===== */
#error-message {
    color: #e74c3c;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

#error-message a {
    color: var(--accent);
    text-decoration: underline;
}

/* ===== RESULTS ===== */
#results {
    display: none;
    background-color: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}


/* ===== WORD-TITLE ===== */
#word-title {
    font-family: Georgia, serif;
    font-size: 2rem;
    color: var(--text);
    text-transform: capitalize;
    margin-bottom: 0.3rem;
}

/* ===== PRONUNCIATION ===== */
#pronunciation {
    font-size: 1rem;
    color: var(--muted);
    margin-bottom: 0.5rem;
}

/* ===== AUDIO ===== */
#pronunciation-audio {
    display: none;
    margin-bottom: 1rem;
    width: 100%;
}

/* ===== MEANINGS ===== */
.meaning-block {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
}

.meaning-block:last-child {
    border-bottom: none;
}
/* ===== PART-OF-SPEECH ===== */
.part-of-speech {
    display: inline-block;
    background-color: var(--accent);
    color: var(--white);
    font-size: 0.85rem;
    padding: 0.2rem 0.8rem;
    border-radius: 999px;
    margin-bottom: 1rem;
    font-style: italic;
}

/* ===== DEFINITION ===== */
.definition {
    font-size: 1.05rem;
    color: var(--text);
    margin-bottom: 0.8rem;
    line-height: 1.7;
}

/* ===== EXAMPLE ===== */
.example {
    font-size: 0.95rem;
    color: var(--muted);
    font-style: italic;
    border-left: 3px solid var(--accent);
    padding-left: 0.75rem;
    margin-bottom: 1rem;
}

/* ===== SYNONYMS ===== */

.synonyms {
    font-size: 0.9rem;
    color: var(--text);
    margin-bottom: 1rem;
}

/* ===== FOOTER ===== */
footer {
    text-align: center;
    padding: 2rem;
    font-size: 0.8rem;
    color: var(--muted);
    border-top: 1px solid var(--border);
    margin-top: 3rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
    header h1 {
        font-size: 1.8rem;
    }

    form {
        flex-direction: column;
    }

    button {
        width: 100%;
    }
}

/* ===== SPINNER ===== */
#spinner {
    text-align: center;
    padding: 2rem;
}

.spinner-circle {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-top: 4px solid var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% {transform:rotate(0deg);}
    100% {transform:rotate(360deg);}
}