/* ============================
   YSP Vocabulary – Lexical Cards
   ============================ */

/*=== CARD INDICATORS ===*/
.card-indicators {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.flag-icon {
    font-size: 18px;
    cursor: pointer;
    transition: transform 0.2s ease;
}
.flag-icon:hover {
    transform: scale(1.2);
}

.generate-card-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #2563EB;
    color: white;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.generate-card-btn:hover {
    background-color: #1D4ED8;
}


/*=== MODALS ===*/
.ysp-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    padding: 20px;
}

.ysp-modal-content {
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.2);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 25px;
    position: relative;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.ysp-modal-content h3 {
    font-size: 20px;
    margin-top: 0;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.ysp-modal-content .loading {
    padding: 20px 0;
    text-align: center;
    color: #555;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.ysp-modal-content button {
    cursor: pointer;
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.2s;
}

.close-modal-btn {
    background-color: #f7f7f7;
    border: 1px solid #ddd;
    color: #555;
}
.close-modal-btn:hover {
    background-color: #eee;
}

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


/*=== LANGUAGE SELECTION ===*/
.language-selection .language-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.language-option {
    display: flex;
    align-items: center;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}
.language-option:hover {
    background-color: #f0f7ff;
    border-color: #bbd6f5;
}

.language-flag {
    font-size: 20px;
    margin-right: 10px;
}

/* Canonical card styling */
.canonical-language {
    border: 2px solid #2563EB;
    background-color: #EFF6FF;
}

.canonical-badge {
    font-size: 0.8em;
    color: white;
    background-color: #2563EB;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 5px;
    font-weight: bold;
}

.canonical-note {
    background-color: #f8f9fa;
    border-left: 4px solid #2563EB;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 0 4px 4px 0;
}

.canonical-note p {
    margin: 0;
    font-size: 0.9em;
    color: #444;
}

/*=== CARD VIEW ===*/
.card-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

.card-header {
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
}
.card-header .term {
    font-size: 28px;
    color: #333;
    margin: 0 0 5px;
}
.card-header .part-of-speech {
    font-style: italic;
    color: #555;
    margin-right: 15px;
}
.card-header .pronunciation {
    color: #666;
    font-family: monospace;
}

.card-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}
.card-section:last-child {
    border-bottom: none;
    margin-bottom: 10px;
    padding-bottom: 5px;
}
.card-section h3 {
    font-size: 18px;
    color: #2563EB;
    margin-bottom: 10px;
}


/*=== MEANINGS ===*/
.meaning-item {
    margin-bottom: 15px;
    padding: 12px;
    background-color: #f9f9f9;
    border-radius: 5px;
}
.meaning-item h4 {
    font-size: 16px;
    color: #2563EB;
    margin: 0 0 8px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 5px;
}
.meaning-item p {
    margin: 8px 0;
}
.meaning-item ul {
    margin: 8px 0 8px 20px;
}
.examples li {
    font-style: italic;
    margin-bottom: 8px;
}


/*=== TABLES ===*/
.verb-forms,
.word-family {
    width: 100%;
    border-collapse: collapse;
}
.verb-forms td,
.word-family td {
    padding: 6px 10px;
}
.verb-forms tr:nth-child(odd),
.word-family tr:nth-child(odd) {
    background-color: #f5f5f5;
}


/*=== NOTES ===*/
.notes-section {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}
.notes-display {
    margin-bottom: 15px;
    white-space: pre-wrap;
    line-height: 1.4;
}
.edit-notes-btn,
.save-notes-btn {
    background-color: #0073aa;
    color: white;
    border: none;
}
.edit-notes-btn:hover,
.save-notes-btn:hover {
    background-color: #005177;
}

.notes-editor {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}
.notes-textarea {
    width: 100%;
    min-height: 120px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    margin-bottom: 10px;
}

.editor-buttons {
    display: flex;
    gap: 10px;
}
.cancel-edit-btn {
    background-color: #f7f7f7;
    border: 1px solid #ddd;
    color: #555;
}
.cancel-edit-btn:hover {
    background-color: #eee;
}


/*=== SWEETALERT (Legacy Support) ===*/
.ysp-swal-popup {
    max-width: 800px;
    padding: 20px;
}
.ysp-swal-title {
    font-size: 1.5em !important;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
    margin-bottom: 20px !important;
    color: #2563EB !important;
}
.ysp-swal-content {
    text-align: left;
    font-size: 1rem;
}

.ysp-lexical-card {
    text-align: left;
}
.ysp-lexical-section {
    margin-bottom: 20px;
}
.ysp-lexical-section h4 {
    margin-bottom: 5px;
    color: #444;
    font-size: 1.1em;
    font-weight: 600;
}
.ysp-lexical-section p {
    margin-top: 5px;
    line-height: 1.5;
    color: #333;
}


/*=== BUTTONS ===*/
.view-card-btn {
    background-color: #0073aa;
    color: white;
    border: none;
}
.view-card-btn:hover {
    background-color: #005177;
}

.ysp-view-lexical-card {
    background: none;
    border: none;
    color: #2563EB;
    cursor: pointer;
    font-size: 18px;
    padding: 0;
}
.ysp-view-lexical-card:hover {
    color: #1D4ED8;
}


/*=== ERRORS ===*/
.error {
    color: #d63638;
    font-weight: 500;
}