/**
 * Smart Word Explainer Styles
 * 
 * Using a main wrapper ID for better specificity.
 */

/* Main wrapper */
#sword-explainer-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    z-index: 9999990;
    pointer-events: none;
}

/* Popup Container */
#sword-explainer-wrapper #sword-popup {
    position: fixed;
    z-index: 9999999;
    background: #fff;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    width: 350px;
    max-width: 90vw;
    max-height: 500px;
    overflow-y: auto;
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    border: 1px solid #ddd;
    visibility: hidden;
    pointer-events: auto;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

#sword-explainer-wrapper #sword-popup.sword-popup-visible {
    display: block;
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

/* Popup Header */
#sword-explainer-wrapper #sword-popup .sword-popup-header {
    padding: 10px 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 2;
}

#sword-explainer-wrapper #sword-popup .sword-word-title {
    margin: 0;
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

#sword-explainer-wrapper #sword-popup .sword-close-btn {
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0 5px;
    color: #6c757d;
}

#sword-explainer-wrapper #sword-popup .sword-close-btn:hover {
    color: #343a40;
}

/* Popup Content */
#sword-explainer-wrapper #sword-popup .sword-popup-content {
    padding: 15px;
}

/* Loader */
#sword-explainer-wrapper #sword-popup .sword-loader {
    text-align: center;
    padding: 20px;
    color: #6c757d;
}

/* Phonetics Section */
#sword-explainer-wrapper #sword-popup .sword-phonetics {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

#sword-explainer-wrapper #sword-popup .sword-phonetic-text {
    font-style: italic;
    color: #495057;
}

#sword-explainer-wrapper #sword-popup .sword-audio-btn {
    background: #e9ecef;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 12px;
}

#sword-explainer-wrapper #sword-popup .sword-audio-btn:hover {
    background: #dee2e6;
}

/* Meanings Section */
#sword-explainer-wrapper #sword-popup .sword-meaning {
    margin-bottom: 20px;
}

#sword-explainer-wrapper #sword-popup .sword-part-of-speech {
    font-size: 16px;
    color: #495057;
    margin: 0 0 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #e9ecef;
}

#sword-explainer-wrapper #sword-popup .sword-definitions {
    margin-bottom: 15px;
}

#sword-explainer-wrapper #sword-popup .sword-definition {
    margin-bottom: 12px;
}

#sword-explainer-wrapper #sword-popup .sword-definition p {
    margin: 0 0 5px;
}

#sword-explainer-wrapper #sword-popup .sword-example {
    font-style: italic;
    color: #6c757d;
    margin-left: 10px;
}

/* Synonyms & Antonyms */
#sword-explainer-wrapper #sword-popup .sword-synonyms, 
#sword-explainer-wrapper #sword-popup .sword-antonyms {
    margin-bottom: 10px;
}

#sword-explainer-wrapper #sword-popup .sword-synonyms h5, 
#sword-explainer-wrapper #sword-popup .sword-antonyms h5 {
    margin: 0 0 5px;
    font-size: 14px;
    color: #495057;
}

#sword-explainer-wrapper #sword-popup .sword-synonyms p, 
#sword-explainer-wrapper #sword-popup .sword-antonyms p {
    margin: 0;
    color: #6c757d;
}

/* Error Message */
#sword-explainer-wrapper #sword-popup .sword-error {
    color: #721c24;
    background-color: #f8d7da;
    padding: 10px;
    border-radius: 4px;
    text-align: center;
} 