/* Word Lookup Popup */
.popup {
    position: absolute;
    background: white;
    border: 2px solid #3498db;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 1000;
    min-width: 250px;
    max-width: 400px;
}

.popup.hidden {
    display: none;
}

.popup .word {
    font-size: 28px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 8px;
}

.popup .pinyin {
    font-size: 16px;
    color: #3498db;
    margin-bottom: 10px;
    font-style: italic;
}

.popup .meanings {
    font-size: 14px;
    color: #555;
    margin-bottom: 10px;
    line-height: 1.5;
}

.popup .level {
    font-size: 12px;
    color: #95a5a6;
    font-weight: 500;
    text-transform: uppercase;
}

/* Welcome Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    text-align: center;
    max-width: 400px;
}

.modal-content h2 {
    color: #2c3e50;
    margin-bottom: 20px;
}

.modal-content p {
    color: #555;
    margin-bottom: 20px;
    font-size: 16px;
}

.modal-content select {
    width: 100%;
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 20px;
}

.modal-content button {
    padding: 12px 40px;
    background: #1a8917;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: background 0.2s;
}

.modal-content button:hover {
    background: #156d13;
}

.modal-content button:disabled {
    background: #95a5a6;
    cursor: not-allowed;
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.toast {
    background: white;
    border-radius: 8px;
    padding: 16px 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: slideIn 0.3s ease-out;
    border-left: 4px solid #3498db;
}

.toast.success {
    border-left-color: #27ae60;
}

.toast.error {
    border-left-color: #e74c3c;
}

.toast.info {
    border-left-color: #3498db;
}

.toast.warning {
    border-left-color: #f39c12;
}

.toast-icon {
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
    font-size: 14px;
}

.toast-message {
    color: #555;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.toast-close {
    background: none;
    border: none;
    color: #95a5a6;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.2s;
}

.toast-close:hover {
    color: #7f8c8d;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.toast.removing {
    animation: slideOut 0.3s ease-out forwards;
}

/* Responsive adjustments for popups */
@media (max-width: 1024px) {
    #toast-container {
        left: 20px;
        right: 20px;
        max-width: none;
    }
    
    .popup {
        max-width: 90vw;
    }
}
