@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400..700;1,400..700&family=Playfair+Display:ital,wght@0,400..900;1,400..900&display=swap');

body {
    font-family: 'Lora', serif;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    margin: 0;
    background: linear-gradient(to bottom right, #f5f5dc, #d7ccc8);
    color: #4e342e;
    padding: 20px;
    box-sizing: border-box;
    line-height: 1.6;
}

.container {
    background-color: #fffdd0;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    text-align: center;
    width: 100%;
    max-width: 700px;
    margin-bottom: 30px;
}

header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #efebe9;
}

h1 {
    font-family: 'Playfair Display', serif;
    color: #6d4c41;
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 2.5em;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.05);
    font-weight: normal;
}

.daily-entries {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.daily-entry {
    background-color: #fff8e1;
    border-left: 5px solid #8d6e63;
    padding: 15px;
    border-radius: 8px;
    text-align: left;
    font-style: italic;
    color: #5d4037;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
    flex: 1 1 100%;
}

.daily-entry h2 {
    font-family: 'Playfair Display', serif;
    margin-top: 0;
    margin-bottom: 5px;
    color: #6d4c41;
    font-size: 1.2em;
    font-weight: normal;
}

.daily-entry p {
    margin: 0;
    font-size: 1em;
}

.word-of-the-day {
    background-color: #fff8e1;
    border-left: 5px solid #8d6e63;
    padding: 15px;
    margin-top: 20px;
    border-radius: 8px;
    text-align: left;
    font-style: italic;
    color: #5d4037;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}

.word-of-the-day h2 {
    font-family: 'Playfair Display', serif;
    margin-top: 0;
    margin-bottom: 5px;
    color: #6d4c41;
    font-size: 1.2em;
    font-weight: normal;
}

.word-of-the-day p {
    margin: 0;
    font-size: 1em;
}

.phrase-of-the-day {
    border-left-color: #a1887f;
}

.search-area {
    display: flex;
    margin-bottom: 30px;
    flex-direction: column;
    gap: 15px;
}

#word-input {
    padding: 12px;
    border: 1px solid #bcaaa4;
    border-radius: 6px;
    font-size: 1em;
    width: 100%;
    box-sizing: border-box;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
    transition: border-color 0.3s ease;
    font-family: 'Lora', serif;
    color: #4e342e;
}

#word-input:focus {
    outline: none;
    border-color: #8d6e63;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05), 0 0 5px rgba(141, 110, 99, 0.3);
}

#search-button {
    padding: 12px 20px;
    background-color: #8d6e63;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease, transform 0.1s ease;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 2px 5px rgba(141, 110, 99, 0.2);
    font-family: 'Lora', serif;
}

#search-button:hover {
    background-color: #6d4c41;
    box-shadow: 0 3px 7px rgba(141, 110, 99, 0.3);
}

#search-button:active {
    transform: scale(0.98);
}

.status-message {
    font-size: 1.1em;
    color: #5d4037;
    margin-top: 20px;
    padding: 10px;
    border-radius: 4px;
    background-color: #fff8e1;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

#loading {
    color: #8d6e63;
}

#error-message {
    color: #bf360c;
    background-color: #ffccbc;
    border: 1px solid #ef6c00;
}

#results {
    text-align: left;
    margin-top: 30px;
    border-top: 2px solid #efebe9;
    padding-top: 20px;
}

.word-and-pronunciation {
    display: flex;
    flex-direction: column; 
    align-items: flex-start; 
    margin-bottom: 15px; 
}

#result-word {
    font-family: 'Playfair Display', serif;
    color: #6d4c41;
    margin: 0; 
    font-size: 2.5em; 
    font-weight: normal;
    line-height: 1.2; 
}

.pronunciation-area {
    display: flex; 
    align-items: center;
    margin-top: 5px; 
    flex-wrap: wrap; 
}

.result-pronunciation {
    font-family: 'Lora', serif;
    font-style: italic;
    color: #8d6e63;
    margin: 0 8px 0 0; 
    font-size: 1em;
    line-height: 1; 
}

.pronounce-button {
    padding: 4px 8px;
    background-color: #bcaaa4;
    color: #4e342e;
    border: 1px solid #a1887f;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    line-height: 1;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    margin: 0; 
    flex-shrink: 0; 
}

.pronounce-button:hover {
    background-color: #a1887f;
    border-color: #8d6e63;
}

.pronounce-button:active {
    background-color: #8d6e63;
    border-color: #6d4c41;
}

.pronounce-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#definition-list {
    margin-top: 15px;
}

.linguistic-analysis {
    margin-bottom: 25px;
}

.linguistic-analysis h3 {
    font-family: 'Playfair Display', serif;
    color: #4e342e;
    margin-bottom: 10px;
    border-bottom: 1px solid #efebe9;
    padding-bottom: 6px;
    font-size: 1.3em;
    font-weight: normal;
}

.analysis-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
    color: #5d4037;
}

.analysis-list li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.analysis-list li strong {
     color: #8d6e63;
     margin-right: 5px;
}

.definition-block {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #d7ccc8;
}

.definition-block:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.definition-text {
    margin-bottom: 20px;
    line-height: 1.7;
    color: #5d4037;
    font-size: 1em;
}

.category-section {
    margin-bottom: 20px;
}

.category-section h3 {
    font-family: 'Playfair Display', serif;
    color: #4e342e;
    margin-bottom: 10px;
    border-bottom: 1px solid #efebe9;
    padding-bottom: 6px;
    font-size: 1.3em;
    font-weight: normal;
}

.word-list {
    /* Container for words */
}

.category {
    margin-bottom: 8px;
}

.category strong {
    display: inline-block;
    margin-right: 8px;
    color: #8d6e63;
    min-width: 80px;
    vertical-align: top;
}

.clickable-word {
    color: #6d4c41;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s ease, text-decoration 0.2s ease;
}

.clickable-word:hover {
    text-decoration: underline;
    color: #4e342e;
}

.hidden {
    display: none;
}

.definition-separator {
    border: none;
    height: 1px;
    background-color: #d7ccc8;
    margin: 30px 0;
}

.example-sentences-section {
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px dashed #d7ccc8;
}

.example-sentences-section h3 {
    font-family: 'Playfair Display', serif;
    color: #4e342e;
    margin-bottom: 10px;
    font-size: 1.3em;
    border-bottom: none;
    padding-bottom: 0;
    font-weight: normal;
}

.sentences-list {
    list-style: disc inside;
    padding-left: 15px;
    margin: 0;
    color: #5d4037;
}

.example-sentence {
    margin-bottom: 10px;
    line-height: 1.6;
}

/* Adjust layout for larger screens */
@media (min-width: 600px) {
    .search-area {
        flex-direction: row;
        gap: 10px;
    }

    #word-input {
        flex-grow: 1;
        width: auto;
    }

    #search-button {
        width: auto;
        flex-shrink: 0;
    }

    .daily-entries {
        flex-direction: row; /* Side-by-side on desktop */
    }

    .daily-entry {
        flex: 1 1 48%; /* Almost half width */
    }

    .category strong {
        min-width: 100px;
    }

    .word-and-pronunciation {
        flex-direction: column; 
        align-items: flex-start; 
    }

    #result-word {
    }

    .pronunciation-area {
        margin-top: 5px; 
    }
}