/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.close-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
}

.modal-body {
    padding: 20px;
    flex-grow: 1;
    overflow-y: auto;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Input Styles */
.input-group {
    margin-bottom: 15px;
}

.input-label {
    display: block;
    margin-bottom: 5px;
    color: #666;
    font-size: 14px;
}

.input-field {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
}

.input-field:focus {
    outline: none;
    border-color: #492e57;
}

/* Modal Buttons */
.modal-button {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    border: none;
    font-weight: 500;
}

.cancel-button {
    background-color: #f5f5f5;
    color: #666;
}

.confirm-button {
    background-color: #492e57;
    color: white;
}

/* Language Options */
.language-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

.language-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 8px;
    background: none;
    cursor: pointer;
    transition: all 0.2s;
}

.language-option:hover,
.language-option.active {
    background-color: #f9f9f9;
    border-color: #492e57;
}

.language-option img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-bottom: 5px;
    object-fit: cover;
}

/* Content Modal Specifics */
.content-image-section {
    width: 100%;
    height: 200px;
    background-color: #f0f0f0;
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
}

.content-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.content-text {
    line-height: 1.6;
    color: #444;
    margin-bottom: 20px;
}

.content-audio-section {
    background-color: #f9f9f9;
    padding: 15px;
    border-top: 1px solid #eee;
    flex-shrink: 0;
}

.audio-controls {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

.audio-extra-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.audio-control-btn {
    background: white;
    border: 1px solid #ddd;
    padding: 5px 10px;
    border-radius: 15px;
    cursor: pointer;
    display: flex;
    gap: 5px;
    font-size: 12px;
    color: #666;
}

/* Audio Loading Indicator */
.audio-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    gap: 10px;
    color: #666;
    font-size: 14px;
}

.audio-loading .spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #492e57;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

    100% {
        transform: rotate(360deg);
    }
}

/* Infobox Popup */
.infobox-popup {
    position: fixed;
    z-index: 10000; /* Above everything */
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    width: 280px;
    max-width: 90vw;
    padding: 15px;
    display: none; /* Hidden by default */
    opacity: 0;
    transition: opacity 0.3s ease;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    border: 1px solid #eee;
}

.infobox-popup.visible {
    display: block;
    opacity: 1;
}

.infobox-content {
    position: relative;
}

.infobox-close {
    position: absolute;
    top: -10px;
    right: -10px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #999;
    padding: 5px;
    line-height: 1;
}

.infobox-close:hover {
    color: #333;
}

.infobox-text {
    margin-top: 5px;
}

/* Arrow for the popup */
.infobox-arrow {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid white;
}

/* Style for clickable underlined text in content */
.content-text u, 
.content-text span[style*="text-decoration: underline"] {
    text-decoration: underline;
    text-decoration-color: var(--primary-color, #007bff);
    text-decoration-style: dotted;
    cursor: pointer;
    color: var(--primary-color, #007bff);
    font-weight: 500;
    transition: all 0.2s;
}

.content-text u:hover,
.content-text span[style*="text-decoration: underline"]:hover {
    background-color: rgba(0, 123, 255, 0.1);
    text-decoration-style: solid;
}