/* Responsive styling for vocabulary table with harmonized practice list styling */
.ysp-dictionary-container {
    max-width: 100%;
    margin: 0 auto 2em;
    overflow-x: auto;
}

.ysp-dictionary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: #407592;
    border-left: 4px solid #0073aa;
    color: white;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    margin-bottom: 0;
    flex-wrap: wrap;
}

.ysp-dictionary-header h3 {
    margin: 0;
    color: white;
}

.ysp-filter-container {
    margin: 10px 0;
}

#ysp-realm-filter {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    font-size: 14px;
}

.ysp-table-responsive {
    overflow-x: auto;
    width: 100%;
    border: 1px solid #E5E7EB;
    border-top: none;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.ysp-dictionary-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
}

.ysp-dictionary-table th,
.ysp-dictionary-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.ysp-dictionary-table th {
    background-color: #F9FAFB;
    font-weight: 600;
    color: #555;
    position: sticky;
    top: 0;
}

.ysp-dictionary-table tr:hover {
    background-color: #f5f5f5;
}

.ysp-dictionary-empty {
    padding: 20px;
    text-align: center;
    background-color: #fff;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.info-column {
    width: 50px;
}

.ysp-info-icon {
    cursor: help;
    font-size: 18px;
}

/* Button styling matches the practice list */
.ysp-btn {
    display: inline-block;
    padding: 6px 12px;
    margin-right: 5px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
    font-weight: 500;
    text-align: center;
}

.ysp-edit-btn {
    background-color: #2563EB;
    color: white;
}

.ysp-save-btn {
    background-color: #10B981;
    color: white;
}

.ysp-cancel-btn {
    background-color: #F59E0B;
    color: white;
}

.ysp-delete-btn {
    background-color: #EF4444;
    color: white;
}

.ysp-btn:hover {
    opacity: 0.9;
}

/* Mobile responsive adjustments */
@media screen and (max-width: 768px) {
    .ysp-dictionary-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .ysp-filter-container {
        width: 100%;
        margin-top: 10px;
    }
    
    #ysp-realm-filter {
        width: 100%;
    }
    
    .ysp-dictionary-table thead {
        display: none;
    }
    
    .ysp-dictionary-table, 
    .ysp-dictionary-table tbody, 
    .ysp-dictionary-table tr, 
    .ysp-dictionary-table td {
        display: block;
        width: 100%;
    }
    
    .ysp-dictionary-table tr {
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 4px;
        overflow: hidden;
    }
    
    .ysp-dictionary-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 15px;
        text-align: right;
        position: relative;
    }
    
    .ysp-dictionary-table td::before {
        content: attr(data-label);
        font-weight: 600;
        float: left;
        text-align: left;
    }
    
    .ysp-dictionary-table td.info-cell {
        justify-content: center;
        background-color: #f9f9f9;
        padding: 5px;
    }
    
    .ysp-dictionary-table td.info-cell::before {
        content: none;
    }
    
    .ysp-dictionary-table td.actions {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .ysp-dictionary-table td.actions::before {
        content: none;
    }
    
    .ysp-btn {
        margin: 3px;
    }
}

/* For tablets */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .ysp-dictionary-container {
        padding: 0;
    }
    
    .ysp-dictionary-table th,
    .ysp-dictionary-table td {
        padding: 10px;
    }
}

/* New styles for improved vocabulary interface - add these to your existing CSS file */

/* Toolbar for view switching and filters */
.ysp-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-top: none;
    margin-bottom: 0;
}

.ysp-view-selector {
    display: flex;
    gap: 5px;
}

.ysp-view-btn {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #555;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ysp-view-btn.active {
    background-color: #2563EB;
    color: white;
    border-color: #2563EB;
}

.ysp-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.ysp-filters select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
}

.ysp-filter-btn {
    background-color: #2563EB;
    color: white;
}

.ysp-filter-btn:hover {
    background-color: #1D4ED8;
}

/* Card View */
.ysp-card-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    padding: 16px;
    background-color: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-top: none;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.ysp-word-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #E5E7EB;
}

