/* Words page styles with toast notifications */
.main_content {
	margin: 1em;
}

/* Toast Notifications */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 8px;
    padding: 16px 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    transform: translateX(400px);
    transition: all 0.3s ease;
    max-width: 400px;
    border-left: 4px solid #ccc;
}

.toast-notification.toast-show {
    transform: translateX(0);
}

.toast-success {
    border-left-color: #28a745;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
}

.toast-error {
    border-left-color: #dc3545;
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toast-icon {
    font-size: 20px;
    font-weight: bold;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.toast-success .toast-icon {
    background: #28a745;
    color: white;
}

.toast-error .toast-icon {
    background: #dc3545;
    color: white;
}

.toast-message {
    font-weight: 500;
    color: #333;
}

/* Language tabs styling */
.language-tabs-container {
    margin-bottom: 40px;
}

.language-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 2px solid #3B060A;
    padding-bottom: 0;
}

.language-tab {
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #6c757d;
    transition: all 0.2s ease;
    border-radius: 8px 8px 0 0;
    min-width: 120px;
}

.language-tab:hover {
    background: rgba(59, 6, 10, 0.1);
    color: #0f73d7;
}

.language-tab.active {
    background: #3B060A;
    color: #0f73d7;
    border-bottom-color: #0f73d7;
}

.tab-count {
    font-size: 14px;
    font-weight: 500;
    opacity: 0.8;
}

.language-tab-content {
    display: none;
}

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

/* Familiarity tabs (nested within language tabs) */
.familiarity-tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 25px;
    border-bottom: 1px solid #555;
    padding-bottom: 0;
}

.familiarity-tab {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #adb5bd;
    transition: all 0.2s ease;
    border-radius: 6px 6px 0 0;
}

.familiarity-tab:hover {
    background: rgba(15, 115, 215, 0.1);
    color: #0f73d7;
}

.familiarity-tab.active {
    background: rgba(15, 115, 215, 0.2);
    color: #0f73d7;
    border-bottom-color: #0f73d7;
}

.familiarity-tab-content {
    display: none;
}

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

.words-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 16px 12px;
    /* Responsive grid columns */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.word-item {
    background: #222831;
    border: 1px solid #e5e1db;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 120px;
}

.word-item:hover {
    background: #34445a;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
    border-color: #d6d0c4;
}

.word-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.word-text {
    font-weight: bold;
    font-size: 16px;
    color: #e4e1e1;
}

.clickable-word {
    cursor: pointer;
    color: #4a90e2;
    transition: color 0.2s ease;
}

.clickable-word:hover {
    color: #2c5aa0;
    text-decoration: underline;
}

.confidence-stars {
    display: flex;
    gap: 3px;
    justify-content: center;
    margin-top: auto;
    padding-top: 12px;
}

.star {
    font-size: 18px;
    color: #555;
    transition: all 0.2s ease;
    cursor: pointer;
    line-height: 1;
    padding: 2px;
    border-radius: 3px;
}

.star.filled {
    color: #ffd700;
    text-shadow: 0 0 4px rgba(255, 215, 0, 0.5);
}

.star:hover {
    color: #ffed4a;
    transform: scale(1.1);
}

.clickable-star:hover {
    background: rgba(255, 215, 0, 0.2);
}


.word-meta {
    font-size: 13px;
    color: #6c757d;
    line-height: 1.4;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.word-update-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.word-update-form label {
    font-size: 14px;
    font-weight: 500;
}

.word-update-form select {
    padding: 4px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.word-update-form button {
    padding: 6px 12px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease;
}

.word-update-form button:hover {
    background: #0056b3;
}

.word-update-form button:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

/* Add word forms */
.add-word-form {
    background: 948979;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #e5e1db;
}

.form-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: end;
    margin-bottom: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 120px;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: #0f73d7;
}

.form-group input,
.form-group select {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.3);
}

.add-word-button {
    padding: 10px 20px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s ease;
    align-self: end;
}

.add-word-button:hover {
    background: #1e7e34;
}

.add-word-button:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

/* Form star rating system */
.form-stars {
    display: flex;
    gap: 4px;
    margin-top: 4px;
}

.form-stars .star {
    font-size: 20px;
    color: #ddd;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease;
    user-select: none;
}

.form-stars .star:hover {
    color: #ffd700;
    transform: scale(1.1);
}

.form-stars .star.filled {
    color: #ffd700;
}

/* Responsive grid breakpoints */
@media (min-width: 1800px) {
    .words-list {
        grid-template-columns: repeat(9, 1fr);
        gap: 18px 16px;
    }
}

@media (min-width: 1600px) and (max-width: 1799px) {
    .words-list {
        grid-template-columns: repeat(8, 1fr);
        gap: 18px 14px;
    }
}

@media (min-width: 1400px) and (max-width: 1599px) {
    .words-list {
        grid-template-columns: repeat(7, 1fr);
        gap: 16px 12px;
    }
}

@media (min-width: 1200px) and (max-width: 1399px) {
    .words-list {
        grid-template-columns: repeat(6, 1fr);
        gap: 16px 12px;
    }
}

@media (min-width: 1000px) and (max-width: 1199px) {
    .words-list {
        grid-template-columns: repeat(5, 1fr);
        gap: 16px 10px;
    }
}

@media (min-width: 800px) and (max-width: 999px) {
    .words-list {
        grid-template-columns: repeat(4, 1fr);
        gap: 14px 10px;
    }
}

@media (min-width: 600px) and (max-width: 799px) {
    .words-list {
        grid-template-columns: repeat(3, 1fr);
        gap: 14px 8px;
    }
}

@media (min-width: 400px) and (max-width: 599px) {
    .words-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px 6px;
    }
    
    .word-item {
        padding: 12px;
        min-height: 100px;
    }
    
    .word-text {
        font-size: 14px;
    }
    
    .word-meta {
        font-size: 12px;
    }
    
    .confidence-btn {
        width: 20px;
        height: 20px;
        font-size: 14px;
    }
    
    .star {
        font-size: 14px;
    }
}

@media (max-width: 399px) {
    .words-list {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .word-item {
        padding: 12px;
        min-height: 90px;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-group {
        min-width: 100%;
    }
    
    .toast-notification {
        right: 10px;
        left: 10px;
        max-width: none;
        transform: translateY(-100px);
    }
    
    .toast-notification.toast-show {
        transform: translateY(0);
    }
}

/* Empty state styling */
.empty-language {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-style: italic;
}

.stats-summary {
    background: #3B060A;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #0f73d7;
}