/* Basic Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f8f8;
    padding: 20px;
    max-width: 800px;
    margin: 0 auto; /* Center the content on larger screens */
}

/* Header Area */
.header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.header .back-arrow {
    font-size: 24px;
    margin-right: 10px;
    color: #555;
}

.header .word-title {
    flex-grow: 1;
    font-size: 32px;
    font-weight: bold;
    color: #333;
}

.header .favorite-star {
    font-size: 24px;
    color: gold; /* Example color */
}

.pronunciation-section {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap; /* Allow wrapping on small screens */
}

.pronunciation-item {
    display: flex;
    align-items: center;
    margin-right: 20px;
}

.pronunciation-item .speaker-icon {
    margin-right: 5px;
    color: #007bff; /* Blue color for icons */
    cursor: pointer;
}

.pronunciation-item .label {
    font-size: 18px;
    color: #555;
    margin-right: 5px;
}

.pronunciation-item .phonetic {
    font-size: 18px;
    color: #555;
}

/* Icons row below pronunciation */
.icon-row {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    color: #007bff; /* Blue color for icons */
}

.icon-row .icon {
    margin-right: 15px;
    font-size: 20px;
    cursor: pointer;
}

.icon-row .rating .star {
    color: #ccc; /* Gray for unselected stars */
}


/* Tags Section */
.tags {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.tag {
    background-color: #eee;
    border: 1px solid #ccc;
    border-radius: 15px;
    padding: 5px 15px;
    margin-right: 10px;
    margin-bottom: 10px;
    font-size: 14px;
    color: #555;
}

/* Section Headers (Word family, Corpus) */
.section-header {
    background-color: #e0e0e0; /* Light gray background */
    color: #333;
    padding: 8px 15px;
    margin-bottom: 15px;
    border-radius: 8px; /* Rounded corners */
    font-weight: bold;
    display: inline-block; /* Fit to content */
}

/* Dictionary Entry Content */
.dictionary-entry {
    margin-bottom: 20px;
}

.word-main {
    font-size: 28px;
    font-weight: bold;
    color: #007bff; /* Blue for the main word */
    margin-bottom: 5px;
    display: inline-block;
}

.word-phonetic {
    font-size: 22px;
    color: #555;
    margin-left: 5px;
}

.word-indicators {
    display: inline-block;
    margin-left: 5px;
}

.word-indicators span {
    margin-right: 3px;
    color: #ccc; /* Example color for circles */
}

.word-pos {
    font-style: italic;
    color: #d9534f; /* Reddish color for part of speech */
    margin-left: 5px;
    font-weight: bold;
    display: inline-block;
}

.word-sound-icon {
     color: #007bff; /* Blue for speaker icon */
     margin-left: 5px;
     cursor: pointer;
     display: inline-block;
}


/* Definitions List */
.definitions {
    list-style: none;
    padding-left: 0;
}

.definition-item {
    margin-bottom: 20px;
}

.definition-number {
    font-weight: bold;
    margin-right: 5px;
    color: #333;
}

.definition-text {
    display: inline;
}

.definition-text u {
    text-decoration: underline dotted; /* Dotted underline for emphasis */
}

.synonym-label, .antonym-label {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    margin-left: 5px;
    vertical-align: middle;
}

.synonym-label {
    background-color: #5bc0de; /* Blue-ish background for SYN */
    color: white;
}

.antonym-label {
    background-color: #d9534f; /* Red background for OPP */
    color: white;
}

/* Examples */
.examples {
    list-style: none;
    padding-left: 20px; /* Space for the vertical line */
    border-left: 3px solid #eee; /* Gray vertical line */
    margin-top: 10px;
}

.example-item {
    margin-bottom: 10px;
    color: #555;
    position: relative; /* Needed for potential icons/styling next to examples */
}

.example-item .speaker-icon {
    position: absolute;
    left: -20px; /* Position icon next to the line */
    top: 3px;
    color: #007bff; /* Blue color for icons */
    cursor: pointer;
}


/* Derived Words (adverb, noun, etc.) */
.derived-word {
    margin-top: 15px;
    margin-bottom: 10px;
}

.derived-word .dash {
    font-weight: bold;
    margin-right: 5px;
    color: #333;
}

.derived-word .word {
    font-weight: bold;
    color: #333;
}

.derived-word .pos {
    font-style: italic;
    color: #555;
    margin-left: 5px;
}

.derived-word .sound-icon {
    color: #007bff; /* Blue for speaker icon */
    margin-left: 5px;
    cursor: pointer;
}

/* Origin Section */
.origin-section {
    margin-top: 30px;
}

.origin-section .section-header {
     background-color: #e0e0e0; /* Light gray background */
    color: #333;
    padding: 8px 15px;
    margin-bottom: 15px;
    border-radius: 8px; /* Rounded corners */
    font-weight: bold;
    display: inline-block; /* Fit to content */
}

.origin-text {
    color: #555;
}

.origin-text a {
    color: #007bff; /* Blue for links */
    text-decoration: none;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .header .word-title {
        font-size: 28px;
    }

    .pronunciation-item {
        margin-right: 10px;
        margin-bottom: 5px; /* Add space when wrapping */
    }

    .pronunciation-item .label,
    .pronunciation-item .phonetic {
        font-size: 16px;
    }

     .icon-row .icon {
         margin-right: 10px;
         font-size: 18px;
     }


    .tags {
        flex-direction: column; /* Stack tags vertically on small screens */
    }

    .tag {
        margin-right: 0;
        margin-bottom: 5px;
        width: fit-content; /* Prevent tags from stretching */
    }

    .word-main {
        font-size: 24px;
    }

     .word-phonetic {
         font-size: 18px;
     }

    .definition-item {
        margin-bottom: 15px;
    }

    .examples {
        padding-left: 15px; /* Adjust padding for the vertical line */
    }

     .example-item .speaker-icon {
        left: -15px; /* Adjust icon position */
     }
}