.ysp-word-card:hover {
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.ysp-card-header {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #F9FAFB;
}

.ysp-word-term {
    margin: 0;
    font-size: 1.1em;
    font-weight: 600;
    color: #111827;
}

.ysp-card-actions {
    display: flex;
    gap: 5px;
}

.ysp-card-meta {
    padding: 10px 15px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.ysp-pos-badge, .ysp-realm-badge {
    font-size: 0.75em;
    padding: 3px 8px;
    border-radius: 20px;
    font-weight: 500;
    white-space: nowrap;
}

.realm-cell {
    opacity: 0.6;
    background-color: #f4f4f4;
    pointer-events: none;
    font-style: italic;
}

/* POS-specific colors */
.pos-noun {
    background-color: #DBEAFE;
    color: #1E40AF;
}

.pos-verb {
    background-color: #D1FAE5;
    color: #047857;
}

.pos-adjective, .pos-adj {
    background-color: #EDE9FE;
    color: #5B21B6;
}

.pos-adverb, .pos-adv {
    background-color: #FEF3C7;
    color: #92400E;
}

.pos-preposition, .pos-prep {
    background-color: #E4E4E7;
    color: #52525B;
}

.pos-pronoun {
    background-color: #FCE7F3;
    color: #9D174D;
}

.pos-conjunction {
    background-color: #CCFBF1;
    color: #0F766E;
}

.pos-interjection {
    background-color: #FEE2E2;
    color: #B91C1C;
}

.pos-determiner, .pos-det {
    background-color: #E0E7FF;
    color: #3730A3;
}

/* Default for any other POS */
.ysp-pos-badge {
    background-color: #EFF6FF;
    color: #2563EB;
}

.ysp-realm-badge {
    background-color: #F3F4F6;
    color: #4B5563;
}

.ysp-card-content {
    padding: 12px 15px;
}

.ysp-label {
    font-weight: 600;
    color: #4B5563;
    margin-right: 5px;
}

.ysp-translation, .ysp-context {
    margin-bottom: 10px;
}

.ysp-added-date {
    color: #9CA3AF;
    font-size: 0.8em;
    text-align: right;
    margin-top: 10px;
}

.ysp-card-footer {
    padding: 10px 15px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    background-color: #F9FAFB;
}

/* List View */
.ysp-list-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    background-color: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-top: none;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.ysp-list-item {
    background-color: white;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    padding: 12px 15px;
    border: 1px solid #E5E7EB;
}

.ysp-list-item:hover {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.ysp-list-primary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.ysp-list-term-container {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ysp-list-term {
    font-weight: 600;
    font-size: 1.05em;
    color: #111827;
}

.ysp-list-translation {
    color: #4B5563;
}

.ysp-list-actions {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.ysp-list-details {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #E5E7EB;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.ysp-list-realm, .ysp-list-context, .ysp-list-date {
    font-size: 0.9em;
}

/* Eye button and view toggle */
.ysp-view-lexical-card {
    background: none;
    border: none;
    color: #2563EB;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.ysp-view-lexical-card:hover {
    background-color: #EFF6FF;
    color: #1D4ED8;
}

.ysp-toggle-details {
    background: none;
    border: none;
    color: #6B7280;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.ysp-toggle-details:hover {
    background-color: #F3F4F6;
    color: #4B5563;
}

/* Edit form styling */
.ysp-edit-form {
    text-align: left;
}

.ysp-form-row {
    margin-bottom: 15px;
}

.ysp-form-row label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #374151;
}

.ysp-form-row input,
.ysp-form-row select,
.ysp-form-row textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #D1D5DB;
    border-radius: 4px;
    font-size: 14px;
}

.ysp-form-row textarea {
    min-height: 80px;
    resize: vertical;
}

/* Mobile responsiveness for new views */
@media screen and (max-width: 768px) {
    .ysp-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .ysp-view-selector {
        justify-content: center;
    }
    
    .ysp-filters {
        flex-direction: column;
        width: 100%;
    }
    
    .ysp-filters select,
    .ysp-filter-btn {
        width: 100%;
    }
    
    .ysp-card-container {
        grid-template-columns: 1fr;
    }
    
    .ysp-list-primary {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .ysp-list-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: 8px;
    }
    
    .ysp-list-details {
        grid-template-columns: 1fr;
    }
}

/* Tablet adjustments */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .ysp-card-container {
        grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    }
}

/* Animation for expanding details */
.ysp-list-details {
    transition: max-height 0.3s ease;
}

/* Modal improvements */
.ysp-swal-popup {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.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;
}