.loading-spinner {
    display: none; /* Hidden by default */
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top-color: #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Define an animation for the spin effect */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.speakers {
    font-size: 0.9rem;
    font-style: italic;
    text-decoration: none;
    color: #858585;
}

.related-headword {
    text-decoration: none;
    color: #525252;
}

.audio-player {
    padding-top: 10px;
}

.audio-play-button {
    background-color: #A6192E;
    color: #ffffff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    margin-top: 10px;
    transition: background-color 0.3s ease;
}

.audio-play-button:hover {
    background-color: #8B1527;
}

.action-buttons {
    display: flex; 
    gap: 1.5rem;    
    justify-content: center; 
    margin-top: 2rem; 
    flex-wrap: wrap; 
}

.action-buttons button {
    background-color: #A6192E;
    color: #ffffff; 
    padding: 1rem 1.5rem; 
    border-radius: 1.5rem; 
    border: none; 
    cursor: pointer; 
    font-size: 1rem; 
    font-weight: 500; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 0.5rem; 
    min-width: 100px; 
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); 
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}

.action-buttons button:hover {
    background-color: #8B1527; 
    transform: translateY(-2px); 
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15); 
}

.action-buttons button i {
    font-size: 1.8rem; 
    margin-bottom: 0.25rem; 
}

.action-buttons button[data-lang-en="Audio"] i {
}

.disabled-audio {
    opacity: 0.5; 
    cursor: not-allowed; 
}

/* For smaller screens, ensure buttons stack nicely */
@media (max-width: 640px) {
    .action-buttons {
        flex-direction: row; 
        gap: 1rem;
        flex-wrap: wrap; 
        justify-content: center;
    }
    .action-buttons button {
        flex: 1 1 auto;
        max-width: 30%; 
        padding: 0.8rem 1rem; 
    }
    .action-buttons button i {
        font-size: 1.5rem; 
    }
}

@media (max-width: 600px) {
    .headword {
        font-size: 1.8em;
    }
    .pronunciation-grid {
        grid-template-columns: 1fr;
    }
    .metadata-line {
        flex-direction: column;
        gap: 5px;
    }
}

.search-header{
    font-size: 1em;
    padding: 10px;
    padding-top: 0px;
    text-align: center;
    justify-content: space-between;
    align-items: baseline;
    color: #fff;
    font-weight: lighter;
}

.dictionary-entry {
    overflow: hidden;
    margin-bottom: 20px;
}

.entry-header {
    color: white;
    padding: 15px 20px;
}

.headword-line {
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 5px;
    text-align: center;
}

.headword {
    font-size: 2.2em;
    margin: 0;
    font-weight: normal;
    color: #ffffff;
    font-weight: bold;
}

.phonetics {
    font-size: 1.2em;
    opacity: 0.9;
}

.metadata-line {
    display: flex;
    gap: 20px;
    font-size: 0.9em;
}

.entry-body {
    padding: 20px;
}

.section {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #eee;
}

.section:last-child {
    border-bottom: none;
}

.section-title {
    color: #333;
    font-size: 1.1em;
    margin-bottom: 8px;
    font-weight: bold;
    display: flex;
    align-items: center;
}

.pronunciation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.pronunciation-item {
    background-color: #eee;
    padding: 8px 12px;
    border-radius: 4px;
}

.pronunciation-label {
    color: #A71C20;
    margin-bottom: 3px;
}

.pronunciation-label-tl {
    font-family: 'Arial Bold', Arial, sans-serif;
    margin-block-start: 1em;
}

.pronunciation-label-tone {
    font-family: 'Arial Bold', Arial, sans-serif;
    font-style: italic;
    color: #F2A900;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 5px;
    text-align: center;
}

@font-face {
    font-family: 'Arial Bold';
    src: url('font/Arial-Bold.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

.tab-content active{
    padding: 15px;
    border-radius: 6px;
    margin-top: 10px;
    text-decoration: none;
}

.example-sentence {
    padding: 15px;
    border-radius: 6px;
    margin-top: 10px;
    text-decoration: none;
}

.transcription {
    font-style: italic;
    color: #555;
    margin-left: 5px;
    text-decoration: none;
    font-family: 'Arial', Arial, sans-serif;
}

.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.clickable {
    color: #d35400;
    cursor: pointer;
    text-decoration: underline;
}

.searchable {
    color: blue;
    text-decoration: underline;
    cursor: pointer;
}

.help-icon {
    cursor: pointer;
    margin-left: 5px;
    color: #a6192e;
    font-size: 1.5em;
    vertical-align: middle;
}

.help-modal table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.help-modal th, .help-modal td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

.help-modal th {
    background-color: #f2f2f2;
    font-weight: bold;
}

.help-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
    justify-content: center;
    align-items: center;
}

.help-modal-content {
    background-color: #fefefe;
    margin: 50% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);
    position: relative;
    border-radius: 8px;
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 20px;
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.help-modal h4 {
    margin-top: 0;
    color: #333;
}

.help-modal p {
    font-size: 0.95em;
    line-height: 1.6;
    color: #555;
}

.help-modal ul {
    list-style-type: disc;
    margin-left: 20px;
    color: #555;
}

/* Tabbed Interface */
.tab-container {
    padding: 20px;
    background-color: #fff;
    border-radius: 10px 10px 0px 0px;
    padding-bottom: 150px;
}

.tab-header {
    display: flex;
    justify-content: center;
    border-bottom: 2px solid #ddd;
    margin-bottom: 15px;
    align-items: flex-end;
    font-size: 1rem; 
}

.tab-button {
    background-color: transparent;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    transition: color 0.2s, border-bottom 0.2s;
    outline: none;
    color: #666;
    font-weight: bold;
    border-radius: 0px;
    font-size: 1rem;
}

.tab-button:hover {
    color: #a6192e;
}

.tab-button.active {
    color: #a6192e;
    border-bottom: 2px solid #a6192e;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.related-item {
    border-bottom: 1px dashed #eee;
    padding: 10px 0;
}

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

/* WORDLIST STYLES */
.word-list-item {
    margin-bottom: 0.5rem;
    background-color: #fff;
    border-bottom: 1px solid #e5e7eb; 
}

.word-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.word-main-info {
    display: flex;
    align-items: baseline;
}

.headword-base {
    font-size: 1.25rem; 
    font-weight: 700; 
    color: #1f2937; 
    margin: 0;
}

.practical-text {
    font-size: 0.875rem; 
    color: #6b7280; 
    margin-left: 0.5rem;
}

.entry-number {
    font-size: 0.75rem; 
    color: #ccc; 
}

.word-details {
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #4b5563; 
}

.bullet-separator {
    margin: 0 0.25rem; 
}

.translation {
    color: #10b981; 
}