/* resources/css/highlighter.css */

/* استایل هایلایت */
.highlight {
    transition: all 0.2s ease;
    cursor: pointer;
    border-radius: 4px;
    padding: 2px 4px;
    margin: 0 -2px;
}

.highlight:hover {
    opacity: 0.7;
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* دیالوگ افزودن معنی */
.meaning-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.meaning-dialog.active {
    opacity: 1;
    visibility: visible;
}

.meaning-dialog-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.meaning-dialog-content {
    position: relative;
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.meaning-dialog-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.meaning-dialog-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #333;
    word-break: break-word;
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.close-btn:hover {
    background: #f0f0f0;
    color: #333;
}

.meaning-dialog-body {
    padding: 20px;
}

.meaning-dialog-body label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.meaning-dialog-body textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s;
}

.meaning-dialog-body textarea:focus {
    outline: none;
    border-color: #4CAF50;
}

.color-picker {
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.color-picker label {
    margin: 0;
}

.color-picker input {
    width: 60px;
    height: 40px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
}

.meaning-dialog-footer {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-cancel, .btn-save {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-cancel {
    background: #f5f5f5;
    color: #666;
}

.btn-cancel:hover {
    background: #e0e0e0;
    transform: translateY(-1px);
}

.btn-save {
    background: #4CAF50;
    color: white;
}

.btn-save:hover {
    background: #45a049;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.btn-save:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* تولتیپ معنی */
.meaning-tooltip {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    min-width: 250px;
    max-width: 350px;
    animation: fadeIn 0.2s ease;
    overflow: hidden;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.meaning-tooltip-content {
    padding: 16px;
}

.meaning-tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0f0f0;
}

.meaning-tooltip-header strong {
    color: #4CAF50;
    font-size: 14px;
    word-break: break-word;
}

.delete-highlight {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.delete-highlight:hover {
    background: #ffebee;
    transform: scale(1.05);
}

.meaning-tooltip-content p {
    margin: 12px 0;
    font-size: 14px;
    line-height: 1.6;
    color: #555;
    word-break: break-word;
}

.meaning-tooltip-actions {
    margin-top: 12px;
    text-align: right;
}

.edit-meaning {
    background: none;
    border: none;
    color: #2196F3;
    cursor: pointer;
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 6px;
    transition: background 0.2s;
}

.edit-meaning:hover {
    background: #e3f2fd;
}

/* انیمیشن‌ها */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}
